min

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUpToDate

func IsUpToDate(srcPath string, variants image.Variant, outputDir string) bool

func ProcessImage

func ProcessImage(src ParsedAsset, outputDir string, quality int, log func(...any)) ([]string, error)

Types

type Config

type Config struct {
	RootDir   string
	OutputDir string
	Quality   int
}

type Handler

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

func New

func New(c *Config) *Handler

func (*Handler) LoadImages

func (h *Handler) LoadImages() error

LoadImages discovers modules via go list and processes their images.

func (*Handler) Logger

func (h *Handler) Logger(messages ...any)

func (*Handler) Name

func (h *Handler) Name() string

func (*Handler) ReloadModule

func (h *Handler) ReloadModule(moduleDir string) error

ReloadModule re-extracts and re-processes images for a single module.

func (*Handler) SetFinder added in v0.0.6

func (h *Handler) SetFinder(f *modfind.Finder)

func (*Handler) SetLog

func (h *Handler) SetLog(fn func(messages ...any))

func (*Handler) UnobservedFiles

func (h *Handler) UnobservedFiles() []string

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)

Jump to

Keyboard shortcuts

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