示例#1
0
func ParseAuthServerConfig(jsonObject json.JSONObject) *AuthServerConfig {
	a := new(AuthServerConfig)
	port_ok, port := jsonObject.GetInt("port")
	if port_ok {
		a.Port = port
	}
	return a
}
func PaserRouteServerConfig(jsonObject json.JSONObject) *RouteServerConfig {
	r := new(RouteServerConfig)

	port_ok, port := jsonObject.GetInt("port")
	if port_ok {
		r.Port = port
	}

	return r
}
func ParseConnectionServerConfig(jsonObject json.JSONObject) (bool, *ConnectionServerConfig) {
	config := new(ConnectionServerConfig)

	port_ok, port := jsonObject.GetInt("port")
	if port_ok {
		config.Port = port
	}
	route_ok, route := jsonObject.GetString("route_address")
	if route_ok {
		config.RouteAddress = route
	}
	auth_ok, auth := jsonObject.GetString("auth_address")
	if auth_ok {
		config.AuthAddress = auth
	}

	return true, config
}