You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gosuv/config.go

26 lines
446 B

package main
import "gopkg.in/gcfg.v1"
type RCServer struct {
WebAddr string `gcfg:"web-addr"`
}
type RConfig struct {
Server struct {
WebAddr string `gcfg:"web-addr"`
RpcAddr string `gcfg:"rpc-addr"`
}
}
var rcfg *RConfig
func loadRConfig() (err error) {
rcfg = new(RConfig)
// set default values
rcfg.Server.RpcAddr = "127.0.0.1:54637"
rcfg.Server.WebAddr = "127.0.0.1:54000"
err = gcfg.ReadFileInto(rcfg, "gosuvrc")
return
}