bricks

module
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: MIT

README

PACE Bricks

Opinionated microservice kit to help developers to build microservices with go.

Opinions

A pace/bricks microservice is:

  • build as a docker container
  • deployed into a kubernetes cluster
  • configured using environment variables (TWELVE-FACTOR APP)
  • monitored using prometheus
  • reports errors to sentry
  • samples traces to jaeger
  • logs to stdout using json
  • offers health endpoints
  • connects to backend services with logging, metrics and tracing:
    • postgres (logging, metrics, tracing)
    • redis (logging, metrics, tracing)
    • http (logging, metrics, tracing, retries)
  • provides two commands control and daemon
  • provides a RESTful API
    • code is generated from the OpenAPIv3 spec
    • authenticated via OAuth2
    • encoded using json:api
    • that supports logging, tracing and metrics

Install

go get github.com/pace/bricks/cmd/pb

Usage

pb -h

Contributing

Read our contributors guide.

Requirements

  • A working go installation
  • A working git installation

Testing

  • Use make test to test without dependencies
  • Use docker-compose run bricks make integration to test with dependencies

Environment variables for the pb command

Variable Description
PACE_BRICKS_EDITOR   The path to the editor that should be used for opening a project. Defaults to $EDITOR.
PACE_BRICKS_PATH The path where new project should be created. Defaults to $HOME/PACE.

Directories

Path Synopsis
backend
postgres
Package postgres helps creating PostgreSQL connection pools
Package postgres helps creating PostgreSQL connection pools
redis
Package redis helps creating redis connection pools
Package redis helps creating redis connection pools
cmd
pb
Package http implements the basic pace microservice handlers and a standard microservice server configured via environment variables.
Package http implements the basic pace microservice handlers and a standard microservice server configured via environment variables.
jsonapi/generator
Package generator translates an OpenAPIv3 specification into working go code that handles marshalling, error handling, parameter parsing and validation.
Package generator translates an OpenAPIv3 specification into working go code that handles marshalling, error handling, parameter parsing and validation.
jsonapi/runtime
Package runtime contains functions for marshalling, error handling, parameter parsing and validation.
Package runtime contains functions for marshalling, error handling, parameter parsing and validation.
oauth2
Package oauth2 provides a middelware that introspects the auth token on behalf of PACE services and populate the request context with useful information when the token is valid, otherwise aborts the request.
Package oauth2 provides a middelware that introspects the auth token on behalf of PACE services and populate the request context with useful information when the token is valid, otherwise aborts the request.
internal
maintenance
health
Package health implements simple checks for readiness and liveness that will be invoked by the loadbalancer frequently
Package health implements simple checks for readiness and liveness that will be invoked by the loadbalancer frequently
log
metric
Package metric returns the prometheus metrics handler
Package metric returns the prometheus metrics handler
metric/jsonapi
Package jsonapi implements the json api related metrics documented here: https://lab.jamit.de/pace/web/meta/wikis/concept/metrics#m2-microservice-any-pace-microservice
Package jsonapi implements the json api related metrics documented here: https://lab.jamit.de/pace/web/meta/wikis/concept/metrics#m2-microservice-any-pace-microservice
terminationlog
Package terminationlog helps to fill the kubernetes termination log.
Package terminationlog helps to fill the kubernetes termination log.
pkg
synctx
Package synctx implements helpers for the context package on top of the sync package.
Package synctx implements helpers for the context package on top of the sync package.
test
livetest
Package livetest implements a set of helpers that ease writing of a sidecar that tests the functions of a service.
Package livetest implements a set of helpers that ease writing of a sidecar that tests the functions of a service.
tools

Jump to

Keyboard shortcuts

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