distributelock

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lock

type Lock interface {
	Unlock() error
}

type Redis

type Redis struct {
	// contains filtered or unexported fields
}

func (*Redis) ObtainLock

func (r *Redis) ObtainLock(key string, duration time.Duration) (Lock, error)

type RedisConfig

type RedisConfig struct {
	Address  string
	Password string
}

type RedisLock

type RedisLock struct {
	// contains filtered or unexported fields
}

func (*RedisLock) Unlock

func (l *RedisLock) Unlock() error

type RemoteStorage

type RemoteStorage interface {
	ObtainLock(key string, duration time.Duration) (Lock, error)
}

func NewRedisStorage

func NewRedisStorage(cfg *RedisConfig) RemoteStorage

Jump to

Keyboard shortcuts

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