rss

package
v0.0.0-...-467d16e Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2018 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package rss implements a wrapper around an rss feed that exposes useful properties about the feed including elements, hash, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Feed

type Feed struct {
	Title       string     `msgpack:"title,omitempty"`
	Description string     `msgpack:"description,omitempty"`
	Link        string     `msgpack:"link,omitempty"`
	FeedLink    string     `msgpack:"feedLink,omitempty"`
	Updated     *time.Time `msgpack:"updated,omitempty"`
	Published   *time.Time `msgpack:"published,omitempty"`
	Author      *Person    `msgpack:"author,omitempty"`
	Language    string     `msgpack:"language,omitempty"`
	Image       *Image     `msgpack:"image,omitempty"`
	Copyright   string     `msgpack:"copyright,omitempty"`
	Categories  []string   `msgpack:"categories,omitempty"`
	Items       []*Item    `msgpack:"items"`
}

Feed is an RSS Feed

type Image

type Image struct {
	URL   string `msgpack:"url,omitempty"`
	Title string `msgpack:"title,omitempty"`
}

Image is an image that is the artwork for a given

type Item

type Item struct {
	Title       string     `msgpack:"title,omitempty"`
	Description string     `msgpack:"description,omitempty"`
	Content     string     `msgpack:"content,omitempty"`
	Link        string     `msgpack:"link,omitempty"`
	Updated     *time.Time `msgpack:"updated,omitempty"`
	Published   *time.Time `msgpack:"published,omitempty"`
	Author      *Person    `msgpack:"author,omitempty"`
	GUID        string     `msgpack:"guid,omitempty"`
	Image       *Image     `msgpack:"image,omitempty"`
	Categories  []string   `msgpack:"categories,omitempty"`
}

Item is the universal Item type that atom.Entry and rss.Item gets translated to. It represents a single entry in a given feed.

type Person

type Person struct {
	Name  string `msgpack:"name,omitempty"`
	Email string `msgpack:"email,omitempty"`
}

Person is an individual specified in a feed

type State

type State interface {
	// FetchTime is when this instance of the feed was fetched
	FetchTime() time.Time
	// Hash returns an MD5 hash of the feed from when it was fetched
	Hash() string
	// UpdatedState goes over the network and fetches the current state of the RSS feed
	UpdatedState() (State, error)
	// Feed returns the underlying Feed object
	Feed() Feed
}

State is an abstract representation of an RSS/Atom Feed state with additional properties and methods

func NewState

func NewState(url string) (State, error)

NewState returns a new instance of the RichFeed type

Jump to

Keyboard shortcuts

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