Skip to content

fujiwara/consul-lock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

consul-lock

Like the setlock command using Consul session/kv.

This is a conceptual code, not for a production use.

Now, Consul 0.5 provides lock command. I recommend use it.

Repository

github.com/fujiwara/consul-lock

Binary releases

github.com/fujiwara/consul-lock/releases

Build & Install

Install to $GOPATH.

$ go get github.com/fujiwara/consul-lock

Usage

$ consul-lock [-nNxX] KEY program [ arg ... ]

-n: No delay. If KEY is locked by another process, consul-lock gives up.
-N: (Default.) Delay. If KEY is locked by another process, consul-lock waits until it can obtain a new lock.
-x: If KEY is locked, consul-lock exits zero.
-X: (Default.) If KEY is locked, consul-lock prints an error message and exits nonzero.
-lock-delay=15: Consul session LockDelay seconds

LICENSE

MIT

About

runs another program with a Consul session/kv locked.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published