mutex

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMaster

func IsMaster() bool

Types

type ClusterMutex

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

ClusterMutex 集群互斥锁

func NewClusterMutex

func NewClusterMutex(ctx context.Context, cli *redis.Client, name string) *ClusterMutex

NewClusterMutex .

func (*ClusterMutex) IsMaster

func (m *ClusterMutex) IsMaster() bool

IsMaster 是否是主节点

type RedisLocker

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

RedisLocker .

func NewRedisLocker

func NewRedisLocker(rds *redis.Client, name string, timeout time.Duration) *RedisLocker

NewRedisLocker TODO

func (*RedisLocker) Lock

func (l *RedisLocker) Lock()

Lock .

func (*RedisLocker) Unlock

func (l *RedisLocker) Unlock()

Unlock .

Jump to

Keyboard shortcuts

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