Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
README.md 6.17 KiB

gomazon

Getting Started

Start without Docker Compose:

Wait a few seconds after the Database is up! (Database uses Docker)

./scripts/start-mariadb.sh
cd src/gomazon && go run main.go

To close the Database use:

./scripts/stop-mariadb.sh

Build, Start and Stop service using Docker Compose

docker compose build
docker compose up
docker compose down

Technical Highlights

This service does not use Gorilla as framework. Here will be Gin-Gonic used. Gin is the most popular framework used by Golang-Developers. It is an extremely fast web framework and it suits the requirements of developers when they create microservices and web applications. (https://github.com/gin-gonic/gin)

All API Functions

In this section all API-Functions will be presented with an example call!

BASIC FUNCTIONS

This section contains all basic Functions.

GET JWT-Token

Use the Result-Token for all marked API-Functions! This Token contains the Username and an isAdmin-Flag(true or false). All Token-required Functions extract these information from the Token-String. One Token is valid for 30 minutes!

curl --location --request GET 'localhost:8080/createJWT' \
--header 'Content-Type: application/json' \
--data '{
    "username": "user",
    "isAdmin": true
}'

Health Check

Function tests if the service is running.