Back to godoc.org

Package parser

v0.0.0-...-ffd16d0
Latest Go to latest

The latest major version is .

Published: Jul 8, 2020 | License: LGPL-3.0 | Module: github.com/urandom/readeef

Index

Constants

const (
	RFC1123NoSecond = "Mon, 02 Jan 2006 15:04 MST"
)

type Article

type Article struct {
	Title       string
	Description string
	Link        string
	Guid        string
	Date        time.Time
}

type Feed

type Feed struct {
	Title       string
	Description string
	SiteLink    string
	HubLink     string
	Image       Image
	Articles    []Article
	TTL         time.Duration
	SkipHours   map[int]bool
	SkipDays    map[string]bool
}

func ParseAtom

func ParseAtom(b []byte) (Feed, error)

func ParseFeed

func ParseFeed(source []byte, funcs ...func([]byte) (Feed, error)) (Feed, error)

func ParseRss1

func ParseRss1(b []byte) (Feed, error)

func ParseRss2

func ParseRss2(b []byte) (Feed, error)

type Image

type Image struct {
	Title  string
	Url    string
	Width  int
	Height int
}

type Opml

type Opml struct {
	Feeds []OpmlFeed
}

func ParseOpml

func ParseOpml(content []byte) (Opml, error)

type OpmlBody

type OpmlBody struct {
	Outline []OpmlOutline `xml:"outline"`
}

type OpmlFeed

type OpmlFeed struct {
	Title string
	URL   string
	Tags  []string
}

type OpmlHead

type OpmlHead struct {
	Title string `xml:"title"`
}

type OpmlOutline

type OpmlOutline struct {
	Type     string        `xml:"type,attr,omitempty"`
	Text     string        `xml:"text,attr,omitempty"`
	Title    string        `xml:"title,attr,omitempty"`
	XmlUrl   string        `xml:"xmlUrl,attr,omitempty"`
	HtmlUrl  string        `xml:"htmlUrl,attr,omitempty"`
	URL      string        `xml:"url,attr,omitempty"`
	Category string        `xml:"category,attr,omitempty"`
	Outline  []OpmlOutline `xml:"outline"`
}

type OpmlXml

type OpmlXml struct {
	XMLName xml.Name `xml:"opml"`
	Version string   `xml:"version,attr"`
	Head    OpmlHead `xml:"head"`
	Body    OpmlBody `xml:"body"`
}

type RssItem

type RssItem struct {
	XMLName     xml.Name   `xml:"item"`
	Id          string     `xml:"guid"`
	Title       string     `xml:"title"`
	Link        string     `xml:"link"`
	Description rssContent `xml:"description"`
	Content     rssContent `xml:"http://purl.org/rss/1.0/modules/content/ encoded"`
	PubDate     string     `xml:"pubDate"`
	Date        string     `xml:"date"`
	TTL         int        `xml:"ttl"`
	SkipHours   []int      `xml:"skipHours>hour"`
	SkipDays    []string   `xml:"skipDays>day"`
}

RssItem is the base content for both rss1 and rss2 feeds. The only reason it's public is because of the refrect package

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier