mutex

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mutex

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

func New

func New(rdb *redis.Client, options *Options) *Mutex

func (*Mutex) Lock

func (t *Mutex) Lock(name string) error

lock,超出

func (*Mutex) Unlock

func (t *Mutex) Unlock(name string) error

type Options

type Options struct {
	// 轮询间隔,ms
	Interval *time.Duration
	// redis key 前缀
	// @default mutex.
	Prefix *string
	// 锁超时时间
	// default 10s
	Timeout *time.Duration
}

Jump to

Keyboard shortcuts

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