configload

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CustomLogLevel = map[string]slog.Level{
	"trace":  config.LevelTrace,
	"absurd": config.LevelAbsurd,
}

Functions

func CacheControlAutoEnabled

func CacheControlAutoEnabled(c config.CacheControlConfig) bool

func CacheControlEnabled

func CacheControlEnabled(c config.CacheControlConfig) bool

func DecodeEntityConfig

func DecodeEntityConfig(rawConfig map[string]interface{}, out any) error

Errors on unknown keys so a typo can't silently revert a security control. "id" stays since datastore declares it

func EffectiveShutdownTimeout

func EffectiveShutdownTimeout(c config.ServerConfig) uint

When unset, covers both the drain wait and a full-length request so the budget always fits its work

func LoadAndWatchConfigFromFile

func LoadAndWatchConfigFromFile(filename string, onReload func(config.Config, error)) (config.Config, error)

func LoadConfig

func LoadConfig(raw string) (config.Config, error)

func LoadConfigFromFile

func LoadConfigFromFile(filename string) (config.Config, error)

func LoadConfigFromRemote

func LoadConfigFromRemote(provider, endpoint, path, format string) (config.Config, error)

func MergeCacheControlDefaults

func MergeCacheControlDefaults(c *config.CacheControlConfig, other config.CacheControlConfig)

func MergeClientDefaults

func MergeClientDefaults(c *config.ClientConfig, o config.ClientConfig)

func ReplaceConfigValues

func ReplaceConfigValues(rawConfig map[string]interface{}, keyTag string, replacer func(string) (string, error)) (map[string]interface{}, error)

Replaces any string value starting with `keyTag.keyName` with replacer(keyName), so secrets stay out of source-controlled config

func ReplaceEnv

func ReplaceEnv(rawConfig map[string]interface{}) map[string]interface{}

Replaces any string value starting with `env.` with that environment variable, so secrets stay out of source-controlled config

func Validate

func Validate(c config.Config) error

Covers fields entity construction doesn't touch, so `config check` can't report "Valid" for a config that breaks when served

Types

type ConfigWithID

type ConfigWithID struct {
	ID     string
	Config map[string]interface{}
}

func NormalizeCaches

func NormalizeCaches(raw interface{}, errorMessages config.ErrorMessages) ([]ConfigWithID, error)

Normalizes the top-level cache config into a list with IDs

Jump to

Keyboard shortcuts

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