locker

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Locker

type Locker struct {
	Values *common.Values
	Redis  *redis.Client
}

func (*Locker) Delete

func (x *Locker) Delete(ctx context.Context, name string) error

Delete 移除锁定

func (*Locker) Key

func (x *Locker) Key(name string) string

Key 锁定命名

func (*Locker) Update

func (x *Locker) Update(ctx context.Context, name string, ttl time.Duration) (err error)

Update 更新锁定

func (*Locker) Verify

func (x *Locker) Verify(ctx context.Context, name string, n int64) (result bool, err error)

Verify 校验锁定,True 为锁定

Jump to

Keyboard shortcuts

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