rss

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 26 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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) Actions

func (self *Filer) Actions() []gofiler.Action

Actions returns nil, as a feed is read-only

func (*Filer) Clone

func (self *Filer) Clone(ctx context.Context, patch url.Values) (gofiler.Filer, error)

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

DeleteObjects isn't allowed, as a feed is read-only

func (*Filer) Description

func (self *Filer) Description() string

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

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

ReadObject returns the HTML page of an item

func (*Filer) URL

func (self *Filer) URL() *url.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

func (self *Filer) WatchObjects(ctx context.Context, ch chan<- schema.Event) error

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.

Jump to

Keyboard shortcuts

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