Documentation
¶
Index ¶
- func GetLoggerFromContext(rq *http.Request, fallback *slog.Logger) *slog.Logger
- func NewHealth(log *slog.Logger, basePath string, healthChecks ...healthstatus.HealthCheck) (*restful.WebService, error)
- func NewVersion(name string, opts *VersionOpts) *restful.WebService
- func RequestLoggerFilter(logger *slog.Logger) restful.FilterFunction
- func UserAuth(ug security.UserGetter, fallbackLogger *slog.Logger) restful.FilterFunction
- type HealthResponse
- type Key
- type VersionOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLoggerFromContext ¶ added in v0.10.0
func NewHealth ¶
func NewHealth(log *slog.Logger, basePath string, healthChecks ...healthstatus.HealthCheck) (*restful.WebService, error)
NewHealth returns a webservice for healthchecks. All checks are executed and returned in a service health map.
func NewVersion ¶
func NewVersion(name string, opts *VersionOpts) *restful.WebService
NewVersion returns a webservice which returns version information. The given name should be a descriptive name of the module.
func RequestLoggerFilter ¶ added in v0.10.0
func RequestLoggerFilter(logger *slog.Logger) restful.FilterFunction
func UserAuth ¶
func UserAuth(ug security.UserGetter, fallbackLogger *slog.Logger) restful.FilterFunction
Types ¶
type HealthResponse ¶ added in v0.9.0
type HealthResponse struct { // Status indicates the overall health state. Status healthstatus.HealthStatus `json:"status"` // Message gives additional information on the overall health state. Message string `json:"message"` // Services contain the individual health results of the services as evaluated by the HealthCheck interface. The overall HealthStatus is then derived automatically from the results of the health checks. // // Note that the individual HealthResults evaluated by the HealthCheck interface may again consist of a plurality services. While this is only optional it allows for creating nested health structures. These can be used for more sophisticated scenarios like evaluating platform health describing service availability in different locations or similar. // // If using nested HealthResults, the status of the parent service can be derived automatically from the status of its children by leaving the parent's health status field blank. Services map[string]HealthResponse `json:"services,omitempty"` }
HealthResponse is returned by the API when executing a health check.
type VersionOpts ¶ added in v0.17.1
Click to show internal directories.
Click to hide internal directories.