xlock

package module
v0.0.0-...-713942b Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlashLock

func FlashLock(name string, duration time.Duration) bool

func HardLock

func HardLock(name string) (error, string)

func Init

func Init(conn *redis.Conn)

func Lock

func Lock(name string, duration time.Duration) (error, string)

func NewRedisConn

func NewRedisConn(conf RedisConfig)

func Unlock

func Unlock(name string, uid string) error

Types

type RedisClient

type RedisClient struct {
	redis.Conn
}
var (
	RedisConn RedisClient
)

type RedisConfig

type RedisConfig struct {
	Address  string `yaml:"address"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	DB       int    `yaml:"db"`
}

Jump to

Keyboard shortcuts

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