Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fujiwara/consul-lock
runs another program with a Consul session/kv locked.
https://github.com/fujiwara/consul-lock
Last synced: about 1 month ago
JSON representation
runs another program with a Consul session/kv locked.
- Host: GitHub
- URL: https://github.com/fujiwara/consul-lock
- Owner: fujiwara
- License: mit
- Created: 2014-09-18T13:59:21.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-20T01:34:47.000Z (almost 10 years ago)
- Last Synced: 2024-10-11T21:12:38.414Z (2 months ago)
- Language: Go
- Size: 172 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-consul - consul-lock: Runs another program with a Consul session/kv locked.
README
# consul-lock
Like the setlock command using Consul session/kv.
This is a conceptual code, not for a production use.
Now, [Consul 0.5](https://hashicorp.com/blog/consul-0-5.html) provides `lock` command. I recommend use it.
## Repository
[github.com/fujiwara/consul-lock](https://github.com/fujiwara/consul-lock)
## Binary releases
[github.com/fujiwara/consul-lock/releases](https://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