bricks: github.com/pace/bricks/http Index | Files | Directories

package http

import "github.com/pace/bricks/http"

Package http implements the basic pace microservice handlers and a standard microservice server configured via environment variables.

Index

Package Files

doc.go metrics.go middleware.go router.go server.go

func Environment Uses

func Environment() string

Environment returns the name of the current server environment

func JsonApiErrorWriterMiddleware Uses

func JsonApiErrorWriterMiddleware(next http.Handler) http.Handler

JsonApiErrorWriterMiddleware is a middleware that wraps http.ResponseWriter such that it forces responses with status codes 4xx/5xx to have Content-Type: application/vnd.api+json

func Router Uses

func Router() *mux.Router

Router returns the default microservice endpoints for health, metrics and debugging

func Server Uses

func Server(handler http.Handler) *http.Server

Server returns a http.Server configured using environment variables, following https://12factor.net/.

Directories

PathSynopsis
jsonapiPackage jsonapi provides a serializer and deserializer for jsonapi.org spec payloads.
jsonapi/generatorPackage generator translates an OpenAPIv3 specification into working go code that handles marshalling, error handling, parameter parsing and validation.
jsonapi/runtimePackage runtime contains functions for marshalling, error handling, parameter parsing and validation.
oauth2Package 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.
oauth2/middleware
oidc
security
security/apikey
transport

Package http imports 18 packages (graph). Updated 2020-08-06. Refresh now. Tools for package owners.