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

Top 2.0% on proxy.golang.org
Top 0.6% dependent packages on proxy.golang.org
Top 0.6% dependent repos on proxy.golang.org
Top 3.9% forks on proxy.golang.org
Top 0.9% docker downloads on proxy.golang.org

proxy.golang.org : github.com/ardanlabs/conf

Package conf provides support for using environmental variables and command line arguments for configuration. It is compatible with the GNU extensions to the POSIX recommendations for command-line options. See http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html There are no hard bindings for this package. This package takes a struct value and parses it for both the environment and flags. It supports several tags to customize the flag options. The field name and any parent struct name will be used for the long form of the command name unless the name is overridden. As an example, this config struct: Would produce the following usage output: Usage: conf.test [options] [arguments] OPTIONS The API is a single call to Parse Additionally, if the config struct has a field of the slice type conf.Args then it will be populated with any remaining arguments from the command line after flags have been processed. For example a program with a config struct like this: If that program is executed from the command line like this: Then the cfg.Args field will contain the string values ["serve", "http"]. The Args type has a method Num for convenient access to these arguments such as this: You can add a version with a description by adding the Version type to your config type Then you can set these values at run time for display.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/ardanlabs/conf
License: Apache-2.0
Latest release: over 3 years ago
First release: over 5 years ago
Namespace: github.com/ardanlabs
Dependent packages: 71
Dependent repositories: 102
Stars: 170 on GitHub
Forks: 38 on GitHub
Docker dependents: 13
Docker downloads: 30,428
See more repository details: repos.ecosyste.ms
Last synced: about 22 hours ago

    Loading...
    Readme
    Loading...