ready

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServiceStatusVerifier

func NewServiceStatusVerifier(s ServiceStatus, delegate http.Handler) http.Handler

NewServiceStatusVerifier is a http.Handler that checks if the service is ready to serve, and if so, chain the Delegate handler, otherwise call's the Error handler it returns an error

Types

type ServiceReadyVerifier

type ServiceReadyVerifier struct {
	Status   ServiceStatus
	Delegate http.Handler
	Error    http.Handler
}

ServiceReadyVerifier is a http.Handler that checks if the service is ready to serve, and if so, chain the Delegate handler, otherwise call's the Error handler

func (*ServiceReadyVerifier) ServeHTTP

func (c *ServiceReadyVerifier) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface

type ServiceStatus

type ServiceStatus interface {
	IsReady() bool
}

ServiceStatus specifies an interface to check if the service is ready to serve requests

Jump to

Keyboard shortcuts

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