App #yay
This commit is contained in:
@@ -2,6 +2,8 @@ package core
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/localhots/confection"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -16,6 +18,20 @@ type (
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
conf *confection.Manager
|
||||
)
|
||||
|
||||
func Conf() Config {
|
||||
return conf.Config().(Config)
|
||||
}
|
||||
|
||||
func InitConfig() {
|
||||
conf = confection.New(Config{}, ConfigDecoder)
|
||||
go conf.StartServer()
|
||||
conf.RequireConfig()
|
||||
}
|
||||
|
||||
func ConfigDecoder(b []byte) interface{} {
|
||||
var newConf Config
|
||||
if err := json.Unmarshal(b, &newConf); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user