opds

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Feed link types
	FeedAcquisitionLinkType = "application/atom+xml;profile=opds-catalog;kind=acquisition"
	FeedNavigationLinkType  = "application/atom+xml;profile=opds-catalog;kind=navigation"
	FeedSearchLinkType      = "application/opensearchdescription+xml"
	// Feed link relations
	FeedStartLinkRel      = "start"
	FeedSelfLinkRel       = "self"
	FeedSearchLinkRel     = "search"
	FeedFirstLinkRel      = "first"
	FeedLastLinkRel       = "last"
	FeedNextLinkRel       = "next"
	FeedPrevLinkRel       = "prev"
	FeedSubsectionLinkRel = "subsection"

	// Content types
	FeedTextContentType = "text"
	FeedHtmlContentType = "html"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	// XMLName xml.Name `xml:"author"`
	Name string `xml:"name,omitempty"`
	Uri  string `xml:"uri,omitempty"`
}

type Content

type Content struct {
	// XMLName xml.Name `xml:"content"`
	Content string `xml:",chardata"`
	Type    string `xml:"type,attr"`
}

type Entry

type Entry struct {
	// XMLName   xml.Name `xml:"entry"`
	// Xmlns     string   `xml:"xmlns,attr,omitempty"`
	Title     string   `xml:"title"`
	ID        string   `xml:"id"`
	Link      []Link   `xml:"link"`
	Published string   `xml:"published,omitempty"`
	Updated   TimeStr  `xml:"updated"`
	Category  string   `xml:"category,omitempty"`
	Authors   []Author `xml:"author"`
	Summary   *Summary `xml:"summary"`
	Content   *Content `xml:"content"`
	Rights    string   `xml:"rights,omitempty"`
	Source    string   `xml:"source,omitempty"`
}

type Feed

type Feed struct {
	XMLName      xml.Name `xml:"feed"`
	Xmlns        string   `xml:"xmlns,attr"`
	XmlnsDC      string   `xml:"xmlns:dcterms,attr,omitempty"`
	XmlnsOS      string   `xml:"xmlns:opensearch,attr,omitempty"`
	XmlnsOPDS    string   `xml:"xmlns:opds,attr,omitempty"`
	Title        string   `xml:"title"`
	ID           string   `xml:"id"`
	Updated      TimeStr  `xml:"updated"`
	Link         []Link   `xml:"link"`
	Author       []Author `xml:"author,omitempty"`
	Entry        []*Entry `xml:"entry"`
	Category     string   `xml:"category,omitempty"`
	Icon         string   `xml:"icon,omitempty"`
	Content      string   `xml:"content,omitempty"`
	Subtitle     string   `xml:"subtitle,omitempty"`
	SearchResult uint     `xml:"opensearch:totalResults,omitempty"`
}

func NewFeed

func NewFeed(title, subtitle, self string) *Feed

func (*Feed) Time

func (f *Feed) Time(t time.Time) TimeStr

type Handler

type Handler struct {
	CFG *config.Config
	LOG *rlog.Log
	DB  *database.DB
	GT  *genres.GenresTree
	P   *message.Printer
}

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Link struct {
	// XMLName xml.Name `xml:"link"`
	Type   string `xml:"type,attr,omitempty"`
	Title  string `xml:"title,attr,omitempty"`
	Href   string `xml:"href,attr"`
	Rel    string `xml:"rel,attr,omitempty"`
	Length string `xml:"length,attr,omitempty"`
}

type Summary

type Summary struct {
	// XMLName xml.Name `xml:"summary"`
	Content string `xml:",chardata"`
	Type    string `xml:"type,attr"`
}

type TimeStr

type TimeStr string

Jump to

Keyboard shortcuts

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