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
Train ML Models With SQL You Already Know Icon
Train ML Models With SQL You Already Know

BigQuery automates data prep, analysis, and predictions with built-in AI assistance.

Build and deploy ML models using familiar SQL. Automate data prep with built-in Gemini. Query 1 TB and store 10 GB free monthly.
Try 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