feed

package
v0.0.0-...-eb961a3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WORDPRESS_DATE_FORMAT               = "Mon, 02 Jan 2006 15:04:05 -0700"
	DEFAULT_TIMEOUT       time.Duration = 10  // seconds
	RESPONSE_TIMEOUT      time.Duration = 120 // seconds
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	Title         string      `xml:"title"`
	Link          string      `xml:"link"`
	Description   string      `xml:"description"`
	Language      string      `xml:"language"`
	LastBuildDate RSSDate     `xml:"lastBuildDate"`
	Image         ImageAsset  `xml:"image"`
	Subtitle      string      `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd subtitle"`
	Owner         ItunesOwner `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd owner"`
	Item          []Item      `xml:"item"`
}

Channel struct for RSS

func RSS

func RSS(url string) (*Channel, error)

Read a string url and returns a Channel struct, error

type Fetcher

type Fetcher interface {
	Get(url string) (resp *http.Response, err error)
}

Fetcher interface

type ImageAsset

type ImageAsset struct {
	URL   string `xml:"url"`
	Title string `xml:"title"`
	Link  string `xml:"link"`
}

type Item

type Item struct {
	Title       string          `xml:"title"`
	Link        string          `xml:"link"`
	Comments    string          `xml:"comments"`
	PubDate     RSSDate         `xml:"pubDate"`
	GUID        string          `xml:"guid"`
	Category    []string        `xml:"category"`
	Enclosure   []ItemEnclosure `xml:"enclosure"`
	Description string          `xml:"description"`
	Text        string          `xml:"http://purl.org/rss/1.0/modules/content/ encoded"`
	Duration    string          `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd duration"`
	Author      string          `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd author"`
}

Item struct for each Item in the Channel

type ItemEnclosure

type ItemEnclosure struct {
	URL    string `xml:"url,attr"`
	Length int    `xml:"length,attr"`
	Type   string `xml:"type,attr"`
}

ItemEnclosure struct for each Item Enclosure

type ItunesOwner

type ItunesOwner struct {
	Name  string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd name"`
	Email string `xml:"http://www.itunes.com/dtds/podcast-1.0.dtd email"`
}

iTunes namespace

type RSSDate

type RSSDate string

Date type

func (RSSDate) Format

func (d RSSDate) Format(format string) (string, error)

Format (Date function), takes a string and returns string, error

func (RSSDate) MustFormat

func (d RSSDate) MustFormat(format string) string

MustFormat (Date function), take a string and returns string

func (RSSDate) Parse

func (d RSSDate) Parse() (time.Time, error)

Parse (Date function) and returns Time, error

func (RSSDate) ParseWithFormat

func (d RSSDate) ParseWithFormat(format string) (time.Time, error)

ParseWithFormat (Date function), takes a string and returns Time, error

Jump to

Keyboard shortcuts

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