Documentation
¶
Overview ¶
jsonfeed is a package for parsing and constructing JSON Feeds: https://jsonfeed.org/version/1.1. It explicitly supports JSON Feed Version 1.1.
Index ¶
Constants ¶
const Version = "https://jsonfeed.org/version/1.1"
Version is the URL of the JSON Feed spec implemented here.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct { URL string `json:"url"` MIMEType string `json:"mime_type"` Title opt.String `json:"title,omitempty"` SizeInBytes opt.Int `json:"size_in_bytes,omitempty"` DurationInSeconds opt.Int `json:"duration_in_seconds,omitempty"` }
An Attachment is an attachment on an item in a JSON Feed.
func NewAttachment ¶
func NewAttachment(url string, mimeType string) Attachment
NewAttachment constructs a minimal Attachment.
func (Attachment) Validate ¶
func (a Attachment) Validate() error
Validate that A represents a valid JSON Feed attachment.
type Author ¶
type Author struct { Name opt.String `json:"name,omitempty"` URL opt.String `json:"url,omitempty"` Avatar opt.String `json:"avatar,omitempty"` }
An Author is a JSON Feed structure identifying an Author. Feeds and Items both have single authors.
type Feed ¶
type Feed struct { Version string `json:"version"` Title string `json:"title"` HomePageURL opt.String `json:"home_page_url,omitempty"` FeedURL opt.String `json:"feed_url,omitempty"` Description opt.String `json:"description,omitempty"` UserComment opt.String `json:"user_comment,omitempty"` NextURL opt.String `json:"next_url,omitempty"` Icon opt.String `json:"icon,omitempty"` Favicon opt.String `json:"favicon,omitempty"` Author *Author `json:"author,omitempty"` // Deprecated Authors []Author `json:"authors,omitempty"` Language opt.String `json:"language,omitempty"` Expired opt.Bool `json:"expired,omitempty"` Hubs []Hub `json:"hubs,omitempty"` Items []Item `json:"items"` }
A Feed is a JSON Feed.
type Hub ¶
A Hub describes an endpoint that can be used to subscribe to real-time notifications from the publisher of this feed.
type IndexedMissingRequiredValueError ¶
type IndexedMissingRequiredValueError struct { Index int // contains filtered or unexported fields }
IndexedMissingRequiredValueError is a MissingRequiredValueError for an item at position INDEX in some iterable within the field (e.g. an array of Items or an array of Hubs).
func (IndexedMissingRequiredValueError) Error ¶
func (e IndexedMissingRequiredValueError) Error() string
type Item ¶
type Item struct { ID string `json:"id"` URL opt.String `json:"url,omitempty"` ExternalURL opt.String `json:"external_url,omitempty"` Title opt.String `json:"title,omitempty"` ContentHTML opt.String `json:"content_html,omitempty"` ContentText opt.String `json:"content_text,omitempty"` Summary opt.String `json:"summary,omitempty"` Image opt.String `json:"image,omitempty"` BannerImage opt.String `json:"banner_image,omitempty"` DatePublished opt.String `json:"date_published,omitempty"` DateModified opt.String `json:"date_modified,omitempty"` Author *Author `json:"author,omitempty"` // Deprecated Authors []Author `json:"authors,omitempty"` Tags []string `json:"tags,omitempty"` Language opt.String `json:"language,omitempty"` Attachments []Attachment `json:"attachments,omitempty"` }
An Item is an item in a JSON Feed.
type MissingRequiredValueError ¶
A MissingRequiredValueError indicates that a required value in some JSON feed object is undefined. STRUCTURE denotes the kind of object (for example, Item or Hub). KEY is the JSON key for the missing field.
func (MissingRequiredValueError) Error ¶
func (e MissingRequiredValueError) Error() string