Skip to content

4vn/dlock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DLock GoDoc

Distributed lock using redis

Import

import "github.com/4vn/dlock"

Usage

l := dlock.New("127.0.0.1:6379")
if lockId, err := l.Lock("user1", 100*time.Millisecond); err != nil {
	log.Println("Lock failed")
}
defer l.Unlock("user1", lockId)

// Do something

License

MIT