dlock

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDLock

func InitDLock(rc *RootConfig)

Types

type LockObj

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

func Lock

func Lock(lockKey string, ttl, wait int) (bool, *LockObj)

Lock 加锁 ttl锁租期,内部会自动续期,发生异常后在ttl秒后自动释放 wait等待锁时间

func (LockObj) UnLock

func (o LockObj) UnLock()

type RootConfig

type RootConfig struct {
	Cluster []string `yaml:"dlock"`
}

func NewConfig

func NewConfig() *RootConfig

Jump to

Keyboard shortcuts

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