Categorygithub.com/armory-io/go-spec
modulepackage
0.1.0
Repository: https://github.com/armory-io/go-spec.git
Documentation: pkg.go.dev

# README

go-spec

go-spec aims to provide a framework for making our Go applications behave like Spinnaker's Spring based applications from an operational standpoint. The goal is to provide the least amount of boilerplate needed to bootstrap an application.

This framework provides developers with:

  1. A preconfigured logger to use throughout your application
  2. Metrics, exposed in the way we need.
  3. A web server that uses a common TLS configuration.

Libraries used by this framework:

  1. gorilla/mux
  2. go-eden/slf4go
  3. armon/go-metrics

Components

Logger

TODO

Metrics

A universal metrics interface is supplied by armon/go-metrics and the framework handles surfacing them as necessary.

Web Server

Applications using this framework will be supplied with a web server (provided by armory/go-yaml-tools/server) that will be started and managed by the application. Users can configure the application's host/port via the following config block:

server:
  host: 0.0.0.0
  port: 3000

Any routes attached to the context's router will be instrumented with HTTP request metrics by default.

Example

Example usage can be found in the examples directory.

TODO

[] Settle on log package. Temporary one is in place for now. [] Add more common, useful metrics

# Packages

No description provided by the author
No description provided by the author

# Functions

NewApplicationContext provides all of the common utilities needed to make building an observable application simple.
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
DefaultURIMapperFunc returns the RequestURI from the URL.
No description provided by the author

# Structs

ApplicationContextConfig is used to supply the ApplicationContext with properties about the application.
No description provided by the author
No description provided by the author
ServerConfig is used to extract configuration information about how the webserver should be configured.

# Type aliases

URIMapperFunc is used by RequestMetricsMiddleware to map requests URIs to their parametrized counterpart.