subscriptions

package
v0.0.0-...-44d4e1f Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package subscriptions implements a list of feeds along with operations to modify the list.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsOpml

func AsOpml(s List) opml.Opml

AsOpml returns a representation of the Subscriptions as an OMPL document.

func Diff

func Diff(a, b *Subscriptions) (added, removed []string)

Diff finds the difference between two subscription lists.

Types

type Change

type Change struct {
	Type ChangeType
	URI  string
}

type ChangeType

type ChangeType int
const (
	Removed ChangeType = iota
	Added
)

type List

type List interface {
	List() []Subscription
	Refresh(Subscription)
}

A List provides a read-only view to Subscriptions.

type Subscription

type Subscription struct {
	// URI the subscription was created with, never changed!
	URI string `json:"uri"`

	FeedURL         string `json:"feedUrl"`
	WebsiteURL      string `json:"websiteUrl"`
	FeedTitle       string `json:"feedTitle"`
	FeedDescription string `json:"feedDescription"`
}

Subscription represents the metadata for a single feed.

type Subscriptions

type Subscriptions struct {
	// contains filtered or unexported fields
}

Subscriptions is a list of subscriptions that is safe to access across goroutines.

func FromOpml

func FromOpml(doc opml.Opml) *Subscriptions

FromOpml adds all feeds listed in an opml.Opml document to the Subscriptions.

func New

func New() *Subscriptions

New returns an empty subscription list.

func (*Subscriptions) Add

func (s *Subscriptions) Add(uri string)

Add a new feed url to the list.

func (*Subscriptions) List

func (s *Subscriptions) List() []Subscription

List of feeds subscribed to.

func (*Subscriptions) Refresh

func (s *Subscriptions) Refresh(sub Subscription)

Refresh the data for a particular Subscription.

func (*Subscriptions) Remove

func (s *Subscriptions) Remove(uri string)

Remove the Subscription with url provided.

Directories

Path Synopsis
Package opml implements functions capable of parsing opml files containing a list of feed subscriptions.
Package opml implements functions capable of parsing opml files containing a list of feed subscriptions.

Jump to

Keyboard shortcuts

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