diff options
| author | Christine Dodrill <me@christine.website> | 2019-12-09 10:48:40 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-09 10:48:40 -0500 |
| commit | eb26857c1d5973bedc91c3fc1acaf4434809bbd5 (patch) | |
| tree | 926be802355da24afb3cf6ed8496a2b2d656e1a1 /internal/jsonfeed/jsonfeed.go | |
| parent | 583cf248b3fe7ebb06d89ba32fddeee70fb14c2c (diff) | |
| download | xesite-eb26857c1d5973bedc91c3fc1acaf4434809bbd5.tar.xz xesite-eb26857c1d5973bedc91c3fc1acaf4434809bbd5.zip | |
Within package layout (#102)
* blog: go package layout
* eat my own dogfood
* internal: test date
* blog/go-package-layout: streamline
* oops
Diffstat (limited to 'internal/jsonfeed/jsonfeed.go')
| -rw-r--r-- | internal/jsonfeed/jsonfeed.go | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/internal/jsonfeed/jsonfeed.go b/internal/jsonfeed/jsonfeed.go deleted file mode 100644 index 913880d..0000000 --- a/internal/jsonfeed/jsonfeed.go +++ /dev/null @@ -1,73 +0,0 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/ - -package jsonfeed - -import ( - "encoding/json" - "io" - "time" -) - -const CurrentVersion = "https://jsonfeed.org/version/1" - -type Item struct { - ID string `json:"id"` - URL string `json:"url"` - ExternalURL string `json:"external_url"` - Title string `json:"title"` - ContentHTML string `json:"content_html"` - ContentText string `json:"content_text"` - Summary string `json:"summary"` - Image string `json:"image"` - BannerImage string `json:"banner_image"` - DatePublished time.Time `json:"date_published"` - DateModified time.Time `json:"date_modified"` - Author Author `json:"author"` - Tags []string `json:"tags"` -} - -type Author struct { - Name string `json:"name"` - URL string `json:"url"` - Avatar string `json:"avatar"` -} - -type Hub struct { - Type string `json:"type"` - URL string `json:"url"` -} - -type Attachment struct { - URL string `json:"url"` - MIMEType string `json:"mime_type"` - Title string `json:"title"` - SizeInBytes int64 `json:"size_in_bytes"` - DurationInSeconds int64 `json:"duration_in_seconds"` -} - -type Feed struct { - Version string `json:"version"` - Title string `json:"title"` - HomePageURL string `json:"home_page_url"` - FeedURL string `json:"feed_url"` - Description string `json:"description"` - UserComment string `json:"user_comment"` - NextURL string `json:"next_url"` - Icon string `json:"icon"` - Favicon string `json:"favicon"` - Author Author `json:"author"` - Expired bool `json:"expired"` - Hubs []Hub `json:"hubs"` - Items []Item `json:"items"` -} - -func Parse(r io.Reader) (Feed, error) { - var feed Feed - decoder := json.NewDecoder(r) - if err := decoder.Decode(&feed); err != nil { - return Feed{}, err - } - return feed, nil -} |
