rss2

package
Version: v0.0.0-...-5dab7ed Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2016 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RFC2822  = "Mon, _2 Jan 2006 15:04:05 -0700"
	RFC2822Z = "Mon, _2 Jan 2006 15:04:05 MST"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	Domain  string `xml:"domain,attr,omitempty"`
	Content string `xml:",chardata"`
}

type Channel

type Channel struct {
	Title         string   `xml:"title"`
	Link          string   `xml:"link"`
	Description   string   `xml:"description"`
	Language      string   `xml:"language,omitempty"`
	LastBuildDate Date     `xml:"lastBuildDate,omitempty"`
	Category      Category `xml:"category,omitempty"`
	Items         []*Item  `xml:"item"`

	Creator string    `xml:"creator"` // dc:creator
	Date    time.Time `xml:"date"`    // dc:date
}

type Date

type Date time.Time

func (Date) String

func (date Date) String() string

func (*Date) UnmarshalXML

func (date *Date) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)

type Feed

type Feed struct {
	XMLName xml.Name `xml:"rss"`
	Version string   `xml:"version,attr"`
	Channel *Channel `xml:"channel"`
}

func Parse

func Parse(r io.Reader) (feed *Feed, err error)

type Guid

type Guid struct {
	IsPermaLink bool   `xml:"isPermaLink,omitempty"`
	Content     string `xml:",chardata"`
}

type Item

type Item struct {
	Title       string     `xml:"title,omitempty"`
	Link        string     `xml:"link,omitempty"`
	Description string     `xml:"description,omitempty"`
	Author      string     `xml:"author,omitempty"` // author's email address
	Categories  []Category `xml:"category,omitempty"`
	Guid        Guid       `xml:"guid,omietmpty"`
	PubDate     Date       `xml:"pubDate,omitempty"`

	Subject string    `xml:"subject,omitempty"` // dc:subject
	Creator string    `xml:"creator,omitempty"` // dc:creator
	Date    time.Time `xml:"date,omitempty"`    // dc:date
	Encoded string    `xml:"encoded,omitempty"` // content:encoded
}

func (*Item) Content

func (item *Item) Content() string

func (*Item) ID

func (item *Item) ID() (string, error)

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL