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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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