dlock

module
v0.1.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2024 License: MIT

README

dlock

Yet another distibuted lock based on the Raft consensus algorithm

Running dlock

git clone git@github.com:kgantsov/dlock.git
cd dlock/cmd/server
go build -o dlock

Run the first node

./dlock -id node0 ./data/node0

Run other nodes

./dlock -id node1 -haddr 11001 -raddr localhost:12001 -join :11000 ./data/node1
./dlock -id node2 -haddr 11002 -raddr localhost:12002 -join :11000 ./data/node2

You can find swagger docs by opening http://localhost:11000/docs

To acquire a lock run

curl --request POST \
  --url http://localhost:11000/API/v1/locks/my-lock-name \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json'

To release a lock run

curl --request DELETE \
  --url http://localhost:11000/API/v1/locks/my-lock-name \
  --header 'Accept: application/json'

Directories

Path Synopsis
cmd
Package store provides a simple distributed key-value store.
Package store provides a simple distributed key-value store.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL