Documentation ¶
Index ¶
- Constants
- func DelLock(key string) error
- func Delete(key string, opts ...clientv3.OpOption) (*clientv3.DeleteResponse, error)
- func Get(key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error)
- func GetLock(key string, id clientv3.LeaseID) (bool, error)
- func Grant(ttl int64) (*clientv3.LeaseGrantResponse, error)
- func IsValidAsKeyPath(s string) bool
- func NewEtcdTimeoutContext() (context.Context, context.CancelFunc)
- func Put(key, val string, opts ...clientv3.OpOption) (*clientv3.PutResponse, error)
- func PutWithModRev(key, val string, rev int64) (*clientv3.PutResponse, error)
- func PutWithTtl(key, val string, ttl int64) (*clientv3.PutResponse, error)
- func Revoke(id clientv3.LeaseID) (*clientv3.LeaseRevokeResponse, error)
- func Watch(key string, opts ...clientv3.OpOption) clientv3.WatchChan
- type Client
- type ServerReg
- type Watcher
Constants ¶
View Source
const ( //key /crony/node/<node_uuid> KeyEtcdNodeProfile = keyEtcdProfile + "node/" KeyEtcdNode = KeyEtcdNodeProfile + "%s" //key /crony/proc/<node_uuid>/<job_id>/<pid> KeyEtcdProcProfile = keyEtcdProfile + "proc/" KeyEtcdNodeProcProfile = KeyEtcdProcProfile + "%s/" KeyEtcdJobProcProfile = KeyEtcdNodeProcProfile + "%d/" KeyEtcdProc = KeyEtcdJobProcProfile + "%d" //key /crony/job/<node_uuid>/<job_id> KeyEtcdJobProfile = keyEtcdProfile + "job/%s/" KeyEtcdJob = KeyEtcdJobProfile + "%d" // key /crony/once/<jobID> KeyEtcdOnceProfile = keyEtcdProfile + "once/" KeyEtcdOnce = KeyEtcdOnceProfile + "%d" KeyEtcdLockProfile = keyEtcdProfile + "lock/" KeyEtcdLock = KeyEtcdLockProfile + "%s" // key /crony/system/<node_uuid> KeyEtcdSystemProfile = keyEtcdProfile + "system/" KeyEtcdSystemSwitch = KeyEtcdSystemProfile + "switch/" + "%s" KeyEtcdSystemGet = KeyEtcdSystemProfile + "get/" + "%s" )
Variables ¶
This section is empty.
Functions ¶
func IsValidAsKeyPath ¶
func NewEtcdTimeoutContext ¶
func NewEtcdTimeoutContext() (context.Context, context.CancelFunc)
NewEtcdTimeoutContext return a new etcdTimeoutContext
func PutWithModRev ¶
func PutWithModRev(key, val string, rev int64) (*clientv3.PutResponse, error)
func PutWithTtl ¶
func PutWithTtl(key, val string, ttl int64) (*clientv3.PutResponse, error)
Types ¶
type Client ¶
func GetEtcdClient ¶
func GetEtcdClient() *Client
type ServerReg ¶
type ServerReg struct { Client *Client //time-to-live Ttl int64 // contains filtered or unexported fields }
func NewServerReg ¶
func (*ServerReg) RevokeLease ¶
Click to show internal directories.
Click to hide internal directories.