lock

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapLock

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

字典锁:一个锁的集合

var (
	MapLockApp MapLock
)

func (MapLock) Demo

func (MapLock) Demo()

func (*MapLock) Destroy

func (r *MapLock) Destroy(key string)

Destroy 删除锁

func (*MapLock) DestroyAll

func (r *MapLock) DestroyAll()

DestroyAll 删除所有锁

func (*MapLock) Lock

func (r *MapLock) Lock(key string, timeout time.Duration) (*itemLock, error)

Lock 获取锁

func (MapLock) New

func (MapLock) New() *MapLock

New 实例化:字典锁

func (MapLock) Once added in v1.0.3

func (MapLock) Once() *MapLock

SingleMapLock 单例化:字典锁

func (*MapLock) Store

func (r *MapLock) Store(key string, val any) error

Store 创建锁

func (*MapLock) StoreMany

func (r *MapLock) StoreMany(items map[string]any) error

StoreMany 批量创建锁

func (*MapLock) Try

func (r *MapLock) Try(key string) error

Try 尝试获取锁

Jump to

Keyboard shortcuts

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