rss

package
v0.0.0-...-0a97e14 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	// Required
	Title       string        `xml:"title"`
	Link        string        `xml:"link"`
	Description template.HTML `xml:"description"`
	// Optional
	Content  template.HTML `xml:"encoded"`
	PubDate  string        `xml:"pubDate"`
	Comments string        `xml:"comments"`
	Author   string        `xml:"dc:creator"`
}

Item is a sub struct in Rss

type Rss

type Rss struct {
	XMLName xml.Name `xml:"rss"`
	Version string   `xml:"version,attr"`
	// Required
	Title       string `xml:"channel>title"`
	Link        string `xml:"channel>link"`
	Description string `xml:"channel>description"`
	// Optional
	PubDate       string `xml:"channel>pubDate"`
	LastBuildDate string `xml:"channel>lastBuildDate"`
	ItemList      []Item `xml:"channel>item"`
}

Rss Feed XML struct

func New

func New() *Rss

New return Rss type pointer

func (*Rss) Convert

func (r *Rss) Convert() []*entity.Post

func (*Rss) Diff

func (r *Rss) Diff(latest time.Time, underCondition bool) []*entity.Post

Jump to

Keyboard shortcuts

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