fujiwara / consul-lock

runs another program with a Consul session/kv locked.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

License:MIT License


Languages

Language:Go 95.5%Language:Makefile 4.5%