Documentation
¶
Index ¶
- func IsUpToDate(srcPath string, variants image.Variant, outputDir string) bool
- func ProcessImage(src ParsedAsset, outputDir string, quality int, log func(...any)) ([]string, error)
- type Config
- type Handler
- func (h *Handler) InitDefaultLoader()
- func (h *Handler) LoadImages() error
- func (h *Handler) Logger(messages ...any)
- func (h *Handler) Name() string
- func (h *Handler) ReloadModule(moduleDir string) error
- func (h *Handler) SetListModulesFn(fn func(rootDir string) ([]string, error))
- func (h *Handler) SetLog(fn func(messages ...any))
- func (h *Handler) UnobservedFiles() []string
- type ParsedAsset
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProcessImage ¶
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) InitDefaultLoader ¶
func (h *Handler) InitDefaultLoader()
func (*Handler) LoadImages ¶
LoadImages discovers modules via go list and processes their images.
func (*Handler) ReloadModule ¶
ReloadModule re-extracts and re-processes images for a single module.
func (*Handler) SetListModulesFn ¶
func (*Handler) UnobservedFiles ¶
type ParsedAsset ¶
type ParsedAsset struct {
AbsPath string // absolute path: moduleDir + "/" + asset.Path
Variants image.Variant // resolved bitmask value
Alt string
BaseName string // base name without extension: "logo", "hero"
}
func ExtractImages ¶
func ExtractImages(moduleDir string) ([]ParsedAsset, error)
Click to show internal directories.
Click to hide internal directories.