From a2a6f47afa1593885895687573f55bca633fbf39 Mon Sep 17 00:00:00 2001 From: astaxie Date: Sun, 25 May 2014 22:37:38 +0800 Subject: [PATCH] beego: support other config provider --- config.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config.go b/config.go index 08988bc0..e8f752bd 100644 --- a/config.go +++ b/config.go @@ -70,6 +70,7 @@ var ( AdminHttpPort int FlashName string // name of the flash variable found in response header and cookie FlashSeperator string // used to seperate flash key:value + AppConfigProvider string // config provider ) func init() { @@ -91,6 +92,8 @@ func init() { } } + AppConfigProvider = "ini" + StaticDir = make(map[string]string) StaticDir["/static"] = "static" @@ -170,7 +173,7 @@ func init() { // ParseConfig parsed default config file. // now only support ini, next will support json. func ParseConfig() (err error) { - AppConfig, err = config.NewConfig("ini", AppConfigPath) + AppConfig, err = config.NewConfig(AppConfigProvider, AppConfigPath) if err != nil { AppConfig = config.NewFakeConfig() return err