package nt

/// 定义 zookeeper 中路径

type ZkPaths struct {
	Namespace                                                         string
	Root                                                              string
	App                                                               string
	Agents, HTTP, Lobbies, Logics                                     string
	Misc 															  string
	Conf                                                              string
	Channels, Checkin7, ClientAddrs, Games, GameTask, Kv, Vip, Wallet string
	Turntable string
	Login, Mq, Redis                                                  string
}

func GetZkPaths(namespace string) *ZkPaths {
	p := &ZkPaths{}
	p.Namespace = namespace
	p.Root = "/" + namespace

	p.App = p.Root + "/app"
	p.Agents = p.App + "/agents"
	p.HTTP = p.App + "/http"
	p.Lobbies = p.App + "/lobbies"
	p.Logics = p.App + "/logics"
	p.Misc = p.App + "/misc"

	p.Conf = p.Root + "/conf"
	p.Channels = p.Conf + "/channels"
	p.Checkin7 = p.Conf + "/checkin7"
	p.ClientAddrs = p.Conf + "/clientaddrs"
	p.Games = p.Conf + "/games"
	p.GameTask = p.Conf + "/gametask"
	p.Kv = p.Conf + "/kv"
	p.Vip = p.Conf + "/vip"
	p.Wallet = p.Conf + "/wallet"
	p.Turntable = p.Conf + "/turntable"

	servers := p.Conf + "/servers"
	p.Login = servers + "/login"
	p.Mq = servers + "/mq"
	p.Redis = servers + "/redis"
	return p
}
