Documentation ¶
Overview ¶
Package consulapi for process cousul
Index ¶
- Variables
- func ConsulGlobalLock(client *api.Client, lockName string, waitLockTime 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 ReleaseGlobalLock(lock *api.Lock) error
- type ConsulServInstS
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrConsulWatchKeyNotExist = errors.New("watch Key dos not exist") ErrConsulWatchExit = errors.New("watch exit") )
Functions ¶
func ConsulGlobalLock ¶
ConsulGlobalLock 获得全局锁 client: consul api对象 lockName: 锁名字 waitLockTime: 得到锁的等待时间,如果超时都没有获得,返回报错 "10s" "100ms",永久等待就用""
func ConsulGlobalSeq ¶
func ConsulSvrReg ¶
func ConsulWatchKey ¶
func ConsulWatchKey(client *api.Client, keyName string, stopCh chan struct{}, notifyCh chan interface{}) error
ConsulWatchKey 对一个key的监控
func ReleaseGlobalLock ¶
Types ¶
type ConsulServInstS ¶
func ConsulServDNS ¶
func ConsulServDNS(client *api.Client, servName string) ([]*ConsulServInstS, error)
ConsulServDNS 通过服务名,获取健康的服务实例列表
Source Files ¶
Click to show internal directories.
Click to hide internal directories.