Пример #1
0
func ListIPGroups() (groups []string, err error) {
	groups, _, err = Zk.VisibleChildren(helper.GetBaseIPGroupPath())
	if err != nil {
		log.Printf("Error getting list of ip groups. Error: %s.", err.Error())
	}
	if groups == nil {
		log.Println("No ip groups found. Returning empty list.")
		groups = []string{}
	}
	return
}
Пример #2
0
func (zig *ZkIPGroup) path() string {
	return helper.GetBaseIPGroupPath(zig.Name)
}
Пример #3
0
func GetIPGroup(name string) (zig *ZkIPGroup, err error) {
	zig = &ZkIPGroup{}
	err = getJson(helper.GetBaseIPGroupPath(name), zig)
	return
}