예제 #1
0
파일: config.go 프로젝트: jlyt898/fae
func (this *Engine) doLoadConfig() {
	this.conf.httpListenAddr = this.conf.String("http_listen_addr", "")

	// rpc section
	this.conf.rpc = new(configRpc)
	section, err := this.conf.Section("rpc")
	if err != nil {
		panic(err)
	}
	this.conf.rpc.loadConfig(section)

	section, err = this.conf.Section("servants")
	if err != nil {
		panic(err)
	}
	config.LoadServants(section)
}
예제 #2
0
파일: config.go 프로젝트: justinblah/fae
func (this *Engine) doLoadConfig() {
	this.conf.httpListenAddr = this.conf.String("http_listen_addr", "")
	this.conf.peerHeartbeatInterval = this.conf.Int("peer_heartbeat_interval", 30)
	this.conf.peerDeadThreshold = this.conf.Float("peer_dead_threshold", 30)
	this.conf.peerGroupAddr = this.conf.String("peer_group_addr", "224.0.0.2:19850")

	// rpc section
	this.conf.rpc = new(configRpc)
	section, err := this.conf.Section("rpc")
	if err != nil {
		panic(err)
	}
	this.conf.rpc.loadConfig(section)

	section, err = this.conf.Section("servants")
	if err != nil {
		panic(err)
	}
	config.LoadServants(section)

	log.Debug("engine: %+v", *this.conf)
}
예제 #3
0
func setupConfig() *config.ConfigMongodb {
	cf, _ := conf.Load("../../etc/faed.cf")
	section, _ := cf.Section("servants")
	config.LoadServants(section)
	return config.Servants.Mongodb
}
예제 #4
0
func setupServant() *FunServantImpl {
	cf, _ := conf.Load("../etc/faed.cf")
	section, _ := cf.Section("servants")
	config.LoadServants(section)
	return NewFunServant(config.Servants)
}