koanf (pronounced conf; a play on the Japanese Koan) is a library for reading configurations from different sources in different formats in Go applications. It is a cleaner, lighter alternative to spf13/viper with better abstractions and extensibility, and fewer dependencies. koanf comes with built-in support for reading configuration from files, command line flags, and environment variables, and can parse JSON, YAML, TOML, and Hashicorp HCL. Any external dependencies are detached from the core into sub-packages, so only the ones that are explicitly referenced get compiled into an application. Once loaded into koanf, configuration are values queried by a delimited key path syntax. eg: app.server.port. Any delimiter can be chosen. Configuration from multiple sources can be loaded and merged into a koanf instance, for example, load from a file first and override certain values with flags from the command line.

Features

  • Read config from files
  • Watch files for changes
  • Read from command line
  • Read environment variables
  • Read from an S3 bucket
  • Read raw bytes

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow koanf

koanf Web Site

Other Useful Business Software
Powerful App Monitoring Without Surprise Bills Icon
Powerful App Monitoring Without Surprise Bills

AppSignal starts at $23/month with all features included. No overages, no hidden fees. 30-day free trial.

Tired of monitoring tools that punish you for scaling? AppSignal offers transparent, predictable pricing with every feature unlocked on every plan. Track errors, monitor performance, detect anomalies, and manage logs across Ruby, Python, Node.js, and more. Trusted by developers since 2012 with free dev-to-dev support. No credit card required to start your 30-day trial.
Try AppSignal Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of koanf!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Go

Related Categories

Go Libraries

Registered

2023-01-31