subscription

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: 7 Imported by: 0

Documentation

Overview

Package subscription handles the state of a subscription to a given feed

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry 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"`
	GUID        string    `msgpack:"guid,omitempty"`
	Categories  []string  `msgpack:"categories,omitempty"`
	ImageTitle  string    `msgpack:"image_title,omitempty"`
	ImageURL    string    `msgpack:"image_url, omitempty"`
	AuthorName  string    `msgpack:"author_name,omitempty"`
	AuthorEmail string    `msgpack:"author_email,omitempty"`
}

Entry represents a single entry in a subscription feed, it has slightly different semantics from rss.Item

func (Entry) ID

func (e Entry) ID() (string, error)

ID creates a unique ID for the entry

type Options

type Options struct {
	// IncludeRemovedEntries controls whether we keep entries not in the current FeedState in the Subscription
	IncludeRemovedEntries bool `msgpack:"include_removed_entries,omitempty"`
}

Options lets one control exactly how a subscription state is managed

type State

type State interface {
	EntryList() []Entry
	UniqueID() uuid.UUID
}

State represents the current state of a subscription to a feed

func NewState

func NewState(url string, opt Options) (State, error)

NewState creates a new subscription.State instance against a given URL

Jump to

Keyboard shortcuts

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