terrible-api

module
v0.0.0-...-7a76d2e Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0

README

terrible-api

Note that this repo is used as a bad example. If nobody told you to use it, don't!

It is intended to let you create cuddly monsters using the REST API.

It stores the monsters you created in-memory. To reset, restart the process.

Running the API on you kind cluster

make all

You should have a running pod and a service of type ClusterIP

kubectl get all -nterrible
NAME                                       READY   STATUS    RESTARTS   AGE
pod/terrible-deployment-6d857954d9-pljvx   1/1     Running   0          15s

NAME                       TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
service/terrible-service   ClusterIP   10.96.59.201   <none>        8080/TCP   15s

NAME                                  READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/terrible-deployment   1/1     1            1           15s

NAME                                             DESIRED   CURRENT   READY   AGE
replicaset.apps/terrible-deployment-6d857954d9   1         1         1       15s

To remove:

make clean

Using the service

The service uses basic auth. The username is admin and the password secret.

The example/main.go file shows how to work with the API. Yes, it is bad!

Notes on the service

Creating a monster takes some time, and the job will run in the background.

Directories

Path Synopsis
api
business
foundation
web

Jump to

Keyboard shortcuts

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