catalog

package
v0.0.0-...-60192f8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package catalog provides type to create an OPDS catalog of entries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithBookEntry

func WithBookEntry(
	id uuid.UUID, title string, href string,
	issued, published, updated time.Time,
	publisher string, language string, description string,
) func(*opds.Feed)

WithBookEntry adds a new book entry to the feed.

func WithFeedType

func WithFeedType(t string) func(*opds.Feed)

WithFeedType sets the feed type.

func WithLink(t, rel, href string) func(*opds.Feed)

WithLink adds a link entry to the feed.

func WithNavEntry

func WithNavEntry(title string, updated time.Time, href string, options ...func(*opds.Entry)) func(*opds.Feed)

WithNavEntry adds a new navigation entry to the feed.

func WithTitle

func WithTitle(title string) func(*opds.Feed)

WithTitle sets the feed's title.

func WithURL

func WithURL(href string) func(*opds.Feed)

WithURL sets the "self" feed link entry.

func WithUpdated

func WithUpdated(t time.Time) func(*opds.Feed)

WithUpdated sets the feed last update value.

Types

type Catalog

type Catalog struct {
	*opds.Feed
}

Catalog is a wraper around opds.Feed.

func New

func New(srv *server.Server, r *http.Request, options ...func(*opds.Feed)) *Catalog

New creates a new catalog with some prepared information.

func (*Catalog) Render

func (c *Catalog) Render(w http.ResponseWriter, r *http.Request) error

Render write the full catalog to a writer.

Jump to

Keyboard shortcuts

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