rss

package
v0.0.0-...-92a45cc Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check()

func In

func In()

Types

type Atom

type Atom struct {
	XMLName xml.Name `xml:"feed"`

	Title   string `xml:"title"`
	Updated string `xml:"updated"`

	Entries []struct {
		ID      string `xml:"id"`
		Updated string `xml:"updated"`
		Title   string `xml:"title"`
		Content string `xml:"content"`
		Author  string `xml:"author>name"`
	} `xml:"entry"`
}

type Config

type Config struct {
	Version struct {
		Ref string `json:"ref"`
	} `json:"version"`

	Source struct {
		URL           string `json:"url"`
		SkipTLSVerify bool   `json:"skip_tls_verify"`
	} `json:"source"`
}

type Feed

type Feed []Post

func Parse

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

func ParseAtom

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

func ParseRSS

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

func ParseURL

func ParseURL(u string, verify bool) (Feed, []byte, error)

type Metadata

type Metadata struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Output

type Output struct {
	Version struct {
		Ref string `json:"ref"`
	} `json:"version"`

	Metadata []Metadata `json:"metadata"`
}

type Post

type Post struct {
	Title       string `json:"Title"`
	Intro       string `json:"Intro"`
	Full        string `json:"Content"`
	Timestamp   int64  `json:"PubDate"`
	Author      string `json:"Author"`
	Description string `json:"Description"`
	Link        string `json:"Link"`
}

type RSS

type RSS struct {
	XMLName xml.Name `xml:"rss"`
	Version string   `xml:"version,attr"`

	Title         string `xml:"channel>title"`
	Link          string `xml:"channel>link"`
	Description   string `xml:"channel>description"`
	LastBuildDate string `xml:"channel>lastBuildDate"`
	PubDate       string `xml:"channel>pubDate"`
	Items         []struct {
		Title       string   `xml:"title"`
		Author      string   `xml:"author"`
		Link        string   `xml:"link"`
		Description string   `xml:"description"`
		Content     string   `xml:"encoded"`
		PubDate     string   `xml:"pubDate"`
		Comments    string   `xml:"comments"`
		Category    []string `xml:"category"`
	} `xml:"channel>item"`
}

Jump to

Keyboard shortcuts

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