lock

package
v0.0.0-...-ba59bca Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: MIT Imports: 10 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 {
	Lock(name string, fire time.Time) bool
	Unlock(name string, fire time.Time) bool
}

func NewMongoLock

func NewMongoLock(s store.LockStore) Lock

func NewNullLock

func NewNullLock() Lock

func NewRedisLock

func NewRedisLock() Lock

type MongoLock

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

func (*MongoLock) Lock

func (l *MongoLock) Lock(name string, fire time.Time) bool

func (*MongoLock) Unlock

func (l *MongoLock) Unlock(name string, fire time.Time) bool

type NullLock

type NullLock struct {
}

NullLock is suitable for stand-alone mode.

func (NullLock) Lock

func (n NullLock) Lock(name string, fire time.Time) bool

func (NullLock) Unlock

func (n NullLock) Unlock(name string, fire time.Time) bool

type RedisLock

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

func (*RedisLock) Lock

func (l *RedisLock) Lock(name string, fire time.Time) bool

func (*RedisLock) Unlock

func (l *RedisLock) Unlock(name string, fire time.Time) bool

Jump to

Keyboard shortcuts

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