feeds

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomLink struct {
	XMLName xml.Name `xml:"atom:link"`
	Href    string   `xml:"href,attr"`
	Rel     string   `xml:"rel,attr"`
	Type    string   `xml:"type,attr"`
}

type Channel

type Channel struct {
	XMLName       xml.Name `xml:"channel"`
	AtomLink      *AtomLink
	Ttl           int    `xml:"ttl,omitempty"`
	LastBuildDate string `xml:"lastBuildDate,omitempty"`
	*Feed
}

func (*Channel) FeedXml

func (c *Channel) FeedXml() interface{}

return XML-ready object for a Channel

func (*Channel) ToXML

func (c *Channel) ToXML() (string, error)

turn a feed object (either a Feed, AtomFeed, or RssFeed) into xml returns an error if xml marshaling fails

type Description

type Description struct {
	XMLName xml.Name `xml:"description"`
	Text    string   `xml:",cdata"`
}

type Enclosure

type Enclosure struct {
	XMLName xml.Name `xml:"enclosure"`
	Url     string   `xml:"url,attr"`
	Length  int64    `xml:"length,attr"`
	Type    string   `xml:"type,attr"`
}

type Feed

type Feed struct {
	Title       string    `xml:"title"`       // required
	Link        string    `xml:"link"`        // required
	Description string    `xml:"description"` // required
	Language    string    `xml:"language"`
	Copyright   string    `xml:"copyright"`
	Author      string    `xml:"author,omitempty"`
	PubDate     string    `xml:"pubDate,omitempty"`
	Created     time.Time `xml:"-"`
	Updated     time.Time `xml:"-"`
	Items       []*Item
}

func (*Feed) RssFeed

func (r *Feed) RssFeed() (channel *Channel)

type Item

type Item struct {
	XMLName      xml.Name     `xml:"item"`
	Title        string       `xml:"title"`       // required
	Link         string       `xml:"link"`        // required
	Description  *Description `xml:"description"` // required
	Author       string       `xml:"dc:creator,omitempty"`
	SimpleAuthor string       `xml:"author,omitempty"`
	Category     string       `xml:"category,omitempty"`
	Comments     string       `xml:"comments,omitempty"`
	Enclosure    *Enclosure
	Guid         string    `xml:"guid,omitempty"`
	Source       string    `xml:"source,omitempty"`
	PubDate      string    `xml:"pubDate,omitempty"` // created or updated
	Created      time.Time `xml:"-"`
}

Jump to

Keyboard shortcuts

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