feed

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package feed generates Atom and JSON Feed documents from change_events.

Both formats follow established standards:

The functions are pure: they take a slice of events plus metadata and return bytes. They do not hit the store. They do not hit the network. This makes them trivially testable and usable from both the API handlers and the notifier worker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Atom

func Atom(meta Meta, entries []Entry) ([]byte, error)

Atom renders the feed as Atom 1.0.

func JSONFeed

func JSONFeed(meta Meta, entries []Entry) ([]byte, error)

JSONFeed renders the feed as JSON Feed 1.1.

Types

type Entry

type Entry struct {
	ID         string
	Title      string
	Summary    string
	Link       string
	Published  time.Time
	Updated    time.Time
	Categories []string
}

Entry is the common projection of a change_event for feed rendering.

func FromChangeEvents

func FromChangeEvents(meta Meta, events []store.ChangeEvent) []Entry

FromChangeEvents builds feed entries from a slice of change_events.

type Meta

type Meta struct {
	Title       string
	Subtitle    string
	ID          string // stable URI (e.g. "https://fepublica.gmowses.cloud/api/feeds/all.atom")
	BaseURL     string
	AuthorName  string
	AuthorEmail string
}

Meta describes the feed channel itself.

Jump to

Keyboard shortcuts

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