http

package
v0.0.0-...-d5bad45 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LivenessHandler

func LivenessHandler(service string) func(w http.ResponseWriter, r *http.Request)

LivenessHandler returns ok response for liveness probe

Types

type Response

type Response struct {
	HTTPStatusCode int    `json:"-"`                // http response status code
	StatusText     string `json:"status,omitempty"` // user-level status message
	ErrorText      string `json:"error,omitempty"`  // application-level error message, for debugging
}

Response defines HTTP response structure

func ErrResponse

func ErrResponse(status int, err string) *Response

ErrResponse returns Response struct with provided HTTP status code and error text

func (*Response) Render

func (e *Response) Render(_ http.ResponseWriter, r *http.Request) error

Render renders a response

Jump to

Keyboard shortcuts

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