{"repo":"heetch/confita","free":true,"listed":false,"github":"https://github.com/heetch/confita","clone":"git clone https://github.com/heetch/confita.git","description":"Load configuration in cascade from multiple backends into a struct","language":"Go","stars":507,"topics":["configuration","structure","configuration-loader","golang","team-boost"],"license":"MIT","category":"cli-tools","readme_excerpt":"Confita is a library that loads configuration from multiple backends and stores it in a struct. Supported backends - Environment variables - JSON files - Yaml files - Toml files - Command line flags - etcd - Consul - Vault - Amazon SSM Install Usage Confita scans a struct for config tags and calls all the backends one after another until the key is found. The value is then converted into the type of the field. Struct layout Go primitives are supported: Time is expected to be in RFC3339 format. By default, all fields are optional. With the required option, if a key is not found then Confita will return an error. Nested structs are supported too: If a field is a slice, Confita will automatically split the config value by commas and fill the slice with each sub value. As a special case, if the field tag is \"-\", the field is always omitted. This is useful if you want to populate this field on your own. Loading configuration Creating a loader: By default, a Confita loader loads all the keys from the environment. A loader can take other configured backends as parameters. Loading configuration: Since loading configuration can take time when used with multiple remote backends, context can be used for timeout and cancelation: Default values If a key is not found, Confita won't change the respective struct field. With that in mind, default values can simply be implemented by filling the structure before passing it to Confita. Backend option By default, Confita queries each backend one ","default_branch":null,"files":null,"tree":[],"storefront":"/r/heetch","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/heetch/confita/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}