package
0.0.0-20151215094434-9aa9c3bf18f3
Repository: https://github.com/itshosted/mcore.git
Documentation: pkg.go.dev
# README
Config loader
Remove duplicate code from multiple projects into one.
package config
import (
"github.com/xsnews/mcore/config"
)
type Config struct {
// TODO: body here
}
var C Config
func Init(filename string) error {
return config.Load(filename, &C)
}
Load files from a conf.d
package main
import (
"github.com/xsnews/mcore/config"
)
type Host struct {
Ip string
Port int
}
func main() {
hosts := make(map[string]Host)
err := config.LoadJsonD("./conf.d/", &hosts)
if err != nil {
panic(err)
}
}