From 306883c2b617a9730ddaa8ce9dd7ea0166bcb06e Mon Sep 17 00:00:00 2001 From: nitwhiz Date: Fri, 2 Feb 2024 21:18:15 +0100 Subject: [PATCH] add README --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 29c2b2e..f5a48e3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,28 @@ # omnilock -A zero dependency lock manager +A zero dependency locker. + +## How does it work? + +This locker uses TCP connections to keep track of locks. +This way, a lock is freed as soon as the locking process ends (some way or another) or it's unlocked explicitly. + +## Protocol + +1. Open a TCP connection to the omnilock server +2. Send a lock command through the established connection (e.g. `lock my_lock`) +3. Read the response, it may be either `success`, `failed` or `error: something went wrong` +4. Do your things on the client side +5. Either unlock the lock explicitly: `unlock my_lock` or just let the process exit so the OS closes the connection + +Note: All commands and responses end with `\n` (newline). + +## Usage as docker image + +Start the server with: + +```shell +docker run --rm -it -p 7194:7194 ghcr.io/nitwhiz/omnilock:lastest +``` + +And connect to it via port 7194.