Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 427 Bytes

README.md

File metadata and controls

25 lines (18 loc) · 427 Bytes

etcd-sync

An etcd-based sync module, aiming at implementing the Go sync pkg over etcd for cluster-wide synchronization.

Installation

go get github.com/leeor/etcd-sync

Usage

At this time, only a simple mutex has been implemented.

EtcdMutex

mutex := NewMutexFromServers([]string{"http://127.0.0.1:4001"}, key, 0)
mutex.Lock()
// do some critical stuff
mutex.Unlock()