示例#1
0
// SyncServices synchronizes all services into zookeeper
func SyncServices(conn client.Connection, services []service.Service) error {
	nodes := make([]zzk.Node, len(services))
	for i := range services {
		nodes[i] = &ServiceNode{Service: &services[i]}
	}
	return zzk.Sync(conn, nodes, servicepath())
}
示例#2
0
func SyncVirtualIPs(conn client.Connection, virtualIPs []pool.VirtualIP) error {
	nodes := make([]zzk.Node, len(virtualIPs))
	for i := range virtualIPs {
		nodes[i] = &VirtualIPNode{VirtualIP: &virtualIPs[i]}
	}
	return zzk.Sync(conn, nodes, vippath())
}
示例#3
0
func SyncResourcePools(conn client.Connection, pools []pool.ResourcePool) error {
	nodes := make([]zzk.Node, len(pools))
	for i := range pools {
		nodes[i] = &PoolNode{ResourcePool: &pools[i]}
	}
	return zzk.Sync(conn, nodes, poolpath())
}