feed

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFeedUrlForUsername

func GetFeedUrlForUsername(user string) string

GetFeedUrlForUsername produces the rss feed url for a given username

Types

type Attributes

type Attributes struct {
	Type string `json:"type"`
	Url  string `json:"url"`
}

Attributes represents the json structure inside the attributes node

func (*Attributes) UnmarshalXML

func (c *Attributes) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML will parse the enclosed json and produce an Attributes element

type Channel

type Channel struct {
	Title       string `xml:"title"`
	Link        string `xml:"link"`
	Description string `xml:"description"`
	Items       []Item `xml:"item"`
}

Channel contains all the meta information for the channel and a list of items

type Enclosure

type Enclosure struct {
	Url  string `xml:"url,attr"`
	Type string `xml:"type,attr"`
}

Enclosure contains the url and type of the item

type Item

type Item struct {
	Enclosure  Enclosure  `xml:"enclosure"`
	Link       string     `xml:"link"`
	Guid       string     `xml:"guid"`
	PubDate    PubDate    `xml:"pubDate"`
	Attributes Attributes `xml:"attributes"`
}

Item is one entry in the feed

type PubDate

type PubDate struct {
	time.Time
}

PubDate wraps time.Time to implement the needed interface for the xml unmarshaller

func (*PubDate) UnmarshalXML

func (c *PubDate) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML will parse the time format in the feed

type Rss

type Rss struct {
	Channel Channel `xml:"channel"`
}

Rss it the root node of the rss feed containing just one Channel node

func GetLocalArchiveFeed

func GetLocalArchiveFeed() (Rss, error)

GetLocalArchiveFeed creates a feed including all locally archived data

func NewFeedFromXml

func NewFeedFromXml(input []byte) Rss

NewFeedFromXml produces an Rss struct with the information based on the given xml

Jump to

Keyboard shortcuts

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