album

package
v0.0.0-...-5d0280c Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_ASPECT         = 0.2
	APP_CONFIG_FILENAME    = "appconfig.yaml"
	ALBUMS_CONFIG_FILENAME = "albumsconfig.yaml"
	CONFIG_FILENAME        = "config.yaml"
)

Variables

This section is empty.

Functions

func CanHtmlPlay

func CanHtmlPlay(filename string) bool

func ChangeExtension

func ChangeExtension(filename, ext string) string

func ConvertVideoFile

func ConvertVideoFile(inFilename, outFilename string) error

func GenerateVideoThumbnail

func GenerateVideoThumbnail(inFilename, size, outFilename string) error

func GetImageFiles

func GetImageFiles(files []os.DirEntry) []os.DirEntry

func IsFfmpegAvailable

func IsFfmpegAvailable() bool

func IsImageFile

func IsImageFile(filename string) bool

func IsVideoFile

func IsVideoFile(filename string) bool

func IsViewableFile

func IsViewableFile(filename string) bool

func Merge

func Merge(a, b *Config)

merges any non-default values in b into a

func VideoNeedsConversion

func VideoNeedsConversion(filename string) bool

Types

type Album

type Album struct {
}

func (Album) Footer

func (a Album) Footer() string

func (Album) ServeHTTP

func (a Album) ServeHTTP(w http.ResponseWriter, req *http.Request)

type AlbumConfig

type AlbumConfig struct {
	AlbumTitle string `yaml:"albumTitle"`
	AlbumDir   string `yaml:"albumDir"`
	ThumbDir   string `yaml:"thumbDir"`
	Config     Config `yaml:"config"`
}

func (AlbumConfig) String

func (a AlbumConfig) String() string

type AlbumTitle

type AlbumTitle struct {
	Key   string
	Title string
}

func (AlbumTitle) String

func (a AlbumTitle) String() string

type AlbumsConfig

type AlbumsConfig struct {
	BodyArgs string                 `yaml:"bodyArgs"`
	Default  Config                 `yaml:"default"`
	Albums   map[string]AlbumConfig `yaml:"albums"`
}

func LoadAlbumsConfigFile

func LoadAlbumsConfigFile(appConfig *AppConfig) (*AlbumsConfig, error)

func (AlbumsConfig) SortedAlbumTitles

func (a AlbumsConfig) SortedAlbumTitles() []AlbumTitle

func (AlbumsConfig) String

func (a AlbumsConfig) String() string

type AppConfig

type AppConfig struct {
	Port      int    `yaml:"port"`
	AlbumsDir string `yaml:"albumsDir"`
}

func LoadAppConfigFile

func LoadAppConfigFile() (*AppConfig, error)

func (AppConfig) String

func (a AppConfig) String() string

type CaptionFile

type CaptionFile struct {
	Html       string
	CaptionMap map[string]string
}

func NewCaptionFile

func NewCaptionFile(f io.Reader) *CaptionFile

type Config

type Config struct {
	BodyArgs            string `yaml:"bodyArgs"`
	VideoThumbnailSize  string `yaml:"videoThumbnailSize"`
	ThumbnailUse        string `yaml:"thumbnailUse"`
	ThumbnailWidth      int    `yaml:"thumbnailWidth"`
	ThumbnailAspect     string `yaml:"thumbnailAspect"`
	DefaultBrowserWidth int    `yaml:"defaultBrowserWidth"`
	SlideShowDelay      int    `yaml:"slideShowDelay"`
	NumberOfColumns     int    `yaml:"numberOfColumns"`
	OutsideTableBorder  int    `yaml:"outsideTableBorder"`
	InsideTableBorder   int    `yaml:"insideTableBorder"`
	EditMode            bool   `yaml:"editMode"`
	AllowFinalResize    bool   `yaml:"allowFinalResize"`
	ReverseDirs         bool   `yaml:"reverseDirs"`
	ReversePics         bool   `yaml:"reversePics"`
}

func (Config) GetDefaultBrowserWidth

func (c Config) GetDefaultBrowserWidth() int

func (Config) GetThumbnailAspect

func (c Config) GetThumbnailAspect() float64

func (Config) GetThumbnailUse

func (c Config) GetThumbnailUse() string

func (Config) GetThumbnailWidth

func (c Config) GetThumbnailWidth() int

func (Config) GetVideoThumbnailSize

func (c Config) GetVideoThumbnailSize() string

func (Config) String

func (c Config) String() string

type TemplateSource

type TemplateSource struct {
	AppConfig       *AppConfig
	AlbumsConfig    *AlbumsConfig
	AlbumConfig     AlbumConfig
	Current         Config
	Root            string
	BasePath        string
	PathInfo        string
	DirInfo         string
	NumberOfColumns int
	Files           []os.DirEntry
	Dirs            []os.DirEntry
	ImageCount      int
	FullTitle       string
	PageTitle       string
	ActualPath      string
	Mp4Path         string
	BaseFilename    string
	FileIndex       int
	PrevSeven       string
	NextSeven       string
	CaptionHtml     string
	CaptionMap      map[string]string
}

func (TemplateSource) AsPngFilename

func (t TemplateSource) AsPngFilename(filename string) string

func (TemplateSource) GetImageFiles

func (t TemplateSource) GetImageFiles() []os.DirEntry

func (TemplateSource) HandleDirs

func (t TemplateSource) HandleDirs(f os.DirEntry, subdir string, depth int) string

func (TemplateSource) IsImageFile

func (t TemplateSource) IsImageFile(filename string) bool

func (TemplateSource) MakePicTitle

func (t TemplateSource) MakePicTitle(s string) string

func (TemplateSource) NeedNewRow

func (t TemplateSource) NeedNewRow(index int) bool

func (TemplateSource) String

func (t TemplateSource) String() string

Jump to

Keyboard shortcuts

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