feed

package
v0.6.12 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2021 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomFeed

type AtomFeed struct {
	// Required
	Title       string `xml:"title"`
	Link        string `xml:"href,attr"`
	Description string `xml:"description"`

	// Optional
	PubDate   string `xml:"updated"`
	Generator string `xml:"generator"`

	Items []AtomItem `xml:"entry"`
}

AtomFeed :)

type AtomItem

type AtomItem struct {
	Title       string `xml:"title"`
	Link        string `xml:"-"`
	Description string `xml:"subtitle"`
	Author      string `xml:"author"`
	Category    struct {
		Domain string `xml:"term,attr"`
		Name   string `xml:"label,attr"`
	} `xml:"category"`
	Comments  string `xml:"-"`
	Enclosure struct {
		URL  string `xml:"rel,attr"`
		Len  int64  `xml:"-"`
		Type string `xml:"href,attr"`
	} `xml:"link"`
	GUID struct {
		IsPermaLink bool   `xml:"-"`
		Value       string `xml:",chardata"`
	} `xml:"id"`
	SpubDate string `xml:"updated"`
	Source   string `xml:"-"`
}

AtomItem :)

type Channel

type Channel struct {
	// Required
	Title       string `xml:"title"`
	Link        string `xml:"link"`
	Description string `xml:"description"`

	// Optional
	Language  string `xml:"language"`
	Copyright string `xml:"copyright"`
	//managingEditor
	//webMaster
	PubDate string `xml:"pubDate"`
	//lastBuildDate
	//category
	Generator string `xml:"generator"`

	Items []RSSItem `xml:"item"`
}

Channel :)

type Item

type Item struct {
	Title       string
	Link        string
	Description string
	Author      string
	Category    string
	Comments    string

	// Enclosure
	URL  string
	Len  int64
	Type string

	GUID   string
	Date   time.Time
	Source string
}

Item :)

func Parse

func Parse(body []byte) (i []Item, e error)

Parse :)

type RSSFeed

type RSSFeed struct {
	Version string    `xml:"version,attr"`
	Channel []Channel `xml:"channel"`
}

RSSFeed :)

type RSSItem

type RSSItem struct {
	Title       string `xml:"title"`
	Link        string `xml:"link"`
	Description string `xml:"description"`
	Author      string `xml:"author"`
	Category    struct {
		Domain string `xml:"domain,attr"`
		Name   string `xml:",chardata"`
	} `xml:"category"`
	Comments  string `xml:"comments"`
	Enclosure struct {
		URL  string `xml:"url,attr"`
		Len  int64  `xml:"length,attr"`
		Type string `xml:"type,attr"`
	} `xml:"enclosure"`
	GUID struct {
		IsPermaLink bool   `xml:"type,attr"`
		Value       string `xml:",chardata"`
	} `xml:"guid"`
	SpubDate string `xml:"pubDate"`
	Source   string `xml:"source"`
}

RSSItem :)

Jump to

Keyboard shortcuts

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