river

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

Documentation

Overview

Package river aggregates feeds into a riverjs file.

See http://riverjs.org for more information on the format.

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = Options{
	Mapping:   mapping.DefaultMapping,
	CutOff:    -24 * time.Hour,
	Refresh:   15 * time.Minute,
	LogLength: 0,
}

DefaultOptions are some sensible options to start out with.

Functions

func List

func List(feeds River, templates *template.Template) http.Handler

func Log

func Log(feeds River, templates *template.Template) http.Handler

Types

type Options

type Options struct {
	// Mapping is the function used to convert a feed item to an item in the
	// river.
	Mapping mapping.Mapping

	// CutOff is the duration after which items are not shown in the river. This
	// is given as a negative time and is calculated from the time the feed was
	// fetched not the time the item was published.
	CutOff time.Duration

	// Refresh is the minimum refresh period. If an rss feed does not specify
	// when to be fetched this duration will be used.
	Refresh time.Duration

	// LogLength defines the number of events to keep in the crawl log, per feed.
	LogLength int
}

Options change the behaviour of River.

type River

type River interface {
	Latest() (riverjs.River, error)

	// Log returns a list of fetch events.
	Log() []events.Event

	// Add subscribes the river to the feed at uri.
	Add(uri string)

	// Remove unsubscribes the river from the feed at url.
	Remove(uri string)

	// Close gracefully stops feeds from being checked.
	Close() error
}

A River aggregates feeds that it is subscribed to, and writes them in riverjs format.

func New

func New(store data.Database, options Options) River

New creates an empty river.

Directories

Path Synopsis
Package confluence manages a list of subscribed feeds.
Package confluence manages a list of subscribed feeds.
Package data provides the ability to rebuild previous feeds and remove duplicate items.
Package data provides the ability to rebuild previous feeds and remove duplicate items.
boltdata
Package boltdata implements data over a bolt database.
Package boltdata implements data over a bolt database.
memdata
Package memdata implements data over a set of in memory maps.
Package memdata implements data over a set of in memory maps.
Package events keeps track of the results of fetching feeds.
Package events keeps track of the results of fetching feeds.
Package mapping converts a feed item into a riverjs item.
Package mapping converts a feed item into a riverjs item.
Package riverjs contains structs that map to the parts of a riverjs feed.
Package riverjs contains structs that map to the parts of a riverjs feed.
Package tributary fetches a single feed.
Package tributary fetches a single feed.

Jump to

Keyboard shortcuts

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