Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 7.0% on proxy.golang.org
Top 4.6% dependent packages on proxy.golang.org

proxy.golang.org : github.com/krostar/config

Package config is a light yet powerful config loader. Configuration loading is as easy as: See each sources to get more details on how to use them. Set default recursively by walking through any types and try to apply defaults. A default is applied if the type implement the setDefaultFunc interface and the actual value is the zero value of the type. Considering the following structure: If we want to apply defaults to an instance of furniture, we just have to: We already see that the SetDefault method will be call if any value is the zero value and value's type implements SetDefault. There is two exception: If the type is a pointer: If it's a struct field with the `default:"-"` tag: Configuration validation can be made to validate types implementing validateFunc. It recursively walk through any types and call validateFunc if defined, for any of them. Considering the following structure: If we want to validate to an instance of furniture, we just have to:

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/krostar/config
Keywords: config-default, config-loader, config-management
License: MIT
Latest release: about 4 years ago
First release: over 5 years ago
Namespace: github.com/krostar
Dependent packages: 2
Stars: 8 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 13 days ago

    Loading...
    Readme
    Loading...