endpoints

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGetHandler

func NewGetHandler(storage backends.Backend, metrics *metrics.Metrics, allowCustomKeys bool) func(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

NewGetHandler returns the handle function for the "/cache" endpoint when it receives a GET request

func NewIndexHandler

func NewIndexHandler(message string) func(http.ResponseWriter, *http.Request, httprouter.Params)

NewIndexHandler returns the default '/' route handle function

func NewPutHandler

func NewPutHandler(storage backends.Backend, metrics *metrics.Metrics, maxNumValues int, allowKeys bool) func(http.ResponseWriter, *http.Request, httprouter.Params)

NewPutHandler returns the handle function for the "/cache" endpoint when it receives a POST request

func NewStatusEndpoint

func NewStatusEndpoint(response string) httprouter.Handle

NewStatusEndpoint returns a handler which writes the given response when the app is ready to serve requests.

func NewVersionEndpoint

func NewVersionEndpoint(version, revision string) func(http.ResponseWriter, *http.Request, httprouter.Params)

NewVersionEndpoint returns the latest git tag as the version and commit hash as the revision from which the binary was built

Types

type GetHandler

type GetHandler struct {
	// contains filtered or unexported fields
}

GetHandler serves "GET /cache" requests.

type PutHandler

type PutHandler struct {
	// contains filtered or unexported fields
}

PutHandler serves "POST /cache" requests.

type PutResponse

type PutResponse struct {
	Responses []putResponseObject `json:"responses"`
}

PutResponse will be marshaled to be written into the http response

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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