- Create a text file with some contents stored in a given path.
- Retrieve the contents of a text file under the given path.
- Replace the contents of a text file.
- Delete the resource that is stored under a given path.
It also allows to get some statistics per folder basis and retrieve them through another entry point.
- Total number of files in that folder.
- Average number of alphanumeric characters per text file (and standard deviation) in that folder.
- Average word length (and standard deviation) in that folder.
- Total number of bytes stored in that folder.
- Note: All these computations must be calculated recursively from the provided path to the entry point.
Before build the project, install Testify and Echo
go get -u github.com/labstack/echo/...
go get github.com/stretchr/testify
go build .
go test -v ./...
Server started on localhost:1323
go run .
docker build -t webservice .
docker run webservice /app/webservice_linux_amd64
Customise the parameters in docker-compose.yml before running commands below
docker build -t webservice .
docker-compose up