distlock

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConsul

func InitConsul(centerAddr string)

Types

type ConsulLock

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

func NewConsulLock

func NewConsulLock(key string, expire int) (*ConsulLock, error)

func (*ConsulLock) Lock

func (l *ConsulLock) Lock(ctx context.Context, timeout int) bool

func (*ConsulLock) Unlock

func (l *ConsulLock) Unlock()

type DistLock

type DistLock interface {
	Lock(timeout int) bool
	Unlock()
}

type RdsLuaLock

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

func NewRdsLuaLock

func NewRdsLuaLock(dbKey, key string, expire int) (*RdsLuaLock, error)

func (*RdsLuaLock) Lock

func (l *RdsLuaLock) Lock(ctx context.Context, timeout int) bool

func (*RdsLuaLock) TryLock

func (l *RdsLuaLock) TryLock(ctx context.Context) bool

func (*RdsLuaLock) Unlock

func (l *RdsLuaLock) Unlock(ctx context.Context)

Jump to

Keyboard shortcuts

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