cmvpbe

package module
v0.0.0-...-8fb0787 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 0 Imported by: 0

README

Simple project example

Httptest usage for api tests examples: link

Dockertest usage for db tests examples: link

Docker:

Docker must be started on your machine to allow dockertest spawn containers.

You can skip dockertest test-cases with -short flag for tests or through env var settings.

Example command:

go test ./... -count=1 -v -short

Scripts:

to get local env run: ./scripts/local-setup.sh link

to get docker-based env run: ./scripts/docker-setup.sh link

Load tests:

You can run some load tests using wrk

To create items in db use POST method like:

wrk "http://localhost:8080/api/v1/items" -s ./examples/post_binary.lua --latency -t 5 -c 10 -d 10

To update items in db use PUT method like:

wrk "http://localhost:8080/api/v1/items/1" -s ./examples/put_binary.lua --latency -t 5 -c 10 -d 10``

Else you can use CURL like:

curl -X PUT -v --location "http://localhost:8080/api/v1/items/450" \
-H "Content-Type: application/json" \
-d "{\"status\": \"CREATED\"}"

Once app is correctly setup, after item create request, you should see log like this:

curl -X POST -v --location "http://localhost:8080/api/v1/items"

alt text

Documentation

Overview

Package cmvpbe is an examples of go project arch this file is placed here for pre-commit static vet checks

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL