common

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2019 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Routes = lib.Routes{
	lib.Route{
		Method:      "OPTIONS",
		HandlerFunc: optionsHandler,
	},

	lib.Route{
		Name:        "versions",
		Method:      "GET",
		Path:        "/versions",
		HandlerFunc: VersionsHandler,
	},

	lib.Route{
		Name:        "healthcheck",
		Method:      "GET",
		Path:        "/health",
		HandlerFunc: HealthCheck,
	},

	lib.Route{
		Name:        "swagger.json",
		Method:      "GET",
		Path:        "/swagger.json",
		HandlerFunc: SwaggerJSON,
	},
}

Routes are routes that are common for all versions

Functions

func HealthCheck

func HealthCheck(ctx lib.ReqContext, w http.ResponseWriter, r *http.Request)

HealthCheck is an httpHandler for route GET /health

func Metrics

func Metrics(ctx lib.ReqContext, w http.ResponseWriter, r *http.Request)

Metrics returns data collected by util/metrics

func SwaggerJSON

func SwaggerJSON(ctx lib.ReqContext, w http.ResponseWriter, r *http.Request)

SwaggerJSON is an httpHandler for route GET /swagger.json

func VersionsHandler

func VersionsHandler(ctx lib.ReqContext, w http.ResponseWriter, r *http.Request)

VersionsHandler is an httpHandler for route GET /versions

Types

type VersionsResponse

type VersionsResponse struct {
	// in: body
	Body common.Version
}

VersionsResponse is the response to 'GET /versions'

swagger:response VersionsResponse

func (VersionsResponse) GetError

func (r VersionsResponse) GetError() error

GetError allows VersionResponse to satisfy the APIV1Response interface, even though it can never return an error and is not versioned

Jump to

Keyboard shortcuts

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