lieutenant-api

command module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

README

Project Syn: Lieutenant API

Rest API to provide services like inventory, cluster registry, tenant management and GitOps helper.

Please note that this project is in it's early stages and under active development.

OpenAPI Spec

The API is specified in OpenAPI 3 format. It's available in the file openapi.yaml in the root folder of this project.

Development

API Versioning

There is no API versioning exposed. Internally the "API Evolution" approach is used which is described in this excellent blog post: API Versioning Has No "Right Way".

API Mocking

To test the API before writing actual code, API mocking can be used. One cool tool to do that is Prism. Example:

docker run --init --rm -p 4010:4010 -v $(pwd):/tmp stoplight/prism:3 mock -h 0.0.0.0 "/tmp/openapi.yaml"

curl http://localhost:4010/tenants
Code Generation

As the API spec is written with OpenAPI, the OpenAPI Generator is used to generate the Go boilerplate code.

Object Name Generation

Some API endpoints store data in Kubernetes objects. These objects must be named like this:

pwgen -A -B 6 1

Some good links which help with OpenAPI development:

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
api
Package api provides primitives to interact the openapi HTTP API.
Package api provides primitives to interact the openapi HTTP API.

Jump to

Keyboard shortcuts

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