Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ian-kent/envconf
Configure Go applications from the environment
https://github.com/ian-kent/envconf
Last synced: about 1 month ago
JSON representation
Configure Go applications from the environment
- Host: GitHub
- URL: https://github.com/ian-kent/envconf
- Owner: ian-kent
- License: mit
- Created: 2014-10-26T12:12:26.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2014-10-26T12:12:40.000Z (over 9 years ago)
- Last Synced: 2024-01-30T04:05:18.746Z (4 months ago)
- Language: Go
- Size: 97.7 KB
- Stars: 11
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Lists
- awesome-go - envconf - Configuration from environment. (Configuration / Standard CLI)
- awesome-go - envconf - Configuration from environment. (Configuration / Standard CLI)
- awesome-go-extra - envconf - 10-26T12:12:26Z|2014-10-26T12:12:40Z| (Configuration / Advanced Console UIs)
- awesome-go - envconf - Configuration from environment. (Configuration / Standard CLI)
- awesome-go - envconf - Configuration from environment. (Configuration / Advanced Console UIs)
- awesome-go - envconf - Configuration from environment. (Configuration / Standard CLI)
- fucking-awesome-go - :octocat: envconf - Configuration from environment :star: 3 :fork_and_knife: 1 (Configuration / Advanced Console UIs)
- awesome-go - envconf - Configuration from environment. (Configuration / Advanced Console UIs)
- awesome-go-projects - envconf - Configuration from environment. (Configuration / Standard CLI)
- awesome-go - envconf
- awesome-go - envconf - Configuration from environment (Configuration / Advanced Console UIs)
- awesome-go-with-framework - envconf - Configuration from environment. (Configuration / Advanced Console UIs)
- awesome-go - envconf - Configuration from environment. (Configuration / Standard CLI)
- awesome-go-cn - envconf - kent/envconf) [![godoc][D]](https://godoc.org/github.com/ian-kent/envconf) (配置 / 标准CLI)
- awesome-go-stars - envconf(stars: 11) - Configuration from environment. (Configuration / Standard CLI)
- awesome-go - envconf - Configuration from environment (Configuration / Advanced Console UIs)
- awesome-go - envconf - Configuration from environment. (Configuration / Advanced Console UIs)
- awesome-go - envconf - 环境配置 (<span id="组态-configuration">组态 Configuration</span> / <span id="高级控制台用户界面-advanced-console-uis">高级控制台用户界面 Advanced Console UIs</span>)
- awesome-go. - envconf - Configuration from environment. (Configuration / Advanced Console UIs)
- awesome-go-cn - envconf - 通过环境变量来配置 (配置 / 高级控制台界面)
- awesome-go-with-stars - envconf - Configuration from environment. (Configuration / Standard CLI)
- awesome-go - envconf - Configuration from environment. (Configuration / Advanced Console UIs)
- awesome-go-cn - envconf
- repo-1316-awesome-go-cn - envconf - kent/envconf) [![godoc][D]](https://godoc.org/github.com/ian-kent/envconf) (配置 / 标准CLI)
- repo-1211-awesome-go-cn - envconf - kent/envconf) [![godoc][D]](https://godoc.org/github.com/ian-kent/envconf) (配置 / 标准CLI)
- awesome-Char - envconf - Configuration from environment. (Configuration / Advanced Console UIs)
- awesome-reader - envconf - Configuration from environment. (Configuration / Advanced Console UIs)
- awesome-go - envconf - Configuration from environment. (Configuration / Advanced Console UIs)
- Go-awesome - envconf - Configuration from environment. (Configuration / Standard CLI)
- awesome-go-cn - envconf - kent/envconf) [![godoc][D]](https://godoc.org/github.com/ian-kent/envconf) (配置 / 标准CLI)
- awesome-go - envconf - Configuration from environment (Configuration / Advanced Console UIs)
- awesome-go-zh - envconf - kent/envconf) [![godoc][D]](https://godoc.org/github.com/ian-kent/envconf) (配置 / 标准CLI)
- awesome-go-handwritten - envconf - Configuration from environment. (Configuration / Advanced Console UIs)
- awesome-go - envconf - 通過環境變數來配置 (配置 / 高級控制台界面)
- awesome-go - envconf - Configuration from environment. (Configuration / Standard CLI)
- awesome-go2 - envconf - Configuration from environment. (Configuration / Advanced Console UIs)
- awesome-go - envconf - Configuration from environment. (Configuration / Advanced Console UIs)
- awesome-go - envconf - Configuration from environment. - :arrow_down:13 - :star:3 (Configuration / Advanced Console UIs)
- awesome-go - envconf - Configuration from environment. (Configuration / Advanced Console UIs)
- awesome-go - envconf - Configuration from environment (Configuration / Advanced Console UIs)
- awesome-go-cn - envconf
- awesome-go-cn - envconf
- awesome-go - envconf - Configuration from environment. (Configuration / Standard CLI)
- awesome-go - envconf - Configuration from environment. (Configuration / Standard CLI)
- awesome-go - envconf - Configure Go applications from the environment - ★ 7 (Configuration)
- go-awesome-cn-star - envconf
README
envconf
=======Configure your Go application from the environment.
Supports most basic Go types and works nicely with the built in `flag` package.
```go
package mainimport(
"flag"
"fmt"
. "github.com/ian-kent/envconf"
)func main() {
count := flag.Int("count", FromEnvP("COUNT", 15).(int), "Count target")
flag.Parse()
for i := 1; i <= *count; i++ {
fmt.Printf("%d\n", i)
}
}
```## Licence
Copyright © 2014, Ian Kent (http://iankent.uk).
Released under MIT license, see [LICENSE](LICENSE.md) for details.