https://github.com/xwi88/config
config files read with go migrate to xwi88/config4go with module
https://github.com/xwi88/config
config config4go go
Last synced: 3 months ago
JSON representation
config files read with go migrate to xwi88/config4go with module
- Host: GitHub
- URL: https://github.com/xwi88/config
- Owner: xwi88
- License: mit
- Created: 2018-12-23T08:20:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-06T02:18:30.000Z (about 6 years ago)
- Last Synced: 2025-01-15T17:36:48.885Z (5 months ago)
- Topics: config, config4go, go
- Language: Go
- Homepage:
- Size: 1.1 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# config
## support
support files with extension: json, toml, yaml, yml, properties, props, prop, hcl.
## usage
`govendor fetch github.com/xwi88/config`
## example
```go
type redisOptions struct {
Host string
Port string
Password string
IdleTimeout int
MaxIdle int
MaxActive int
}type testConf struct {
Name string
Redis redisOptions
}var conf testConf
testfile := "./testdata/app_test.toml"
err := LoadConfig(testfile, &conf)
if err != nil {
// some deal
}
fmt.Println(conf.Host)
```