From 906fe39e39e56a03e3978a56a1b2ce86b3d32904 Mon Sep 17 00:00:00 2001 From: Joop Schilder Date: Sat, 20 Jun 2020 18:29:09 +0200 Subject: [PATCH] Add 'README.md' --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..d65ec26 --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# `zmq-fileserver` + +This is a simple fileserver written in PHP (7.4+) using [ZeroMQ](https://zeromq.org/). + +There are three executable files: + +- `$ ./server` runs the fileserver +- `$ ./command ...` sends a command to the server +- `$ ./query ...` sends a query to the server and returns the response + +## Commands + +- `SAVE ` saves a file +- `DELETE ` deletes a file if it exists +- `DELETE_ALL ` deletes an entire namespace + +To save a file to the fileserver you can do: +`$ ./command SAVE my-project-namespace 1.html "..."` +`$ ./command SAVE my-project-namespace 2.xml "$(cat some/xml/file)"` + + +## Queries + +- `CONTAINS ` returns `Y` if the file exists in the namespace, else `N` +- `LOAD ` returns the file contents if it exists, else `-1` + +To load a file from the fileserver you can do: +`$ ./query LOAD my-project-namespace 1.html` +