Skip to content

Commit

Permalink
Minor cleanup of README
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Balogh <[email protected]>
  • Loading branch information
javaducky committed Jan 20, 2024
1 parent 1ee3888 commit 3d0cd7c
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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.

Expand Down Expand Up @@ -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"

Expand All @@ -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

Expand All @@ -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%:
```
Expand Down

0 comments on commit 3d0cd7c

Please sign in to comment.