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
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start 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