atom

package
v2.4.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	Term   string `json:"term,omitempty"`
	Scheme string `json:"scheme,omitempty"`
	Label  string `json:"label,omitempty"`
}

Category is category metadata for Feeds and Entries

type Content

type Content struct {
	Src   string `json:"src,omitempty"`
	Type  string `json:"type,omitempty"`
	Value string `json:"value,omitempty"`
}

Content either contains or links to the content of the entry

type Entry

type Entry struct {
	Title           string         `json:"title,omitempty"`
	ID              string         `json:"id,omitempty"`
	Updated         string         `json:"updated,omitempty"`
	UpdatedParsed   *time.Time     `json:"updatedParsed,omitempty"`
	Summary         string         `json:"summary,omitempty"`
	Authors         []*Person      `json:"authors,omitempty"`
	Contributors    []*Person      `json:"contributors,omitempty"`
	Categories      []*Category    `json:"categories,omitempty"`
	Links           []*Link        `json:"links,omitempty"`
	Rights          string         `json:"rights,omitempty"`
	Published       string         `json:"published,omitempty"`
	PublishedParsed *time.Time     `json:"publishedParsed,omitempty"`
	Source          *Source        `json:"source,omitempty"`
	Content         *Content       `json:"content,omitempty"`
	Media           *ext.Media     `json:"media,omitempty"`
	Youtube         *ext.Youtube   `json:"youtube,omitempty"`
	Extensions      ext.Extensions `json:"extensions,omitempty"`
}

Entry is an Atom Entry

func (*Entry) GetAuthor

func (self *Entry) GetAuthor() *Person

func (*Entry) GetCategories

func (self *Entry) GetCategories() []string

func (*Entry) GetContent

func (self *Entry) GetContent() string
func (self *Entry) GetLink() string
func (self *Entry) GetLinks() []string

func (*Entry) GetPublished

func (self *Entry) GetPublished() string

func (*Entry) GetPublishedParsed

func (self *Entry) GetPublishedParsed() *time.Time

type Feed

type Feed struct {
	Title         string         `json:"title,omitempty"`
	ID            string         `json:"id,omitempty"`
	Updated       string         `json:"updated,omitempty"`
	UpdatedParsed *time.Time     `json:"updatedParsed,omitempty"`
	Subtitle      string         `json:"subtitle,omitempty"`
	Links         []*Link        `json:"links,omitempty"`
	Language      string         `json:"language,omitempty"`
	Generator     *Generator     `json:"generator,omitempty"`
	Icon          string         `json:"icon,omitempty"`
	Rights        string         `json:"rights,omitempty"`
	Contributors  []*Person      `json:"contributors,omitempty"`
	Authors       []*Person      `json:"authors,omitempty"`
	Categories    []*Category    `json:"categories,omitempty"`
	Entries       []*Entry       `json:"entries,omitempty"`
	Youtube       *ext.Youtube   `json:"youtube,omitempty"`
	Extensions    ext.Extensions `json:"extensions,omitempty"`
	Version       string         `json:"version,omitempty"`
}

Feed is an Atom Feed

func (*Feed) GetAuthor

func (self *Feed) GetAuthor() *Person

func (*Feed) GetCategories

func (self *Feed) GetCategories() []string
func (self *Feed) GetFeedLink() string

func (*Feed) GetGenerator

func (self *Feed) GetGenerator() string
func (self *Feed) GetLink() string
func (self *Feed) GetLinks() (links []string)

func (*Feed) ImageURL

func (self *Feed) ImageURL() string

func (*Feed) String

func (self *Feed) String() string

type Generator

type Generator struct {
	Value   string `json:"value,omitempty"`
	URI     string `json:"uri,omitempty"`
	Version string `json:"version,omitempty"`
}

Generator identifies the agent used to generate a feed, for debugging and other purposes.

type Link struct {
	Href     string `json:"href,omitempty"`
	Hreflang string `json:"hreflang,omitempty"`
	Rel      string `json:"rel,omitempty"`
	Type     string `json:"type,omitempty"`
	Title    string `json:"title,omitempty"`
	Length   string `json:"length,omitempty"`
}

Link is an Atom link that defines a reference from an entry or feed to a Web resource

func ParseLink(name string, p *xml.Parser) (*Link, error)

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser is an Atom Parser

func NewParser

func NewParser() *Parser

NewParser creates a new Atom parser

func (*Parser) Err

func (self *Parser) Err() error

func (*Parser) Parse

func (self *Parser) Parse(r io.Reader, opts ...options.Option) (*Feed, error)

Parse parses an xml feed into an atom.Feed

type Person

type Person struct {
	Name  string `json:"name,omitempty"`
	Email string `json:"email,omitempty"`
	URI   string `json:"uri,omitempty"`
}

Person represents a person in an Atom feed for things like Authors, Contributors, etc

type Source

type Source struct {
	Title         string         `json:"title,omitempty"`
	ID            string         `json:"id,omitempty"`
	Updated       string         `json:"updated,omitempty"`
	UpdatedParsed *time.Time     `json:"updatedParsed,omitempty"`
	Subtitle      string         `json:"subtitle,omitempty"`
	Links         []*Link        `json:"links,omitempty"`
	Generator     *Generator     `json:"generator,omitempty"`
	Icon          string         `json:"icon,omitempty"`
	Rights        string         `json:"rights,omitempty"`
	Contributors  []*Person      `json:"contributors,omitempty"`
	Authors       []*Person      `json:"authors,omitempty"`
	Categories    []*Category    `json:"categories,omitempty"`
	Extensions    ext.Extensions `json:"extensions,omitempty"`
}

Source contains the feed information for another feed if a given entry came from that feed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL