middleware

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHealthCheckMW

func NewHealthCheckMW(basePath string, checker HealthChecker) alice.Constructor

NewHealthCheckMW creates a new health check middleware at the specified path

Types

type HealthCheck

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

HealthCheck is a middleware that serves healthcheck information

func NewHealthCheck

func NewHealthCheck(basePath string, checker HealthChecker, next http.Handler) *HealthCheck

NewHealthCheck creates a new health check middleware at the specified path

func (*HealthCheck) ServeHTTP

func (h *HealthCheck) ServeHTTP(rw http.ResponseWriter, r *http.Request)

ServeHTTP is the middleware interface implementation

type HealthChecker

type HealthChecker func() error

HealthChecker is executed to verify health of the service.

Jump to

Keyboard shortcuts

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