handler

package
v0.0.0-...-88bf645 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBrowseTagURL

func CreateBrowseTagURL(tag string) string

func CreateBrowseURL

func CreateBrowseURL(id string) string

func CreateBrowseURLPattern

func CreateBrowseURLPattern() string

func CreateDownloadURL

func CreateDownloadURL(filepath string) string

func CreateDownloadURLPattern

func CreateDownloadURLPattern() string

func CreateFilePathURL

func CreateFilePathURL(p string) string

func CreateGetImageURL

func CreateGetImageURL(filepath string, index int) string

func CreateGetImageURLPattern

func CreateGetImageURLPattern() string

func CreateGetImageWithSizeURL

func CreateGetImageWithSizeURL(filepath string, index int, width int, height int) string

func CreateMetaProvider

func CreateMetaProvider() (provider meta.Provider, err error)

func CreateRescanURL

func CreateRescanURL() string

func CreateRescanURLPattern

func CreateRescanURLPattern() string

func CreateRootURL

func CreateRootURL() string

func CreateSetFavoriteURL

func CreateSetFavoriteURL(filepath string) string

func CreateSetFavoriteURLPattern

func CreateSetFavoriteURLPattern() string

func CreateSetTagFavoriteURL

func CreateSetTagFavoriteURL(filepath string) string

func CreateSetTagFavoriteURLPattern

func CreateSetTagFavoriteURLPattern() string

func CreateTagListURL

func CreateTagListURL() string

func CreateTagListURLPattern

func CreateTagListURLPattern() string

func CreateTagProvider

func CreateTagProvider() (provider tag.Provider, err error)

func CreateTagThumbnailURL

func CreateTagThumbnailURL(filepath string) string

func CreateTagThumbnailURLPattern

func CreateTagThumbnailURLPattern() string

func CreateThumbnailURL

func CreateThumbnailURL(filepath string) string

func CreateThumbnailURLPattern

func CreateThumbnailURLPattern() string

func CreateURL

func CreateURL(p ...string) string

func CreateUpdateCoverURL

func CreateUpdateCoverURL(filepath string, index int) string

func CreateUpdateCoverURLPattern

func CreateUpdateCoverURLPattern() string

func CreateVersionString

func CreateVersionString() string

func CreateViewURL

func CreateViewURL(filepath string) string

func CreateViewURLPattern

func CreateViewURLPattern() string

func GetImage

func GetImage(w http.ResponseWriter, r *http.Request, params httprouter.Params)

GetImage returns an image with specific width/height while retains aspect ratio.

func HtmlTemplateFuncMap

func HtmlTemplateFuncMap() template.FuncMap

func Init

func Init(o Options)

func OpenZipEntry

func OpenZipEntry(m meta.Meta, index int) (content []byte, filename string, err error)

func ParseParam

func ParseParam(params httprouter.Params, key string) string

func RescanLibraryHandler

func RescanLibraryHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params)

func WriteError

func WriteError(w http.ResponseWriter, err error)

func WriteHtml

func WriteHtml(w http.ResponseWriter, content string)

func WriteJson

func WriteJson(w http.ResponseWriter, v any)

Types

type ErrorResponse

type ErrorResponse struct {
	Title   string
	Code    uint
	Message string
}

type Options

type Options struct {
	MetaProviderFactory meta.ProviderFactory
	TagProviderFactory  tag.ProviderFactory
	VersionString       string

	PathPrefix        string
	PathRoot          string
	PathBrowse        string
	PathView          string
	PathStatic        string
	PathGetImage      string
	PathUpdateCover   string
	PathThumbnail     string
	PathFavorite      string
	PathDownload      string
	PathRescanLibrary string
	PathTagFavorite   string
	PathTagList       string
	PathTagThumbnail  string
}

type RescanLibraryResponse

type RescanLibraryResponse struct {
	Result bool `json:"result"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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