Documentation
¶
Index ¶
- Constants
- Variables
- func Difference(slice1, slice2 []string) []string
- func GetIPPos(workers []string, worker string) int
- func GetLocalIp() string
- func GetWorkerIdByWorkerIp(workerIp string) string
- func GetWorkerIpByWorkerId(workerId string) string
- func IPToWorkerFormat(IP string, port int64) string
- func IPTopicNode() string
- func IPTopicsNode(ip string) string
- func IPTopicsNodeWithPort(ip string, port int64) string
- func IPTopicsNodeWithPortV2(ipPortStr string) string
- func InetAtoN(ip string) int64
- func InetNtoA(ip int64) string
- func Intersect(slice1, slice2 []string) []string
- func Ip2long(ipstr string) uint32
- func LockChildNode(childNodeName string) string
- func LockNode() string
- func Long2ip(ipLong uint32) string
- func Md5V(str string) string
- func OpenFile(fileName string) *os.File
- func ParseIntParam(form url.Values, keys ...string) int
- func ParseStringParam(form url.Values, keys ...string) string
- func RootNode() string
- func ServiceRegisterChildNode(serviceName string, ip string, port int64) string
- func ServiceRegisterChildNodeV2(serviceName string, ipPortStr string) string
- func ServiceRegisterNode(serviceName string) string
- func TmpCenterNode() string
- func TmpReceiveNode() string
- func TmpWorkerNode() string
- func TopicCenterNode(ip string, port int64) string
- func TopicNode(topic string) string
- func TopicWorkerNode(ip string, port int64) string
- func TopicWorkerNodeV2(ipPortStr string) string
- func Union(slice1, slice2 []string) []string
- func Wait() os.Signal
- func WorkerIPPortFormat(workers []string, port int64) []string
- type Client
- type Response
Constants ¶
View Source
const ( SUCCESS = 200 SYSTEM_ERROR = 500 INVALID_PARAMS = 401 INVALID_TOPIC_NAME = 402 INVALID_SERVICE_NAME = 403 MSG_NUM_LIMIT = 404 MSG_NOT_EXIST = 405 INCORRECT_ACCOUNT_OR_PASSWORD = 406 DELAY_TIME_EXCEEDS_THE_LIMIT = 501 )
View Source
const ( WORKER_SERVICE = "worker" CENTER_SERVICE = "center" RECEIVE_SERVICE = "receive" ADMIN_SERVICE = "admin" ALL_SERVICE = "all" WORKER_ADDRESS_CACHE_KEY = "workers" CENTER_ADDRESS_CACHE_KEY = "centers" KAFKA_TOPIC_PATH = "/brokers/topics" )
Variables ¶
View Source
var RespMsg = map[int]string{
200: "success",
500: "system error",
401: "invalid params",
402: "topic name cannot be set [admin/center/worker/receive/lock/iptopic]",
403: "service name can be only [admin/center/worker/receive/all]",
404: "maximum num of messages is limit 500",
405: "msg is not exist",
406: "login failed, incorrect account or password",
501: "the longest delay time is 7 days",
}
Functions ¶
func GetLocalIp ¶
func GetLocalIp() string
func GetWorkerIdByWorkerIp ¶
func GetWorkerIpByWorkerId ¶
func IPToWorkerFormat ¶
func IPTopicNode ¶
func IPTopicNode() string
func IPTopicsNodeWithPort ¶
zk IP节点存储关联的topic 带端口
func IPTopicsNodeWithPortV2 ¶
func ServiceRegisterNode ¶
func TopicWorkerNodeV2 ¶
func WorkerIPPortFormat ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.