Documentation
¶
Overview ¶
Package confii is a complete configuration management library for Go. It loads, merges, validates, and manages configuration from YAML, JSON, TOML, INI, .env files, environment variables, HTTP endpoints, and cloud stores (AWS S3, SSM, Azure Blob, GCS, IBM COS, Git repositories) — with deep merging, secret resolution, source tracking, and type-safe generics.
confii goes beyond configuration loading — it manages the full lifecycle: loading, merging with 6 per-path strategies, validating with struct tags and JSON Schema, resolving ${secret:key} placeholders from AWS Secrets Manager / Azure Key Vault / GCP Secret Manager / HashiCorp Vault (9 auth methods), tracking where every value came from, detecting config drift, versioning with rollback, and emitting observability metrics — all with zero global state and full thread safety via sync.RWMutex.
Key features:
- Type-safe generics: Config[T] with cfg.Typed() returning *T
- 6 merge strategies (replace, merge, append, prepend, intersection, union) with per-path overrides
- ${secret:key} placeholder resolution with caching, TTL, and multi-store fallback
- Hydra-style config composition via _include and _defaults directives
- Environment resolution: automatic default + production/staging merging
- 4-type hook system (key, value, condition, global) for value transformation
- Full introspection: Explain(), Layers(), source tracking, override history
- Config diff, drift detection, versioning with rollback
- File watching with incremental reload (mtime + SHA256)
- Documentation generation (markdown, JSON)
- 10-command CLI tool
- Self-configuration via .confii.yaml auto-discovery
Quick start:
cfg, err := confii.New[any](context.Background(),
confii.WithLoaders(
loader.NewYAML("config.yaml"),
loader.NewEnvironment("APP"),
),
confii.WithEnv("production"),
)
if err != nil {
log.Fatal(err)
}
host, _ := cfg.Get("database.host")
port := cfg.GetIntOr("database.port", 5432)
Type-safe access with generics:
cfg, err := confii.New[AppConfig](ctx,
confii.WithLoaders(loader.NewYAML("config.yaml")),
confii.WithValidateOnLoad(true),
)
model, _ := cfg.Typed()
fmt.Println(model.Database.Host) // IDE autocomplete works
Builder pattern:
cfg, err := confii.NewBuilder[AppConfig]().
WithEnv("production").
AddLoader(loader.NewYAML("base.yaml")).
AddLoader(loader.NewYAML("prod.yaml")).
EnableFreezeOnLoad().
Build(ctx)
Secret resolution:
store := secret.NewDictStore(map[string]any{"db/password": "s3cret"})
resolver := secret.NewResolver(store, secret.WithCache(true))
cfg.HookProcessor().RegisterGlobalHook(resolver.Hook())
// ${secret:db/password} in config values resolves automatically
Cloud providers are opt-in via build tags: aws, azure, gcp, vault, ibm.
For full documentation, examples, and the CLI tool, see https://github.com/confiify/confii-go
Index ¶
- Constants
- Variables
- func NewFormatError(source, formatType string, err error) error
- func NewFrozenError(op string) error
- func NewLoadError(source string, err error) error
- func NewNotFoundError(key string, availableKeys []string) error
- func NewValidationError(errs []string, original error) error
- type Builder
- func (b *Builder[T]) AddLoader(l Loader) *Builder[T]
- func (b *Builder[T]) AddLoaders(loaders ...Loader) *Builder[T]
- func (b *Builder[T]) Build(ctx context.Context) (*Config[T], error)
- func (b *Builder[T]) DisableDeepMerge() *Builder[T]
- func (b *Builder[T]) DisableDynamicReloading() *Builder[T]
- func (b *Builder[T]) DisableEnvExpander() *Builder[T]
- func (b *Builder[T]) DisableTypeCasting() *Builder[T]
- func (b *Builder[T]) EnableDebug() *Builder[T]
- func (b *Builder[T]) EnableDeepMerge() *Builder[T]
- func (b *Builder[T]) EnableDynamicReloading() *Builder[T]
- func (b *Builder[T]) EnableEnvExpander() *Builder[T]
- func (b *Builder[T]) EnableFreezeOnLoad() *Builder[T]
- func (b *Builder[T]) EnableTypeCasting() *Builder[T]
- func (b *Builder[T]) WithEnv(env string) *Builder[T]
- func (b *Builder[T]) WithSchemaValidation(schema any, strict bool) *Builder[T]
- type Config
- func (c *Config[T]) DetectDrift(intended map[string]any) []diff.ConfigDiff
- func (c *Config[T]) Diff(other *Config[T]) []diff.ConfigDiff
- func (c *Config[T]) EnableEvents() *observe.EventEmitter
- func (c *Config[T]) EnableObservability() *observe.Metrics
- func (c *Config[T]) EnableVersioning(storagePath string, maxVersions int) *observe.VersionManager
- func (c *Config[T]) Env() string
- func (c *Config[T]) Explain(keyPath string) map[string]any
- func (c *Config[T]) Export(format string, outputPath ...string) ([]byte, error)
- func (c *Config[T]) ExportDebugReport(outputPath string) error
- func (c *Config[T]) Extend(ctx context.Context, l Loader) error
- func (c *Config[T]) FindKeysFromSource(pattern string) []string
- func (c *Config[T]) Freeze()
- func (c *Config[T]) GenerateDocs(format string) (string, error)
- func (c *Config[T]) Get(keyPath string) (any, error)
- func (c *Config[T]) GetBool(keyPath string) (bool, error)
- func (c *Config[T]) GetBoolOr(keyPath string, defaultVal bool) bool
- func (c *Config[T]) GetConflicts() map[string]*sourcetrack.SourceInfo
- func (c *Config[T]) GetFloat64(keyPath string) (float64, error)
- func (c *Config[T]) GetInt(keyPath string) (int, error)
- func (c *Config[T]) GetIntOr(keyPath string, defaultVal int) int
- func (c *Config[T]) GetMetrics() map[string]any
- func (c *Config[T]) GetOr(keyPath string, defaultVal any) any
- func (c *Config[T]) GetOverrideHistory(keyPath string) []sourcetrack.OverrideEntry
- func (c *Config[T]) GetSourceInfo(keyPath string) *sourcetrack.SourceInfo
- func (c *Config[T]) GetSourceStatistics() map[string]any
- func (c *Config[T]) GetString(keyPath string) (string, error)
- func (c *Config[T]) GetStringOr(keyPath, defaultVal string) string
- func (c *Config[T]) Has(keyPath string) bool
- func (c *Config[T]) HookProcessor() *hook.Processor
- func (c *Config[T]) IsFrozen() bool
- func (c *Config[T]) Keys(prefix ...string) []string
- func (c *Config[T]) Layers() []map[string]any
- func (c *Config[T]) MustGet(keyPath string) any
- func (c *Config[T]) OnChange(fn func(key string, oldVal, newVal any))
- func (c *Config[T]) Override(overrides map[string]any) (restore func(), err error)
- func (c *Config[T]) PrintDebugInfo(keyPath string) string
- func (c *Config[T]) Reload(ctx context.Context, opts ...ReloadOption) error
- func (c *Config[T]) RollbackToVersion(versionID string) error
- func (c *Config[T]) SaveVersion(metadata map[string]any) (*observe.Version, error)
- func (c *Config[T]) Schema(keyPath string) map[string]any
- func (c *Config[T]) Set(keyPath string, value any, opts ...SetOption) error
- func (c *Config[T]) SourceTracker() *sourcetrack.Tracker
- func (c *Config[T]) StopWatching()
- func (c *Config[T]) String() string
- func (c *Config[T]) ToDict() map[string]any
- func (c *Config[T]) Typed() (*T, error)
- type ConfigError
- type ErrorPolicy
- type Exporter
- type Hook
- type HookCondition
- type Loader
- type MergeStrategy
- type Merger
- type Option
- func WithDebugMode(v bool) Option
- func WithDeepMerge(v bool) Option
- func WithDynamicReloading(v bool) Option
- func WithEnv(env string) Option
- func WithEnvExpander(v bool) Option
- func WithEnvPrefix(prefix string) Option
- func WithEnvSwitcher(envVar string) Option
- func WithFreezeOnLoad(v bool) Option
- func WithLoaders(loaders ...Loader) Option
- func WithLogger(l *slog.Logger) Option
- func WithMergeStrategyMap(m map[string]MergeStrategy) Option
- func WithMergeStrategyOption(s MergeStrategy) Option
- func WithOnError(p ErrorPolicy) Option
- func WithSchema(schema any) Option
- func WithSchemaPath(path string) Option
- func WithStrictValidation(v bool) Option
- func WithSysenvFallback(v bool) Option
- func WithTypeCasting(v bool) Option
- func WithValidateOnLoad(v bool) Option
- type ReloadOption
- type SecretExistenceChecker
- type SecretMetadataProvider
- type SecretOption
- type SecretOptions
- type SecretStore
- type SetOption
- type Validator
Constants ¶
const ( // StrategyReplace discards the base map entirely and keeps only the overlay. StrategyReplace = merge.Replace // StrategyMerge recursively deep-merges the overlay into the base map, // preserving base keys that do not appear in the overlay. StrategyMerge = merge.DeepMergeStrategy // StrategyAppend appends overlay slice elements after the base slice elements. StrategyAppend = merge.Append // StrategyPrepend inserts overlay slice elements before the base slice elements. StrategyPrepend = merge.Prepend // StrategyIntersection keeps only keys that exist in both the base and the overlay. StrategyIntersection = merge.Intersection // StrategyUnion keeps all keys from both the base and the overlay, // with overlay values taking precedence on conflicts. StrategyUnion = merge.Union )
Variables ¶
var ( ErrConfigLoad = errors.New("config load error") ErrConfigFormat = errors.New("config format error") ErrConfigValidation = errors.New("config validation error") ErrConfigNotFound = errors.New("config key not found") ErrConfigMerge = errors.New("config merge conflict") ErrConfigFrozen = errors.New("config is frozen") ErrConfigAccess = errors.New("config access error") ErrSecretNotFound = errors.New("secret not found") ErrSecretAccess = errors.New("secret access error") ErrSecretStore = errors.New("secret store error") ErrSecretValidation = errors.New("secret validation error") ErrVaultAuth = errors.New("vault authentication error") )
Sentinel errors for use with errors.Is.
Functions ¶
func NewFormatError ¶
NewFormatError creates a config format/parse error.
func NewFrozenError ¶
NewFrozenError creates an error for operations on frozen config.
func NewLoadError ¶
NewLoadError creates a config load error.
func NewNotFoundError ¶
NewNotFoundError creates a key-not-found error with available keys.
func NewValidationError ¶
NewValidationError creates a config validation error.
Types ¶
type Builder ¶
type Builder[T any] struct { // contains filtered or unexported fields }
Builder provides a fluent API for constructing Config instances. Call NewBuilder to obtain a Builder, chain configuration methods, and finish with Builder.Build to produce a ready-to-use Config.
func (*Builder[T]) AddLoaders ¶
AddLoaders adds multiple loaders.
func (*Builder[T]) DisableDeepMerge ¶
DisableDeepMerge disables deep merging (shallow merge).
func (*Builder[T]) DisableDynamicReloading ¶
DisableDynamicReloading disables file watching.
func (*Builder[T]) DisableEnvExpander ¶
DisableEnvExpander disables ${VAR} expansion.
func (*Builder[T]) DisableTypeCasting ¶
DisableTypeCasting disables automatic type casting.
func (*Builder[T]) EnableDebug ¶
EnableDebug enables debug/source tracking mode.
func (*Builder[T]) EnableDeepMerge ¶
EnableDeepMerge enables deep merging.
func (*Builder[T]) EnableDynamicReloading ¶
EnableDynamicReloading enables file watching.
func (*Builder[T]) EnableEnvExpander ¶
EnableEnvExpander enables ${VAR} expansion.
func (*Builder[T]) EnableFreezeOnLoad ¶
EnableFreezeOnLoad freezes config after loading.
func (*Builder[T]) EnableTypeCasting ¶
EnableTypeCasting enables automatic type casting.
type Config ¶
type Config[T any] struct { // contains filtered or unexported fields }
Config is the central configuration manager. It loads, merges, validates, and serves configuration values from multiple sources (files, environment variables, remote stores). The type parameter T defines the strongly-typed model returned by [Config.Model]. All public methods are safe for concurrent use.
func New ¶
New creates a new Config instance, loading and merging all sources.
Initialization follows the priority: explicit argument > self-config file > built-in default.
func (*Config[T]) DetectDrift ¶
func (c *Config[T]) DetectDrift(intended map[string]any) []diff.ConfigDiff
DetectDrift compares this config against an intended baseline.
func (*Config[T]) Diff ¶
func (c *Config[T]) Diff(other *Config[T]) []diff.ConfigDiff
Diff compares this config with another config.
func (*Config[T]) EnableEvents ¶
func (c *Config[T]) EnableEvents() *observe.EventEmitter
EnableEvents enables event emission.
func (*Config[T]) EnableObservability ¶
EnableObservability enables access/reload/change metrics collection.
func (*Config[T]) EnableVersioning ¶
func (c *Config[T]) EnableVersioning(storagePath string, maxVersions int) *observe.VersionManager
EnableVersioning enables config versioning with snapshot persistence.
func (*Config[T]) Export ¶
Export serializes the config to the given format ("json", "yaml", "toml"). If outputPath is provided, also writes to that file.
func (*Config[T]) ExportDebugReport ¶
ExportDebugReport writes a full debug report as JSON.
func (*Config[T]) FindKeysFromSource ¶
FindKeysFromSource returns keys from sources matching the pattern.
func (*Config[T]) GenerateDocs ¶
GenerateDocs generates configuration documentation in the given format ("markdown" or "json").
func (*Config[T]) Get ¶
Get retrieves a value by dot-separated key path. Hooks are applied to leaf values.
func (*Config[T]) GetConflicts ¶
func (c *Config[T]) GetConflicts() map[string]*sourcetrack.SourceInfo
GetConflicts returns all keys that have been overridden.
func (*Config[T]) GetFloat64 ¶
GetFloat64 retrieves a float64 value by key path.
func (*Config[T]) GetMetrics ¶
GetMetrics returns current observability metrics. Returns nil if not enabled.
func (*Config[T]) GetOverrideHistory ¶
func (c *Config[T]) GetOverrideHistory(keyPath string) []sourcetrack.OverrideEntry
GetOverrideHistory returns the override history for a key.
func (*Config[T]) GetSourceInfo ¶
func (c *Config[T]) GetSourceInfo(keyPath string) *sourcetrack.SourceInfo
GetSourceInfo returns source tracking info for a key.
func (*Config[T]) GetSourceStatistics ¶
GetSourceStatistics returns aggregated source statistics.
func (*Config[T]) GetStringOr ¶
GetStringOr retrieves a string value, returning the default if not found.
func (*Config[T]) HookProcessor ¶
HookProcessor returns the hook processor for registering custom hooks.
func (*Config[T]) OnChange ¶
OnChange registers a callback that fires when configuration values change after reload.
func (*Config[T]) Override ¶
Override temporarily overrides configuration values. Returns a restore function that must be called (typically via defer) to revert.
func (*Config[T]) PrintDebugInfo ¶
PrintDebugInfo returns formatted debug info for a key (or all keys if empty).
func (*Config[T]) Reload ¶
func (c *Config[T]) Reload(ctx context.Context, opts ...ReloadOption) error
Reload reloads all configurations from their sources.
func (*Config[T]) RollbackToVersion ¶
RollbackToVersion restores the config to a previous version snapshot.
func (*Config[T]) SaveVersion ¶
SaveVersion saves the current config as an immutable version snapshot.
func (*Config[T]) Set ¶
Set sets a value by dot-separated key path. Thread-safe, respects frozen state. Pass WithOverride(false) to raise an error if the key already exists.
func (*Config[T]) SourceTracker ¶
func (c *Config[T]) SourceTracker() *sourcetrack.Tracker
SourceTracker returns the source tracker for advanced inspection.
func (*Config[T]) StopWatching ¶
func (c *Config[T]) StopWatching()
StopWatching stops the file watcher if running.
func (*Config[T]) String ¶
String returns a human-readable summary of the Config, including its environment, key count, loader sources, and frozen state.
type ConfigError ¶
type ConfigError struct {
Op string // operation that failed (e.g., "Load", "Get", "Set")
Source string // source identifier (e.g., file path, URL)
Key string // config key involved, if applicable
Err error // underlying error (wraps a sentinel)
Context map[string]any
}
ConfigError is a structured error that captures the failing operation, the source and key involved, and an underlying sentinel error. Use errors.Is or errors.As to inspect the chain.
func (*ConfigError) Error ¶
func (e *ConfigError) Error() string
func (*ConfigError) Unwrap ¶
func (e *ConfigError) Unwrap() error
type ErrorPolicy ¶
type ErrorPolicy string
ErrorPolicy defines how errors are handled during loading.
const ( ErrorPolicyRaise ErrorPolicy = "raise" ErrorPolicyWarn ErrorPolicy = "warn" ErrorPolicyIgnore ErrorPolicy = "ignore" )
type Exporter ¶
type Exporter interface {
// Export serializes the configuration data.
Export(data map[string]any) ([]byte, error)
// Format returns the format name (e.g., "json", "yaml", "toml").
Format() string
}
Exporter serializes configuration to a specific format.
type Hook ¶
Hook is a function that transforms a configuration value during access. Hooks are executed in registration order and may modify, enrich, or replace the value before it is returned to the caller.
type HookCondition ¶
HookCondition is a predicate that determines whether a conditional hook should fire for a given key and value. Returning true causes the associated Hook to execute; returning false skips it.
type Loader ¶
type Loader interface {
// Load reads configuration and returns it as a map.
Load(ctx context.Context) (map[string]any, error)
// Source returns a human-readable identifier for this loader
// (e.g., file path, URL, "environment:APP").
Source() string
}
Loader loads configuration from a source. Implementations should return (nil, nil) when the source does not exist (graceful absence) and (nil, error) on actual failures.
type MergeStrategy ¶
MergeStrategy identifies the algorithm used when two configuration maps are combined during a load or reload operation.
type Merger ¶
Merger is a function that combines a base configuration map with an overlay map, producing a merged result according to a MergeStrategy.
type Option ¶
type Option func(*options)
Option configures a Config instance.
func WithDebugMode ¶
WithDebugMode enables detailed source tracking.
func WithDeepMerge ¶
WithDeepMerge enables or disables deep merging of nested maps.
func WithDynamicReloading ¶
WithDynamicReloading enables file watching for automatic reload on change.
func WithEnvExpander ¶
WithEnvExpander enables or disables ${VAR} expansion in string values.
func WithEnvPrefix ¶
WithEnvPrefix auto-adds an EnvironmentLoader with this prefix.
func WithEnvSwitcher ¶
WithEnvSwitcher sets the OS environment variable name whose value selects the active environment.
func WithFreezeOnLoad ¶
WithFreezeOnLoad freezes the config after initialization.
func WithLoaders ¶
WithLoaders sets the ordered list of loaders. Later loaders override earlier ones.
func WithLogger ¶
WithLogger sets the logger for the config instance.
func WithMergeStrategyMap ¶
func WithMergeStrategyMap(m map[string]MergeStrategy) Option
WithMergeStrategyMap sets per-path merge strategy overrides.
func WithMergeStrategyOption ¶
func WithMergeStrategyOption(s MergeStrategy) Option
WithMergeStrategyOption sets the default merge strategy.
func WithOnError ¶
func WithOnError(p ErrorPolicy) Option
WithOnError sets the error handling policy.
func WithSchema ¶
WithSchema sets the validation schema (struct type or JSON schema dict).
func WithSchemaPath ¶
WithSchemaPath sets the path to a JSON Schema file.
func WithStrictValidation ¶
WithStrictValidation raises errors on validation failure instead of warning.
func WithSysenvFallback ¶
WithSysenvFallback enables fallback to system env vars for missing keys.
func WithTypeCasting ¶
WithTypeCasting enables or disables automatic type casting of string values.
func WithValidateOnLoad ¶
WithValidateOnLoad validates configuration immediately after loading.
type ReloadOption ¶
type ReloadOption func(*reloadOpts)
ReloadOption is a functional option that configures the behavior of Config.Reload, such as enabling dry-run mode or overriding validation.
func WithDryRun ¶
func WithDryRun(v bool) ReloadOption
WithDryRun loads and validates without applying changes.
func WithIncremental ¶
func WithIncremental(v bool) ReloadOption
WithIncremental only reloads files that have changed (based on mtime+hash).
func WithReloadValidate ¶
func WithReloadValidate(v bool) ReloadOption
WithReloadValidate overrides validate_on_load for this reload.
type SecretExistenceChecker ¶
type SecretExistenceChecker interface {
SecretExists(ctx context.Context, key string) (bool, error)
}
SecretExistenceChecker is optionally implemented by stores that can efficiently check for secret existence without retrieving the value.
type SecretMetadataProvider ¶
type SecretMetadataProvider interface {
GetSecretMetadata(ctx context.Context, key string) (map[string]any, error)
}
SecretMetadataProvider is optionally implemented by stores that can return metadata about a secret.
type SecretOption ¶
type SecretOption func(*SecretOptions)
SecretOption configures optional secret operation parameters.
func WithVersion ¶
func WithVersion(v string) SecretOption
WithVersion sets the secret version for retrieval.
type SecretOptions ¶
type SecretOptions struct {
Version string
}
SecretOptions holds resolved secret operation options.
func ResolveSecretOptions ¶
func ResolveSecretOptions(opts ...SecretOption) SecretOptions
ResolveSecretOptions applies all options and returns the resolved result.
type SecretStore ¶
type SecretStore interface {
GetSecret(ctx context.Context, key string, opts ...SecretOption) (any, error)
SetSecret(ctx context.Context, key string, value any, opts ...SecretOption) error
DeleteSecret(ctx context.Context, key string, opts ...SecretOption) error
ListSecrets(ctx context.Context, prefix string) ([]string, error)
}
SecretStore provides access to a secret management backend.
type SetOption ¶
type SetOption func(*setOpts)
SetOption is a functional option that configures the behavior of Config.Set.
func WithOverride ¶
WithOverride allows or prevents overwriting existing keys. Default: true.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package compose processes _include and _defaults directives in configuration files, supporting Hydra-style configuration composition with cycle detection.
|
Package compose processes _include and _defaults directives in configuration files, supporting Hydra-style configuration composition with cycle detection. |
|
Package diff provides configuration comparison and drift detection.
|
Package diff provides configuration comparison and drift detection. |
|
Package envhandler resolves environment-specific configuration by merging a "default" section with the active environment section.
|
Package envhandler resolves environment-specific configuration by merging a "default" section with the active environment section. |
|
examples
|
|
|
basic
command
Package main demonstrates basic Confii usage: loading a YAML config and accessing values using dot-notation key paths.
|
Package main demonstrates basic Confii usage: loading a YAML config and accessing values using dot-notation key paths. |
|
builder
command
Package main demonstrates the fluent builder pattern for constructing a Config instance with chained method calls.
|
Package main demonstrates the fluent builder pattern for constructing a Config instance with chained method calls. |
|
composition
command
Package main demonstrates Hydra-style config composition using _include and _defaults directives.
|
Package main demonstrates Hydra-style config composition using _include and _defaults directives. |
|
diff
command
Package main demonstrates config diffing and drift detection.
|
Package main demonstrates config diffing and drift detection. |
|
dynamic-reload
command
Package main demonstrates file watching and dynamic reloading.
|
Package main demonstrates file watching and dynamic reloading. |
|
environment
command
Package main demonstrates environment-aware configuration.
|
Package main demonstrates environment-aware configuration. |
|
export
command
Package main demonstrates exporting configuration to different formats (JSON, YAML, TOML) and generating documentation.
|
Package main demonstrates exporting configuration to different formats (JSON, YAML, TOML) and generating documentation. |
|
hooks
command
Package main demonstrates the hook system.
|
Package main demonstrates the hook system. |
|
introspection
command
Package main demonstrates Confii's introspection capabilities: Explain, Layers, Schema, source tracking, and debug reports.
|
Package main demonstrates Confii's introspection capabilities: Explain, Layers, Schema, source tracking, and debug reports. |
|
lifecycle
command
Package main demonstrates config lifecycle operations: reload, extend, freeze, override, set, and change callbacks.
|
Package main demonstrates config lifecycle operations: reload, extend, freeze, override, set, and change callbacks. |
|
merge-strategies
command
Package main demonstrates advanced merge strategies.
|
Package main demonstrates advanced merge strategies. |
|
multi-source
command
Package main demonstrates loading configuration from multiple sources.
|
Package main demonstrates loading configuration from multiple sources. |
|
observability
command
Package main demonstrates observability features: access metrics, event emission, and monitoring config usage patterns.
|
Package main demonstrates observability features: access metrics, event emission, and monitoring config usage patterns. |
|
self-config
command
Package main demonstrates Confii's self-configuration feature.
|
Package main demonstrates Confii's self-configuration feature. |
|
typed
command
Package main demonstrates type-safe configuration access using Go generics.
|
Package main demonstrates type-safe configuration access using Go generics. |
|
validation
command
Package main demonstrates both struct tag validation and JSON Schema validation for configuration.
|
Package main demonstrates both struct tag validation and JSON Schema validation for configuration. |
|
versioning
command
Package main demonstrates config versioning: taking snapshots, comparing versions, and rolling back to a previous state.
|
Package main demonstrates config versioning: taking snapshots, comparing versions, and rolling back to a previous state. |
|
Package export provides configuration exporters.
|
Package export provides configuration exporters. |
|
Package hook provides a thread-safe hook processor for transforming configuration values during access.
|
Package hook provides a thread-safe hook processor for transforming configuration values during access. |
|
internal
|
|
|
dictutil
Package dictutil provides utility functions for working with nested map[string]any configuration dictionaries.
|
Package dictutil provides utility functions for working with nested map[string]any configuration dictionaries. |
|
formatparse
Package formatparse detects configuration file formats from file extensions and content types.
|
Package formatparse detects configuration file formats from file extensions and content types. |
|
typecoerce
Package typecoerce provides string-to-typed-value coercion utilities.
|
Package typecoerce provides string-to-typed-value coercion utilities. |
|
Package loader provides implementations of the confii.Loader interface for various configuration sources.
|
Package loader provides implementations of the confii.Loader interface for various configuration sources. |
|
Package merge provides configuration merging strategies.
|
Package merge provides configuration merging strategies. |
|
Package observe provides observability features: metrics, events, and versioning.
|
Package observe provides observability features: metrics, events, and versioning. |
|
Package secret provides secret store implementations and a placeholder resolver.
|
Package secret provides secret store implementations and a placeholder resolver. |
|
Package selfconfig reads Confii's own configuration from dedicated config files before user loaders run.
|
Package selfconfig reads Confii's own configuration from dedicated config files before user loaders run. |
|
Package sourcetrack provides per-key source tracking for configuration values, recording where each value originated, how many times it was overridden, and the full override history.
|
Package sourcetrack provides per-key source tracking for configuration values, recording where each value originated, how many times it was overridden, and the full override history. |
|
Package validate provides configuration validation implementations.
|
Package validate provides configuration validation implementations. |
|
Package watch provides file-watching capabilities for automatic config reloading.
|
Package watch provides file-watching capabilities for automatic config reloading. |