zk

package
v0.0.0-...-13c8884 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

zk配置,需要外部进行初始化

读取并监听zk节点中数据

读取并监听zk节点子节点中数据

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddZkNodeParser

func AddZkNodeParser(path string, parser NodeParser)

func AddZkParser

func AddZkParser(path string, parser Parser)

func GetZkEnvKey

func GetZkEnvKey(env string) (string, bool)

func GetZkHostPorts

func GetZkHostPorts(key string) []string

func GetZkServers

func GetZkServers(key string) ([]string, bool)

func LoadZkDatasW

func LoadZkDatasW(servers []string, recvTimeout time.Duration)

func LoadZkNodesW

func LoadZkNodesW(servers []string, recvTimeout time.Duration)

func SetZkEnvKey

func SetZkEnvKey(env, key string)

func SetZkServers

func SetZkServers(key string, servers []string)

Types

type IZkStat

type IZkStat interface {
	Stat(stat *zk.Stat)
}

type NodeParser

type NodeParser interface {
	Parser      // 解析并保存数据
	ResetData() // 清理数据
}

//////////////////////////////////////////////////////////////////////////////

type Parser

type Parser interface {
	Unmarshal(data []byte) (interface{}, error) // 解析并保存数据
}

//////////////////////////////////////////////////////////////////////////////

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL