go-service-template

command module
v0.0.0-...-7adb35c Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: MIT Imports: 2 Imported by: 0

README

go-service-template

Build Status Go Report Card

An example Go service.

👷♀ this is a personal experiment and is not meant to be used as an example of how to create production services in Go.

Features

HTTP API

An HTTP API that uses gorilla/mux. It comes with the following built-ins:

  • a /_system/health health endpoint;
  • automatic deserialization of opentracing headers on incoming requests, if present. The trace ID, Span ID and parent ID are automatically added to all following logs;
  • automatic log decoration with the route name and HTTP method;
  • (optional) automatic JWT token verification. Note that this does not block requests, only passed authentication information down to the next handler.
Logs

Automatically registers a uber/zap logger and exposes it via logging.GetLogger(ctx). Your logs will contain the fields described above.

Tracing

Automatically creates an opentracing Tracer.

Metrics

HTTP endpoints are automatically timed and reported on.

Additional metrics can be added via the Prometheus client.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
app
internal
api

Jump to

Keyboard shortcuts

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