config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Enabled bool        `koanf:"enabled"`
	Users   []UserCreds `koanf:"users"`
}

AuthConfig holds authentication configuration

type CacheConfig

type CacheConfig struct {
	TTL             time.Duration `koanf:"ttl"`
	CleanupInterval time.Duration `koanf:"cleanup_interval"`
}

CacheConfig holds cache-specific configuration

type Config

type Config struct {
	Http    HttpConfig    `koanf:"http"`
	Storage StorageConfig `koanf:"storage"`
	Auth    AuthConfig    `koanf:"auth"`
	Cache   CacheConfig   `koanf:"cache"`
}

Config holds the configuration for the docker cache server

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a configuration with default values

func Load

func Load(configFile string, flags *pflag.FlagSet) (*Config, error)

Load loads configuration from various sources in order of precedence: 1. Command line flags (highest priority) 2. Environment variables 3. Config file 4. Default values (lowest priority)

type HttpConfig

type HttpConfig struct {
	Addr   string `koanf:"addr"`
	Prefix string `koanf:"prefix"`
	// Host e.g. "http://myregistryaddress.org:5000
	Host         string          `koanf:"host"`
	Relativeurls bool            `koanf:"relativeurls"`
	Debug        HttpDebugConfig `koanf:"debug"`
}

HttpConfig holds server-specific configuration

type HttpDebugConfig

type HttpDebugConfig struct {
	Addr       string           `koanf:"addr"`
	Prometheus PrometheusConfig `koanf:"prometheus"`
}

type PrometheusConfig

type PrometheusConfig struct {
	Enabled bool   `koanf:"enabled"`
	Path    string `yaml:"path,omitempty"`
}

type StorageConfig

type StorageConfig struct {
	Directory string `koanf:"directory"`
}

StorageConfig holds storage-specific configuration

type UserCreds

type UserCreds struct {
	Username string `koanf:"username"`
	Password string `koanf:"password"`
}

UserCreds holds username and password for a user

Jump to

Keyboard shortcuts

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