model

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Feed

type Feed struct {
	Title       string   `json:"title"`
	Description string   `json:"description"`
	UpdateURL   string   `json:"updateurl"`
	Link        string   `json:"link"`
	Items       []string `json:"items"`
}

Feed is the structure of the Feed from RSS that we care about. The Items contains the unique Location.

func CreateFeed

func CreateFeed(feed *gofeed.Feed, url string) *Feed

CreateFeed will process the RSS/ATOM Feed into our Feed structure

func (*Feed) FindNewItems

func (f *Feed) FindNewItems() ([]*Item, error)

FindNewItems will process the items under the feed and add return any new ones since last update

type Feeds

type Feeds map[string]*Feed

Feeds is a map of the UpdateURL to the Feed.

type Item

type Item struct {
	FeedURL  string    `json:"feedurl"`
	Title    string    `json:"title"`
	Content  string    `json:"content"`
	Link     string    `json:"link"`
	Date     time.Time `json:"date"`
	Location string    `json:"location"`
	Type     string    `json:"type"`
	Length   string    `json:"length"`
	Read     bool      `json:"read"`
}

Item is the structure of the Item from RSS that we care about.

func CreateItem

func CreateItem(item *gofeed.Item) *Item

CreateItem will process the RSS/ATOM Item element into our Item structure

type Items

type Items map[string]*Item

Items is a map of the Location to the Item

type Queue

type Queue []*QueueItem

Queue of the items to be played

type QueueItem

type QueueItem struct {
	Item        Item `json:"item"`
	PlaybackPOS int  `json:"playbackposition"`
}

QueueItem contains relevant data for the queue

func (*QueueItem) Compare

func (q *QueueItem) Compare(i *QueueItem) bool

Compare will determine equality of dates

Jump to

Keyboard shortcuts

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