feed

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2026 License: Apache-2.0, MIT Imports: 6 Imported by: ? modules, 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 feed renders RSS 2.0, Atom 1.0 and JSON Feed 1.1 documents and serves them as http handlers. Output is deterministic: no clock is read.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Atom

func Atom(fn Builder) http.HandlerFunc

Atom serves fn as Atom 1.0.

func JSON

func JSON(fn Builder) http.HandlerFunc

JSON serves fn as JSON Feed 1.1.

func RSS

func RSS(fn Builder) http.HandlerFunc

RSS serves fn as RSS 2.0.

func RenderAtom

func RenderAtom(f Feed) ([]byte, error)

RenderAtom renders f as Atom 1.0.

func RenderJSON

func RenderJSON(f Feed) ([]byte, error)

RenderJSON renders f as JSON Feed 1.1.

func RenderRSS

func RenderRSS(f Feed) ([]byte, error)

RenderRSS renders f as RSS 2.0.

Types

type Author

type Author struct {
	Name  string
	Email string
	URL   string
}

Author is a person credited on a feed or an item.

type Builder

type Builder func(ctx context.Context) (Feed, error)

Builder produces the feed for one request.

type Feed

type Feed struct {
	Title       string
	Description string
	SiteURL     string
	FeedURL     string
	Language    string
	Copyright   string
	Author      Author
	Updated     time.Time
	Items       []Item
}

Feed is the channel-level data plus its items.

type Item

type Item struct {
	ID          string
	Title       string
	URL         string
	Summary     string
	ContentHTML string
	Author      Author
	Published   time.Time
	Updated     time.Time
	Tags        []string
}

Item is one entry of a feed.

Jump to

Keyboard shortcuts

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