Categorygithub.com/DoNewsCode/core-locks
modulepackage
0.0.2
Repository: https://github.com/donewscode/core-locks.git
Documentation: pkg.go.dev

# README

core-locks

It provides a LockManager based on the redis database, which implements a distributed locks that automatically renews the lease in a timely manner. The lease is attached to a TTL (time to live interval). When the server goes down or when the context is canceled, the locks created on top of the lease, will be gone with the lease.

# Functions

NewLockManager to new LockManager.
WithIDGenerator change the function that generates the lock check value.
WithLeaseTTL change LockManager's leaseTTL and can't be zero value.
WithPrefix change key prefix.

# Variables

No description provided by the author

# Structs

LockManager is based on the redis database and implements a distributed lock that automatically renews the lease in a timely manner.

# Type aliases

Option is the option to change LockManager behavior.