A simple, decoupled configuration loader for Go that reads from files, environment variables, flags, and cloud services with change watching.
konf is a Go library for loading and managing application configuration from multiple sources like files, environment variables, command-line flags, and cloud services (AWS, Azure, GCP). It solves the problem of tightly coupling Go applications to specific configuration backends by providing a unified, source-agnostic API.
Go developers building applications that require flexible configuration management, especially those deploying to cloud environments or needing dynamic configuration updates without restarting.
Developers choose konf for its clean separation of concerns, performance advantages over alternatives like viper and koanf, built-in support for major cloud providers, and ability to watch and react to configuration changes dynamically.
The simplest config loader for Go that reads/watches from file, env, flag and clouds (AWS, Azure, GCP).
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Benchmarks in the README show konf's Unmarshal is over 10x faster than viper and 388x faster than koanf in ns/op, with significantly lower allocations, making it highly efficient for configuration loading.
Provides built-in loaders for AWS, Azure, and GCP services like AppConfig and Secret Manager, with notifiers for change watching, enabling dynamic configuration in cloud deployments without custom glue code.
The Explain method details where each config value originates from multiple sources, with automatic obfuscation of sensitive data, aiding debugging in complex multi-source setups.
Core module has no external dependencies for basic file, env, and flag loading, keeping the library lightweight and easy to audit for simple use cases.
Configuring watch functionality with cloud notifiers like AWS SNS or Azure Service Bus requires additional service setup and understanding, adding operational overhead beyond basic loading.
As a newer project, konf has fewer community contributions and third-party providers compared to established alternatives like viper, potentially limiting plug-and-play integrations for niche sources.
For straightforward applications with static configs, konf's decoupled design and advanced features like OnChange callbacks can introduce unnecessary abstraction and a steeper initial learning curve.