A distributed lock via redis written in Go.
go version >= 1.19
go get -u github.com/keepchen/corgi
- Lock
- Unlock
- Renewal automatically
corgi.SetRedisProviderStandalone(...)
//or
corgi.SetRedisProviderCluster(...)
//or
corgi.SetRedisProviderFailOver(...)
//or
corgi.SetRedisProviderClient(...)
//or
corgi.SetRedisProviderClusterClient(...)
corgi.Wakeup().TryLock(ctx, key)
corgi.Wakeup().Unlock(ctx, key)
corgi.Asleep()