xwi88 / config

config files read with go migrate to xwi88/config4go with module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

config

support

support files with extension: json, toml, yaml, yml, properties, props, prop, hcl.

usage

govendor fetch github.com/xwi88/config

example

	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)

About

config files read with go migrate to xwi88/config4go with module

License:MIT License


Languages

Language:Go 100.0%