content

package
v0.0.0-...-dcf7d21 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: GPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ContentRoot string // The root directory of our content hierarchy
}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(c *Config) Handler

func (*Handler) Image

func (h *Handler) Image(path string, width, height, rot int) (image.Image, error, int)

func (*Handler) List

func (h *Handler) List(dirApiPath string) (*ListResult, error, int)

func (*Handler) ListFromIndex

func (h *Handler) ListFromIndex(indexApiPath string) (*ListResult, error, int)

ListFromIndex creates a list of files as given in the specified index file.

func (*Handler) PutText

func (h *Handler) PutText(path string, command UpdateTextCommand) (error, int)

func (*Handler) Text

func (h *Handler) Text(path string) ([]byte, error, int)

func (*Handler) UpdateImageIndex

func (h *Handler) UpdateImageIndex(apiPath string, command UpdateCommand) (error, int)

func (*Handler) VideoFilePath

func (h *Handler) VideoFilePath(path string) (string, error)

VideoFilePath returns the path on disk to the specified video file. If the extension is not one of our video extensions, returns the empty string.

type ImageIndex

type ImageIndex struct {
	// contains filtered or unexported fields
}

type ListItem

type ListItem struct {
	Name         string
	Path         string // Full API path if the item is not in the parent dir
	IndexPath    string // Full API path to the index file, if not the default index
	IndexEntry   string // The path to the file relative to the index, if not in the default index
	IsDir        bool
	Size         int64
	Type         string
	ExifDateTime time.Time
	ModTime      int64  // seconds since the epoch
	ModTimeStr   string // ModTime converted to a string by the server
	Text         string
	TextError    string // The error if we get one trying to read the text file
}

type ListResult

type ListResult struct {
	IndexName           string
	UnfilteredFileCount int
	Items               []ListItem
}

type UpdateCommand

type UpdateCommand struct {
	Item       string
	Action     string
	Value      string
	Autocreate bool
}

type UpdateTextCommand

type UpdateTextCommand struct {
	Content string
}

Jump to

Keyboard shortcuts

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