etcdv3

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Etcdv3Locker

type Etcdv3Locker struct {
	distlock.Store
	// contains filtered or unexported fields
}

func New

func New(addrs []string, opts ...Option) (*Etcdv3Locker, error)

func (*Etcdv3Locker) Close

func (s *Etcdv3Locker) Close()

func (*Etcdv3Locker) Delete

func (s *Etcdv3Locker) Delete(lockKey *distlock.LockKey)

func (*Etcdv3Locker) Exists

func (s *Etcdv3Locker) Exists(lockKey *distlock.LockKey) bool

func (*Etcdv3Locker) Get

func (s *Etcdv3Locker) Get(lockKey *distlock.LockKey) string

func (*Etcdv3Locker) Keep

func (s *Etcdv3Locker) Keep(lockKey *distlock.LockKey, val string, expire time.Duration)

func (*Etcdv3Locker) Set

func (s *Etcdv3Locker) Set(lockKey *distlock.LockKey, val string, expire time.Duration)

func (*Etcdv3Locker) SetIfAbsent

func (s *Etcdv3Locker) SetIfAbsent(lockKey *distlock.LockKey, val string, expire time.Duration) bool

type Option

type Option func(cfg *etcdv3LockerConfig)

func WithCredential

func WithCredential(username, password string) Option

func WithPrefix

func WithPrefix(prefix string) Option

func WithTTL

func WithTTL(sec int) Option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL