Documentation ¶
Index ¶
- Constants
- func NewHealth(log *zap.Logger, basePath string, h ...HealthCheck) *restful.WebService
- func NewVersion(name string, basePath string) *restful.WebService
- func RequestLogger(debug bool, logger *zap.Logger) restful.FilterFunction
- func UserAuth(ug security.UserGetter) restful.FilterFunction
- type HealthCheck
- type HealthStatus
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
func UserAuth ¶
func UserAuth(ug security.UserGetter) restful.FilterFunction
Types ¶
type HealthCheck ¶
type HealthCheck func() error
HealthCheck is a normal function which returns an error if something is not correct.
Click to show internal directories.
Click to hide internal directories.