redis

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInstance

func GetInstance(opt ...cfg) *goRedis.Client

func Lock

func Lock(key string, ttl time.Duration, flag string) (bool, error)

Lock attempts to acquire a lock with the given key and a time to live. flag is a unique identifier for the locking process.

It returns true if the lock is acquired, false otherwise.

func UnLock

func UnLock(key string, flag string) (bool, error)

UnLock releases a shared lock

If flag is not empty, it first checks if it's the lock owner before releasing it, preventing the lock from being released by an unauthorized process.

Types

This section is empty.

Jump to

Keyboard shortcuts

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