service

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FeedNamespace      = "http://www.w3.org/2005/Atom"
	NavigationLinkKind = "application/atom+xml;profile=opds-catalog;kind=navigation"
	CatalogLinkKind    = "application/atom+xml;profile=opds-catalog"
	EpubLinkType       = "application/epub+zip"
)
View Source
const (
	RoleAdmin        = pauth.RoleAdministrator
	RoleBookUploader = "book-uploader"
	RoleBookUpdater  = "book-updater"
	RoleShelfAdmin   = "shelf-admin"
	RoleViewOnly     = "view-only"
)

Variables

View Source
var (
	ErrEndpointDisabledError = errors.New("endpoint disabled")
)

Functions

func ContextLoggerMiddleware

func ContextLoggerMiddleware(rootLogger logr.Logger) func(http.Handler) http.Handler

func MethodLoggingMiddleware

func MethodLoggingMiddleware(next http.Handler) http.Handler

func RouteDownloadPattern

func RouteDownloadPattern() string

func RouteFilterPattern

func RouteFilterPattern() string

func RouteRoot

func RouteRoot() string

func RouteSingleSeriesPattern

func RouteSingleSeriesPattern() string

Types

type Feed

type Feed struct {
	XMLName xml.Name    `xml:"feed"`
	NS      string      `xml:"ns,attr"`
	ID      string      `xml:"id"`
	Updated time.Time   `xml:"updated"`
	Links   []FeedLink  `xml:"link"`
	Entries []FeedEntry `xml:"entry"`
}

type FeedAuthor

type FeedAuthor struct {
	Name string `xml:"name"`
}

type FeedEntry

type FeedEntry struct {
	XMLName xml.Name    `xml:"entry"`
	ID      string      `xml:"id,omitempty"`
	Title   string      `xml:"title"`
	Links   []FeedLink  `xml:"link"`
	Author  *FeedAuthor `xml:"author,omitempty"`
}
type FeedLink struct {
	XMLName xml.Name `xml:"link"`
	Rel     string   `xml:"rel,attr,omitempty"`
	Href    string   `xml:"href,attr"`
	Type    string   `xml:"type,attr"`
	Title   string   `xml:"title,attr,omitempty"`
}

type Service

type Service struct {
	pbv1connect.UnimplementedBlankPageServiceHandler
	// contains filtered or unexported fields
}

func NewService

func NewService(conf ServiceConfig) *Service

func (*Service) OPDSDownload

func (s *Service) OPDSDownload(w http.ResponseWriter, req *http.Request)

func (*Service) OPDSFilter

func (s *Service) OPDSFilter(w http.ResponseWriter, req *http.Request)

func (*Service) OPDSRoot

func (s *Service) OPDSRoot(w http.ResponseWriter, req *http.Request)

func (*Service) OPDSSingleSeries

func (s *Service) OPDSSingleSeries(w http.ResponseWriter, req *http.Request)

func (*Service) Purge

type ServiceConfig

type ServiceConfig struct {
	Storer storage.Storer
	// PurgeEnabled enables the purge endpoint. This endpoint should never be enabled on a non-testing deployment
	PurgeEnabled   bool
	DefaultPerPage uint32
	NowFunc        func() time.Time
}

Jump to

Keyboard shortcuts

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