Documentation
¶
Overview ¶
Package rss is a backend of an RSS feed, of rss://<name>/<host>/<path>, whose items are files, of their days, /YYYY/YYYY-MM/DD-<title>.html, each an HTML page of the item, with its title, author, date and link as its metadata, and its enclosure, such as a podcast's episode, too. It's read only, and is polled, at the feed's ttl, or its refresh interval, for the changes to its items, of their guids. It's a backend which isn't built into the registry, which a program adds with registry.WithBackend(rss.Scheme, rss.Description, rss.Open).
Index ¶
- Constants
- func Open(ctx context.Context, u *url.URL, cache store.CacheStore, opts gofiler.Opts) (gofiler.Filer, error)
- type Filer
- func (self *Filer) Actions() []gofiler.Action
- func (self *Filer) Clone(ctx context.Context, patch url.Values) (gofiler.Filer, error)
- func (self *Filer) CreateObject(context.Context, schema.CreateObjectRequest) (*schema.Object, error)
- func (self *Filer) DeleteObjects(context.Context, schema.DeleteObjectsRequest) (*schema.DeleteObjectsResponse, error)
- func (self *Filer) Description() string
- func (self *Filer) GetObject(ctx context.Context, req schema.GetObjectRequest) (*schema.Object, error)
- func (self *Filer) ListObjects(ctx context.Context, req schema.ListObjectsRequest) (schema.ListObjectsIterator, error)
- func (self *Filer) ReadObject(ctx context.Context, req schema.GetObjectRequest) (gofiler.ReadObjectFunc, *schema.Object, error)
- func (self *Filer) URL() *url.URL
- func (self *Filer) WatchObjects(ctx context.Context, ch chan<- schema.Event) error
Constants ¶
const ( // Scheme is the scheme of a feed's URL, rss://<name>/<host>/<path> Scheme = "rss" // Description is what the backend is Description = "RSS feed" // DefaultRefresh is how long a feed which is fetched is kept, and how // often it's polled, when it has no ttl, and the refresh_interval // option isn't set DefaultRefresh = 5 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func Open ¶
func Open(ctx context.Context, u *url.URL, cache store.CacheStore, opts gofiler.Opts) (gofiler.Filer, error)
Open creates the backend of the feed of the URL, rss://<name>/<host>/<path>, whose name is its name option, or its host, which is a registry.Backend. The feed is https://<host>/<path>, or http, with insecure=true, with the parameters of the URL's query which aren't the volume's options: name, refresh_interval, readonly, insecure and description. The feed is fetched, so one which can't be is an error, and is described of its title, unless it has a description option.
Types ¶
type Filer ¶
type Filer struct {
// contains filtered or unexported fields
}
Filer is the backend of an RSS feed
func New ¶
func New(ctx context.Context, name string, feed *url.URL, params url.Values, cache store.CacheStore, opts gofiler.Opts) (*Filer, error)
New creates the backend of a feed, of its URL, the volume's options, its refresh_interval, and its description, and its cache
func (*Filer) Clone ¶
Clone returns a new backend of the feed, with its options changed by the patch, which fetches it, as a new one does
func (*Filer) CreateObject ¶
func (self *Filer) CreateObject(context.Context, schema.CreateObjectRequest) (*schema.Object, error)
CreateObject isn't allowed, as a feed is read-only
func (*Filer) DeleteObjects ¶
func (self *Filer) DeleteObjects(context.Context, schema.DeleteObjectsRequest) (*schema.DeleteObjectsResponse, error)
DeleteObjects isn't allowed, as a feed is read-only
func (*Filer) Description ¶
Description returns what the feed is, such as "RSS feed The Example Podcast"
func (*Filer) GetObject ¶
func (self *Filer) GetObject(ctx context.Context, req schema.GetObjectRequest) (*schema.Object, error)
GetObject returns an item, or a folder of its days
func (*Filer) ListObjects ¶
func (self *Filer) ListObjects(ctx context.Context, req schema.ListObjectsRequest) (schema.ListObjectsIterator, error)
ListObjects lists the folders of the days of the items, and the items, of a folder, or every one beneath it, when it's recursive, or only an item, in the order of their paths, after the path it starts after
func (*Filer) ReadObject ¶
func (self *Filer) ReadObject(ctx context.Context, req schema.GetObjectRequest) (gofiler.ReadObjectFunc, *schema.Object, error)
ReadObject returns the HTML page of an item
func (*Filer) URL ¶
URL returns the URL of the feed's volume, rss://<name>/<host>/<path>, with its options, and the feed's own parameters
func (*Filer) WatchObjects ¶
WatchObjects polls the feed, at its interval, and sends the changes to its items, and their folders: a rescan of the root first, once it's watched, and then the paths which are created, updated, of their entity tags, or deleted, of each time it changed. A feed which isn't modified, of its entity tag, or when it was last modified, isn't fetched again.