Documentation ¶
Index ¶
- func Call() *clientv3.Client
- func KeyValueGet(key string) (string, error)
- func KeyValuePut(key string, value string) error
- func KeyValuePutWithTTL(key string, value string, ttl int64) error
- func KeyValueWatch(ctx context.Context, key string) <-chan KvWatchRsq
- func ServiceConnect(endpoints []string) error
- func ServiceDelete(id InstanceID) error
- func ServiceDisconnect()
- func ServiceLock(ctx context.Context, name string) error
- func ServiceLockInit() error
- func ServiceStatusUpdate(id InstanceID, status int) error
- func ServiceUnlock(ctx context.Context, name string) error
- func ServiceWatch(name string) <-chan SvcWatchRsq
- func TimestampGet() string
- func UUID() string
- type Connect
- type EVENT_TYPE
- type Instance
- type InstanceCtrl
- type InstanceID
- type KeyValue
- type KvWatchRsq
- type Service
- type ServiceMap
- type SvcWatchRsq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeyValueGet ¶
func KeyValuePut ¶
func KeyValueWatch ¶
func KeyValueWatch(ctx context.Context, key string) <-chan KvWatchRsq
func ServiceConnect ¶
func ServiceDelete ¶
func ServiceDelete(id InstanceID) error
func ServiceDisconnect ¶
func ServiceDisconnect()
func ServiceLockInit ¶
func ServiceLockInit() error
func ServiceStatusUpdate ¶
func ServiceStatusUpdate(id InstanceID, status int) error
func ServiceWatch ¶
func ServiceWatch(name string) <-chan SvcWatchRsq
func TimestampGet ¶
func TimestampGet() string
Types ¶
type EVENT_TYPE ¶
type EVENT_TYPE int
const ( EVENT_ADD EVENT_TYPE EVENT_UPDATE EVENT_DELETE EVENT_EXPIRE )
type Instance ¶
type Instance struct { ID InstanceID `json:"instanceid"` Timestamp string `json:"timestamp"` Endpoints []string `json:"endpoints"` Status int `json:"status"` // contains filtered or unexported fields }
func ServiceQuery ¶
type InstanceCtrl ¶
type InstanceID ¶
type InstanceID string
func NewInstanceID ¶
func NewInstanceID() InstanceID
func ServcieRegister ¶
func ServcieRegister(name string, endpoints []string) (InstanceID, error)
type KeyValue ¶
func KeyValueGetWithChild ¶
type KvWatchRsq ¶
type KvWatchRsq struct { Act EVENT_TYPE Key string Value string }
type ServiceMap ¶
type SvcWatchRsq ¶
type SvcWatchRsq struct { Act EVENT_TYPE Name string Inst Instance }
Click to show internal directories.
Click to hide internal directories.