Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
World_countries | 1,092 | a month ago | 13 | June 19, 2022 | 8 | other | PHP | |||
Constantly updated lists of world countries and their associated alpha-2, alpha-3 and numeric country codes as defined by the ISO 3166 standard, available in CSV, JSON , PHP, SQL and XML formats, in multiple languages and with national flags included; also available are the ISO 3166-2 codes of provinces/ states associated with the countries | ||||||||||
Featureflags | 574 | 1 | 2 months ago | 33 | January 07, 2020 | mit | Swift | |||
🚩 Allows developers to configure feature flags, run multiple A/B tests or phase feature roll out using a JSON configuration file. | ||||||||||
Config | 464 | 18 | 21 hours ago | 59 | October 16, 2022 | 7 | mit | Go | ||
📝 Go configuration manage(load,get,set,export). support JSON, YAML, TOML, Properties, INI, HCL, ENV and Flags. Multi file load, data override merge, parse ENV var. Go应用配置加载管理,支持多种格式,多文件加载,远程文件加载,支持数据合并,解析环境变量名 | ||||||||||
Aconfig | 436 | 16 | a month ago | 65 | October 15, 2022 | 11 | mit | Go | ||
Simple, useful and opinionated config loader. | ||||||||||
Goforit | 62 | 9 days ago | 1 | October 25, 2018 | mit | Go | ||||
A feature flags client library for Go | ||||||||||
Country Flag Emoji Json | 39 | 1 | 2 years ago | 4 | September 11, 2021 | cc-by-sa-4.0 | JavaScript | |||
Country flag emojis in JSON format. | ||||||||||
Paerser | 39 | 16 | 4 months ago | 7 | March 16, 2022 | 2 | apache-2.0 | Go | ||
Flagga | 29 | 5 years ago | 1 | July 23, 2018 | mit | Go | ||||
An extensible Go library for handling program configuration using flags. | ||||||||||
Goconf | 23 | 1 | 3 months ago | 5 | January 04, 2022 | unlicense | Go | |||
Configuration loader in Go | ||||||||||
Json Typedef Infer | 22 | a year ago | 4 | mit | Rust | |||||
A CLI tool that generates JSON Typedef schemas from example data |
flagga is an extensible Go library for handling program configuration using (but not limited to) command line arguments, environment variables and JSON.
This idea and API come from Peter Bourgon's Go for Industrial Programming talk at Gophercon Iceland 2018.
It should work as a drop-in replacement for the standard library flag
package. The only difference is the fact that NewFlagSet
and Init
accept a second string for the description.
flag
package with extra features.go get github.com/erizocosmico/flagga
Or use your preferred dependency manager such as dep or vgo.
var fs flagga.FlagSet
db := fs.String("db", defaultDBURI, "database connection string", flagga.Env("DBURI"))
users := fs.StringList("users", nil, "list of allowed users", flagga.JSON("users"))
err := fs.Parse(os.Args[1:], flagga.JSONVia("config.json"), flagga.EnvPrefix("MYAPP_"))
if err != nil {
// handle err
}
fmt.Println(*db) // Outputs: "[email protected]:1234/foo"
fmt.Println(strings.Join(*users, ", ")) // Outputs: "jane, joe, alice"
To get the previous results we can invoke the program in the following ways:
echo '{"users":["jane", "joe", "alice"]}' > config.json
./myprogram [email protected]:1234/foo -users=jane -users=joe -users=alice
[email protected]:1234/foo ./myprogram
CLI flags always have priority over environment variables or JSON keys. If a flag is provided using the command line flags, no other sources will be checked for that variable.
The rest of the priorities depend of the order in which the sources are passed to the Parse
method. For example, fs.Parse(os.Args, flagga.EnvPrefix("FOO_"), flagga.JSONVia("cfg"))
gives more priority to environment variables than to the JSON configuration.
Extractor
sEnv
: from environment variable sources.JSON
: from JSON sources.YAML and TOML extractors are available in the flaggax repository.
Source
sEnvPrefix
: provides all environment variables matching the given prefix.JSONVia
: provides the content of the JSON in the given file.YAML and TOML sources are available in the flaggax repository.
Source
s and Extractor
sYou can implement your own Source
s and Extractor
s in case your configuration is in a different format. Check out the Source
and Extractor
interfaces in the package documentation.
MIT, see LICENSE