Skip to content

keepchen/corgi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

corgi

Go CodeQL Go Report Card
A distributed lock via redis written in Go.

Requirement

go version >= 1.19

Installation

go get -u github.com/keepchen/corgi

Features

  • Lock
  • Unlock
  • Renewal automatically

Examples

Initialization

corgi.SetRedisProviderStandalone(...)

//or
corgi.SetRedisProviderCluster(...)

//or
corgi.SetRedisProviderFailOver(...)

//or
corgi.SetRedisProviderClient(...)

//or
corgi.SetRedisProviderClusterClient(...)

Lock

corgi.Wakeup().TryLock(ctx, key)

Unlock

corgi.Wakeup().Unlock(ctx, key)

Release

corgi.Asleep()

About

A distributed lock via redis written in Go.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages