Documentation ¶
Index ¶
Constants ¶
View Source
const ( // RedisLockKey redis lock key RedisLockKey = "eagle:redis:lock:%s" // EtcdLockKey etcd lock key EtcdLockKey = "/eagle/lock/%s" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EtcdLock ¶
type EtcdLock struct {
// contains filtered or unexported fields
}
EtcdLock define a etcd lock
func NewEtcdLock ¶
NewEtcdLock create a etcd lock ttl for lease
type Lock ¶
type Lock interface { Lock(ctx context.Context) (bool, error) Unlock(ctx context.Context) (bool, error) }
Lock define common func
Click to show internal directories.
Click to hide internal directories.