rest

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// HealthStatusHealthy is returned when the service is healthy
	HealthStatusHealthy = "healthy"
	// HealthStatusUnhealthy is returned when the service is not healthy
	HealthStatusUnhealthy = "unhealthy"
)

Variables

This section is empty.

Functions

func NewHealth

func NewHealth(log *zap.Logger, basePath string, h ...HealthCheck) *restful.WebService

NewHealth returns a webservice for healthchecks. All checks are executed until one returns an error or all of them succeed. If no healthcheck is given, a default check will be executed.

func NewVersion

func NewVersion(name string, basePath string) *restful.WebService

NewVersion returns a webservice which returns version information. The given name should be a descriptive name of the module.

func RequestLogger

func RequestLogger(debug bool, logger *zap.Logger) restful.FilterFunction

Types

type HealthCheck

type HealthCheck func() error

HealthCheck is a normal function which returns an error if something is not correct.

type HealthStatus

type HealthStatus string

HealthStatus indicates the health of a webservice.

Jump to

Keyboard shortcuts

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