feeds

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2018 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(isItunes bool) interface{}

return XML-ready object for a Channel

func (*Channel) ToXML

func (c *Channel) ToXML(isItunes bool) (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:"-"`
	ItunesCategory *ItunesCategory
	ItunesImage    *ItunesImage
	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:"-"`
}

type ItunesCategory

type ItunesCategory struct {
	XMLName xml.Name `xml:"itunes:category"`
	Text    string   `xml:"text,attr"`
}

type ItunesImage

type ItunesImage struct {
	XMLName xml.Name `xml:"itunes:image"`
	Href    string   `xml:"href,attr"`
}

Jump to

Keyboard shortcuts

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