Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGalleryAPI ¶
NewGalleryAPI returns a new http.Handler instance that implements gallery related endpoints.
Types ¶
type Album ¶
type Album struct { Name string `json:"name"` ModTime time.Time `json:"updated_at"` ItemsCount int `json:"items_count"` }
Album stores album metadata.
type Cache ¶
type Cache interface { // Returns thumbnail and modtime for a given image path if it exists, otherwise returns nil. Thumbnail(gallery, image string) (io.ReadSeeker, time.Time) // Stores thumbnail for a given image path and returns reader for a stored thumbnail. StoreThumbnail(gallery, image string, r io.Reader) (io.ReadSeeker, error) }
Cache caches gallery metadata.
func NewDiskCache ¶
NewDiskCache returns a new Cache instance that uses filesystem. dir will be created if necessary.
type Image ¶
type Image struct { Name string `json:"name"` Path string `json:"path"` ModTime time.Time `json:"updated_at"` }
Image stores image metadata.
type Source ¶
type Source interface { // Albums returns list of all albums in a Source. Albums() ([]Album, error) // Images returns images metadata for a given album. Images(album string) ([]Image, error) // Image returns image file for a given image path. Image(ablum, image string) (*os.File, error) }
Source provides album and images metadata.
Click to show internal directories.
Click to hide internal directories.