microservice-template

module
v0.0.0-...-34d2590 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT

README

Microservice-Template

Template for microservices.

This template can be used to create another microservice without having to write any of the boilerplate code.

Product endpoints

GET /products Returns json data about every product.

GET /products/{id} Returns json data about a specific product. id=[string]

GET /health/live Returns a Status OK when live.

GET /health/ready Returns a Status OK when ready or an error when dependencies are not available.

POST /products Add new product with specific data.
Data Params

{
  "name":        "string, required",
  "sku":         "string, required",
  "description": "string",
  "price":       "float",
}

PUT /products Update product data
Data Params

{
  "id":          "string, required",
  "name":        "string",
  "sku":         "string",
  "description": "string",
  "price":       "float",
}

DELETE /products/{id} Delete product. id=[string]

Fuzzing To start fuzzing, simply build and run:

$ cd pkg/fuzzing
$ go-fuzz-build
$ go-fuzz

This will generate and test inputs in an infinite loop. You need at least an initial input named "0" inside the corpus folder. For more information, refer to go-fuzz documentation.

Directories

Path Synopsis
cmd
pkg
log

Jump to

Keyboard shortcuts

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