Documentation ¶
Overview ¶
* @Author: calmwu * @Date: 2017-11-21 14:52:04 * @Last Modified by: calmwu * @Last Modified time: 2017-11-21 17:27:18 * @Comment:
Index ¶
- Variables
- func ConsulGlobalLock(client *api.Client, lockName string, watiLockTime string) (*api.Lock, error)
- func ConsulGlobalSeq(client *api.Client, seqName string, initSeqNum int, waitTime string) (int, error)
- func ConsulSvrReg(client *api.Client, servName string, servTags []string, servInstName string, ...) error
- func ConsulWatchKey(client *api.Client, keyName string, stopCh chan struct{}, ...) error
- func NewConsulClient(consulIP string) (*api.Client, error)
- func PostBaseRequstByConsulDns(interfaceName string, req *base.ProtoRequestS, client *api.Client, ...) (*base.ProtoResponseS, error)
- func PostRequstByConsulDns(uin uint64, interfaceName string, realReq interface{}, client *api.Client, ...) (*base.ProtoResponseS, error)
- func ReleaseGlobalLock(lock *api.Lock) error
- type ConsulServInstS
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ConsulWatchKeyNotExist = errors.New("Watch Key dos not exist") ConsulWatchExit = errors.New("Watch exit") )
Functions ¶
func ConsulGlobalLock ¶
client: consul api对象 lockName: 锁名字 watiLockTime: 得到锁的等待时间,如果超时都没有获得,返回报错 "10s" "100ms",永久等待就用""
func ConsulGlobalSeq ¶
func ConsulSvrReg ¶
func ConsulWatchKey ¶
func ConsulWatchKey(client *api.Client, keyName string, stopCh chan struct{}, notifyCh chan interface{}) error
对一个key的监控
func PostBaseRequstByConsulDns ¶
func PostBaseRequstByConsulDns(interfaceName string, req *base.ProtoRequestS, client *api.Client, svrName string) (*base.ProtoResponseS, error)
func PostRequstByConsulDns ¶
func ReleaseGlobalLock ¶
Types ¶
type ConsulServInstS ¶
func ConsulServDns ¶
func ConsulServDns(client *api.Client, servName string) ([]*ConsulServInstS, error)
通过服务名,获取健康的服务实例列表
Click to show internal directories.
Click to hide internal directories.