Versions in this module Expand all Collapse all v1 v1.0.0 Jul 5, 2026 Changes in this version + func DetectLocale(r *http.Request, supported []string, defaultLocale string) string + func GenerateOrLoadThumb(src, cacheDir string, cfg ThumbConfig) ([]byte, error) + func GenerateOrLoadVideoThumb(src, cacheDir, ffmpegPath string, cfg ThumbConfig) ([]byte, error) + func RenderPage(title, pathPrefix, thumbPrefix, relPath, tmplName string, ...) (string, error) + func ThumbPath(src, cacheDir string) string + type BreadcrumbSegment struct + Href string + Name string + type ExifData struct + Aperture string + CameraMake string + CameraModel string + DateTaken string + ExposureTime string + FocalLength string + ISO string + LensModel string + func (e *ExifData) HasAny() bool + type FileInfo struct + CountDirs int + CountItems int + Exif *ExifData + Height int + Kind FileKind + ModTime int64 + Name string + Size int64 + VideoMeta *VideoMeta + Width int + type FileKind string + const KindDir + const KindImage + const KindOther + const KindVideo + func Classify(name string, imageExts, videoExts map[string]bool) FileKind + type FileView struct + CardHTML template.HTML + CountDirs int + CountItems int + Date string + Dimensions string + DisplayName string + Exif *ExifData + ExifAttrs template.HTMLAttr + Height int + Href string + IsDir bool + IsImage bool + IsOther bool + IsUp bool + IsVideo bool + ModTime int64 + Name string + ParentDir string + Size string + SizePct int + ThumbURL string + Type string + VideoMeta *VideoMeta + VideoMetaAttrs template.HTMLAttr + Width int + type FilterGroup struct + Label string + Options []FilterOption + Selected int + Total int + type FilterOption struct + Count int + DisplayExt string + Ext string + IsNone bool + Selected bool + type Gallery struct + Cache *ScanCache + CacheScanMinutes int + CacheStatsTracker *cacheStatsTracker + DefaultLanguage string + ImageExts []string + MaxCacheSizeMB int + MaxCacheSizeSet bool + NoExif bool + NoExifSet bool + NoMeta bool + NoMetaSet bool + NoThumbs bool + NoThumbsSet bool + NoVideoThumbs bool + PageSize int + PageSizes []string + PathPrefix string + Root string + RootName string + SearchMatch string + Sort string + Template string + ThumbFormat string + ThumbHeight int + ThumbTTLMinutes int + ThumbWidth int + VideoExts []string + func (*Gallery) Validate() error + func (g *Gallery) CaddyModule() caddy.ModuleInfo + func (g *Gallery) Cleanup() error + func (g *Gallery) Provision(caddy.Context) error + func (g *Gallery) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error + func (g *Gallery) UnmarshalCaddyfile(d *caddyfile.Dispenser) error + type PageData struct + AvailableLocales []string + Breadcrumb []BreadcrumbSegment + CacheStatsAA string + CacheStatsXX string + CacheStatsYY string + CacheStatsZZ string + DirectoryTotal int + FilterImageOptions FilterGroup + FilterOtherOptions FilterGroup + FilterVideoOptions FilterGroup + FilteredTotal int + HasNext bool + HasPrev bool + ImageCount int + ImageEnd int + ImageStart int + Images []FileView + IsServerSearchActive bool + IsTypeFilterActive bool + Locale string + OnPageMatchedCount int + OnPageTotalCount int + OtherFiles []FileView + Page int + PageNumbers []int + PageSize int + PageSizes []string + PathPrefix string + Query url.Values + SearchMatch string + SearchQuery string + Sort SortSpec + Subdirs []FileView + ThumbPrefix string + Title string + TotalAllFilesSize string + TotalFiles int + TotalImages int + TotalPages int + TotalVideos int + Translator *Translator + TypeFilter map[string]bool + TypeFilterQuery string + Up *FileView + type ScanCache struct + func NewScanCache(ttl time.Duration) *ScanCache + func (c *ScanCache) Get(dir, sortMode string, imageExts, videoExts map[string]bool, ...) ([]FileInfo, error) + func (c *ScanCache) SetFiles(dir string, files []FileInfo) + type Scanner struct + ImageExts map[string]bool + NoExif bool + NoMeta bool + Root string + Sort string + ThumbCacheDir string + ThumbFormat string + VideoExts map[string]bool + func NewScanner(root string) *Scanner + func (s *Scanner) Enrich(files []FileInfo) + func (s *Scanner) EnrichInBackground(files []FileInfo, cache *ScanCache, dir string) + func (s *Scanner) Scan() ([]FileInfo, error) + type SortSpec struct + Field string + Order string + type ThumbConfig struct + CacheStatsTracker *cacheStatsTracker + Format string + Height int + MaxCacheSizeMB int + Width int + type Translator struct + func NewTranslator(diskDir string) (*Translator, error) + func (t *Translator) HasLocale(locale string) bool + func (t *Translator) Locales() []string + func (t *Translator) NativeName(locale string) string + func (t *Translator) SelfName(locale string) string + func (t *Translator) T(locale, key string, args ...any) string + type VideoMeta struct + AudioCodec string + Bitrate string + Container string + Duration string + Framerate string + VideoCodec string + func (v *VideoMeta) HasAny() bool