service

package
v0.0.0-...-6637ac4 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2019 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCACertFile = errors.New("CACert file contained no certificates")

Functions

func RecordActiveHealthCheckContext

func RecordActiveHealthCheckContext(hcc *HealthCheckContext)

Types

type HealthCheckContext

type HealthCheckContext struct {
	ListenerName         string
	BuildNumber          string
	EnableHealthEndpoint bool
	// contains filtered or unexported fields
}

HealthCheckContext is a type that is used to supply the context needed to build the health check handler and to provide current health status

func ActiveHealthCheckContextForListener

func ActiveHealthCheckContextForListener(listenerName string) *HealthCheckContext

func BuildHealthContextForListener

func BuildHealthContextForListener(name string, kvs kvstore.KVStore) (*HealthCheckContext, error)

func (*HealthCheckContext) AddRouteContext

func (hcc *HealthCheckContext) AddRouteContext(r *route)

AddRouteContext adds the needed route context for performing the healthcheck

func (*HealthCheckContext) GetHealthStatus

func (hcc *HealthCheckContext) GetHealthStatus() *HealthResponse

Return current health status

func (*HealthCheckContext) HealthHandler

func (hcc *HealthCheckContext) HealthHandler() http.HandlerFunc

HealthHandler returns the handler for health checks

type HealthResponse

type HealthResponse struct {
	ListenerName string         `json:"listenerName"`
	BuildNumber  string         `json:"buildNumber"`
	Routes       []routeContext `json:"routes"`
}

HealthResponse is used to structure the json response payload for the health check

type Service

type Service interface {
	Run()
}

Service represents a runnable service

func BuildServiceForListener

func BuildServiceForListener(name string, address string, kvs kvstore.KVStore) (Service, error)

BuildServiceForListener builds a runnable service based on the given name, retrieving definitions using the supplied KVStore and listening on the supplied address.

Jump to

Keyboard shortcuts

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