config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(c Config) error

Validate returns an error if the configuration is inconsistent.

Types

type AdaptiveConfig

type AdaptiveConfig struct {
	Enabled         bool
	TargetSizeBytes int64 // desired maximum output size
	MinQuality      int   // floor to prevent over-compression; default 30
	MaxQuality      int   // ceiling; default 95
	StepSize        int   // quality decrement per iteration; default 5
}

AdaptiveConfig controls the adaptive compression algorithm.

type Config

type Config struct {
	// Worker pool controls.
	WorkerCount int // default: runtime.NumCPU()
	QueueSize   int // max queued jobs before backpressure; default: 256
	JobTimeout  time.Duration

	// Retry.
	MaxRetries int
	RetryDelay time.Duration

	// Default encode options applied when a pipeline step does not override.
	DefaultQuality int // 1-100; default 85
	DefaultFormat  string

	// Streaming / memory limits.
	MaxImageBytes int64 // 0 = no limit
	ChunkSize     int   // streaming chunk size in bytes; default 32 KiB

	// Storage.
	Storage StorageBackend
	Local   LocalConfig
	S3      S3Config

	// Adaptive compression.
	AdaptiveCompression AdaptiveConfig

	// Logging / metrics.
	LogLevel string // "debug", "info", "warn", "error"
}

Config is the top-level configuration struct. All fields have safe defaults so callers can start with Config{} and override only what they need.

func Default

func Default() Config

Default returns a Config populated with sensible production defaults.

type LocalConfig

type LocalConfig struct {
	RootDir     string
	Permissions uint32 // default 0644
}

LocalConfig configures the local filesystem storage adapter.

type S3Config

type S3Config struct {
	Bucket          string
	Region          string
	Endpoint        string // optional custom endpoint (MinIO, etc.)
	AccessKeyID     string
	SecretAccessKey string
	UsePathStyle    bool
}

S3Config configures the AWS S3 storage adapter.

type StorageBackend

type StorageBackend string

StorageBackend selects the storage adapter.

const (
	StorageLocal StorageBackend = "local"
	StorageS3    StorageBackend = "s3"
)

Jump to

Keyboard shortcuts

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