routes

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 6 Imported by: 0

README

Routes

Routes is a Go module for adding the common routes to an existing handler.
At the moment those routes consist of:

  • /health
  • /version

These endpoints are for readiness and liveness as well as telling us what version of the code is running at any given time.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommonRoutes

func AddCommonRoutes(router *mux.Router, buildInfo Config, interfacesForExpansion ...interface{}) (readyFn server.UpdateFn, livenessFn server.UpdateFn)

Calling this from when setting up the router will add these common endpoints. Readiness and liveness update functions returned.

func HealthHandler

func HealthHandler(rw http.ResponseWriter, _ *http.Request)

Add here all default behaviour for all/most routes

func VersionHandler

func VersionHandler(v, c, bn, e string, interfacesForExpansion ...interface{}) http.HandlerFunc

Types

type Config

type Config struct {
	Version     string
	Commit      string
	BuildStamp  string
	BuildNumber string
	Env         string
}

Jump to

Keyboard shortcuts

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