From 3d0cd7c4c263f0bfc96a841822116db6d0a72966 Mon Sep 17 00:00:00 2001 From: Paul Balogh Date: Sat, 20 Jan 2024 11:26:38 -0600 Subject: [PATCH] Minor cleanup of README Signed-off-by: Paul Balogh --- README.md | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 089571c..91ab013 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # WeeSVC Gorilla -Implementation of the WeeSVC application using [Go](https://golang.org/) and the [Gorilla Mux](https://www.gorillatoolkit.org/pkg/mux) -web toolkit. +Implementation of the WeeSVC application using [Go](https://golang.org/) and the [Gorilla Mux](https://www.gorillatoolkit.org/pkg/mux) web toolkit. ## Ingredients The following external libraries were *directly* utilized in this project. @@ -17,41 +16,37 @@ The following external libraries were *directly* utilized in this project. | UUID | https://github.com/google/uuid | Implementation for generation of universally unique identifiers (UUIDs) | ## Build -Builds are performed using the `Makefile` provided in the project root. +Builds are performed using the `Makefile` provided in the project root. #### CLI -In order to build the CLI, you will need to have Go (1.17+) installed on your system. +In order to build the CLI, you will need to have Go (1.21+) installed on your system. The default target for the `Makefile` will perform several tasks: * organize imports using `goimports` * format code using `gofmt` -* perform linting using `golint` * vet code for errors using `go vet` * compile binary for the current platform :point_up: NOTE: To initially build the project, you may need to run the `make setup` command to install the tools utilized for builds. -Once built, you can **migrate** the database scripts and run the application: +Once built using `make`, you can **migrate** the database scripts and run the application: ```shell script bin/weesvc migrate; bin/weesvc serve ``` #### Docker -For those who do not have Go available, [Docker](https://hub.docker.com/) is an option to build the application and run -the application within a container. Using the `make build-docker` command will build the application within a Linux -container, then copy the resulting binary into a slim docker image to utilize for execution. +For those who do not have Go available, [Docker](https://hub.docker.com/) is an option to build the application and run the application within a container. +Using the `make build-docker` command will build the application within a Linux container, then copy the resulting binary into a slim docker image to utilize for execution. -Once the the image is available, you can simply run the provided script which will open a browser to access the service -at http://localhost:9092/api/hello . +Once the image is available, you can simply run the provided script which will open a browser to access the service at http://localhost:9092/api/hello . ```shell script ./docker-run.sh ``` -:point_up: NOTE: the `docker-run.sh` script is setup to **not** maintain state between executions. This means each -time you start the container, you will be starting with a freshly created database. +:point_up: NOTE: the `docker-run.sh` script is setup to **not** maintain state between executions. +This means each time you start the container, you will be starting with a freshly created database. ## Using the Application -Update the `DatabaseURI` setting in your `config.yaml` for the absolute path to the base project directory, -i.e. the path for the directory containing this README. +Update the `DatabaseURI` setting in your `config.yaml` for the absolute path to the base project directory, i.e. the path for the directory containing this README. :point_up: TIP: Use the very cool [HTTPie](https://httpie.org/) application for testing locally from the command-line. @@ -100,7 +95,8 @@ Date: Sat, 25 Jan 2020 05:34:18 GMT } ] ``` -Use the `PATCH` command to update a specific value. For example we'll update the `Description` as follows: +Use the `PATCH` command to update a specific value. +For example, we'll update the `Description` as follows: ```shell script $ http PATCH :9092/api/places/1 description="Lake St. Louis" @@ -119,7 +115,8 @@ Date: Sat, 25 Jan 2020 18:13:13 GMT "updated_at": "2020-01-25T12:13:13.351201-06:00" } ``` -This returns the newly "patched" version of the _place_. Next we'll remove the row using the `DELETE` method. +This returns the newly "patched" version of the _place_. +Next we'll remove the row using the `DELETE` method. ```shell script $ http DELETE :9092/api/places/1 @@ -134,7 +131,8 @@ Date: Sat, 25 Jan 2020 18:15:16 GMT ``` ## API Compliance -A core requirement for all _WeeSVC_ implementations is to implement the same API which are utilized for benchmark comparisons. To ensure compliance with the required API, [k6](https://k6.io/) is utilized within the [Workbench](https://github.com/weesvc/workbench) project. +A core requirement for all _WeeSVC_ implementations is to implement the same API which are utilized for benchmark comparisons. +To ensure compliance with the required API, [k6](https://k6.io/) is utilized within the [Workbench](https://github.com/weesvc/workbench) project. To be a valid service, the following command MUST pass at 100%: ```