package
0.0.16
Repository: https://github.com/forwardalex/ytool.git
Documentation: pkg.go.dev

# README

# Functions

ExponentialBackoff strategy is an optimization strategy with a retry time of 2**n milliseconds (n means number of times).
LimitRetry limits the number of retries to max attempts.
LinearBackoff allows retries regularly with customized intervals.
New creates a new Client instance with a custom namespace.
NewClient 推荐链接格式 &redis.Options{ Addr: "127.0.0.1:6379", Password: "hello", // no password set db: 0, // use default db PoolSize: 100, MinIdleConns: 50, } */.
NoRetry acquire the lock only once.
Obtain is a short-cut for New(...).Obtain(...).
TryLock exp(ttl time).

# Variables

ErrLockNotHeld is returned when trying to release an inactive lock.
ErrNotObtained is returned when a lock cannot be obtained.
No description provided by the author

# Structs

Client wraps a redis client.
Lock represents an obtained, distributed lock.
Options describe the options for the lock.
No description provided by the author

# Interfaces

RedisClient is a minimal client interface.
RetryStrategy allows to customise the lock retry strategy.

# Type aliases

No description provided by the author