Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 418 Bytes

README.md

File metadata and controls

25 lines (17 loc) · 418 Bytes

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