分布式锁 go版client
Install Ginga-Client-Go using the "go get" command:
go get github.com/FastSchnell/Ginga-Client-Go/ginga
import "Ginga-Client-Go/ginga"
func testLock() {
c := ginga.Client{
Token: "test_token",
Endpoint: "0.0.0.0:1903",
Nonce: "test_nonce",
}
err := c.Lock()
if err != nil {
fmt.Println(err.Error())
return
}
defer c.Unlock()
}
Ginga-Client-Go is available under the Apache License, Version 2.0.