fleet-rest-skeleton

command module
v0.0.0-...-d4f0681 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

README

What is this?

This is a small service that exposes a toy RESTful API. It is intended to be a template or example for how we write this sort of code in FleetServices. It also contains example configuration for other useful things such as:

  1. Creating a Docker image
  2. Launching the service image into our sandbox environment. See the helm directory.
  3. Typical pull-request workflow (linting, building, code-analysis)
  4. Creating a release image of the software for deployment to Kubernetes.

How do I use it?

That depends on what you want to do.

  • You can clone this repo as a template service, make your modifications, and push it to a new repo on Github.com.
  • You can get a sense of how we handle common tasks (like using gin or zap) without being overwhelmed by details of a non-trivial service.
  • You can propose new conventions (such as adding a client for NATS or FleetDB)
  • You can launch this service into our kind sandbox by doing helm install skeleton-test helm from the root of this repo. Port-forward to your local environment to test the API by hand, or configure service-to-service tests with other services in kind.

Much of the functionality is encapsulated into Makefile targets. On the one hand this is a pretty clear abuse of make, but on the other we do it in many other repositories. make will tab-prompt the user with potential targets (e.g. build, image, push-sandbox-image et al.)

I hope it serves to reduce the friction of getting a service into production for you.

Documentation

Overview

Copyright © 2024 Equinix Metal toolbox authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
cmd
internal
app
pkg

Jump to

Keyboard shortcuts

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