From 668a2b64d04d98dbdedb14a4b8ce11ff27b2679d Mon Sep 17 00:00:00 2001 From: "Pablo M. Bermudo Garay" Date: Thu, 10 Feb 2022 12:50:10 +0100 Subject: Add Makefile and expand README --- Makefile | 20 ++++++++++++++++++++ README.md | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c45bb2f --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +# Simple go Makefile + +.PHONY : all +all: build + +.PHONY: build +build: clean + go build + +.PHONY: run +run: + go run -race main.go + +.PHONY: clean +clean: + go clean + +.PHONY: test +test: + go test -v -count=1 -race ./... diff --git a/README.md b/README.md index a41d042..bbe4192 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,39 @@ # Storehouse: Object storage HTTP server +Storehouse is a simple HTTP service to store text objects organized by buckets, +written in Go. +The service has two backends: one stores the objects in-memory, the other uses +files for persistence. + +The in-memory backend features a proactive de-duplication mechanism that avoids +the creation of objects with duplicate content inside the same bucket. + +## Building Storehouse + +Simply run `make` or `go build` in the root directory. + +## Usage + +The options are displayed with -h/--help: + +``` +$ ./storehouse -h +Usage of ./storehouse: + -datadir string + The directory where the objects are stored with the file backend (default "data") + -memory + Memory backend with de-duplication (default: file backend w/o de-dup) + -port int + The port on which the server will listen for connections (default 8080) +``` + +## Potential improvements + +* More and better tests, including integration and e2e tests. + +* Implementation of the de-duplication mechanism for the file backend. + +* Better logging, using a log package instead of printf. + +* ... -- cgit v1.2.3-70-g09d2