lock

package
v1.57.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APP struct {
	MapLock MapLock
}

Functions

This section is empty.

Types

type MapLock

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

MapLock 字典锁:一个锁的集合

func (*MapLock) Destroy

func (*MapLock) Destroy(key string)

Destroy 删除锁

func (*MapLock) DestroyAll

func (*MapLock) DestroyAll()

DestroyAll 删除所有锁

func (*MapLock) Lock

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

Lock 加锁

func (*MapLock) New

func (*MapLock) New() MapLocker

func (*MapLock) Once

func (*MapLock) Once() MapLocker

func (*MapLock) Set

func (*MapLock) Set(key string, val any) error

Set 创建锁

func (*MapLock) SetMany

func (*MapLock) SetMany(items map[string]any) (err error)

SetMany 批量创建锁

func (*MapLock) Try

func (*MapLock) Try(key string) error

Try 尝试获取锁

type MapLocker

type MapLocker interface {
	New() MapLocker
	Once() MapLocker
	Set(key string, val any) error
	SetMany(items map[string]any) error
	Destroy(key string)
	DestroyAll()
	Lock(key string, timeout time.Duration) (*itemLock, error)
	Try(key string) error
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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