Documentation ¶
Index ¶
Constants ¶
View Source
const ( // RedisLockKey redis lock key RedisLockKey = "gole:redis:lock:%s" // EtcdLockKey etcd lock key EtcdLockKey = "/gole/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 ¶
func NewEtcdLock(client *v3.Client, key string, opts ...concurrency.SessionOption) (mutex *EtcdLock, err error)
NewEtcdLock create a etcd lock
type Lock ¶
type Lock interface { Lock(ctx context.Context, timeout time.Duration) (bool, error) Unlock(ctx context.Context) (bool, error) }
Lock define common func
Click to show internal directories.
Click to hide internal directories.