MCPcopy Create free account

hub / github.com/alexliesenfeld/health / functions

Functions122 in github.com/alexliesenfeld/health

↓ 19 callersFunctionNewChecker
NewChecker creates a new Checker. The provided options will be used to modify its configuration. If the Checker was not yet started (see Checker.IsSta
config.go:59
↓ 13 callersFunctionWithCheck
WithCheck adds a new health check that contributes to the overall service availability status. This check will be triggered each time Checker.Check is
config.go:164
↓ 12 callersFunctionNewHandler
NewHandler creates a new health check http.Handler.
handler.go:67
↓ 7 callersFunctionWithPeriodicCheck
WithPeriodicCheck adds a new health check that contributes to the overall service availability status. The health check will be performed on a fixed s
config.go:185
↓ 7 callersFunctionWithTimeout
WithTimeout defines a timeout duration for all checks. You can override this timeout by using the timeout value in the Check configuration. Default va
config.go:85
↓ 6 callersFunctiondoTestEvaluateAvailabilityStatus
( t *testing.T, expectedStatus AvailabilityStatus, maxTimeInError time.Duration, maxFails uint, state Che
check_test.go:34
↓ 5 callersFunctionWithStatusListener
WithStatusListener registers a listener function that will be called whenever the overall/aggregated system health status changes (e.g. from "up" to "
config.go:94
↓ 4 callersMethodCheck
Check runs all synchronous (i.e., non-periodic) check functions. It returns the aggregated health status (combined from the results of this executions
check.go:60
↓ 4 callersFunctionWithCacheDuration
WithCacheDuration sets the duration for how long the aggregated health check result will be cached. By default, the cache TTL (i.e, the duration for h
config.go:154
↓ 4 callersFunctiongetLogger
(ctx context.Context)
examples/hooks/main.go:86
↓ 3 callersFunctionBasicLogger
BasicLogger is a basic logger that is mostly used to showcase this library.
interceptors/logging.go:11
↓ 3 callersMethodGetRunningPeriodicCheckCount
GetRunningPeriodicCheckCount returns the number of currently running periodic checks.
check.go:63
↓ 3 callersFunctionWithChecks
WithChecks adds a list of health checks that contribute to the overall service availability status. These checks will be triggered each time Checker.C
config.go:172
↓ 3 callersFunctionWithDisabledAutostart
WithDisabledAutostart disables automatic startup of a Checker instance.
config.go:136
↓ 3 callersFunctionWithMiddleware
WithMiddleware configures a middleware that will be used by the handler to pro- and post-process HTTP requests and health checks. Refer to the documen
config.go:103
↓ 3 callersFunctionaggregateStatus
(results map[string]CheckState)
check.go:548
↓ 3 callersFunctiondoTestCheckerCheckFunc
(t *testing.T, updateInterval time.Duration, err error, expectedStatus AvailabilityStatus)
check_test.go:116
↓ 3 callersFunctiondoTestHandler
(t *testing.T, statusCodeUp, statusCodeDown int, expectedStatus CheckerResult, expectedStatusCode int)
handler_test.go:50
↓ 2 callersMethodIsStarted
IsStarted returns true, if the Checker was started (see Checker.Start) and is currently still running. Returns false otherwise.
check.go:66
↓ 2 callersMethodStart
Start will start all necessary background workers and prepare the checker for further usage.
check.go:50
↓ 2 callersMethodStop
Stop stops will stop the checker.
check.go:52
↓ 2 callersFunctionWithDisabledCache
WithDisabledCache disabled the check cache. This is not recommended in most cases. This will effectively lead to a health endpoint that initiates a ne
config.go:146
↓ 2 callersFunctionWithDisabledDetails
WithDisabledDetails disables all data in the JSON response body. The AvailabilityStatus will be the only content. Example: { "status":"down" }. Enable
config.go:76
↓ 2 callersFunctionWithInfo
WithInfo sets values that will be available in every health check result. For example, you can use this option if you want to set information about yo
config.go:207
↓ 2 callersFunctionWithInterceptors
WithInterceptors adds a list of interceptors that will be applied to every check function. Interceptors may intercept the function call and do some pr
config.go:196
↓ 2 callersFunctionWithResultWriter
WithResultWriter is responsible for writing a health check result (see CheckerResult) into an HTTP response. By default, JSONResultWriter will be used
config.go:129
↓ 2 callersFunctionWithStatusCodeDown
WithStatusCodeDown sets an HTTP status code that will be used for responses where the system is considered to be unavailable ("down"). Default is HTTP
config.go:121
↓ 2 callersFunctionWithStatusCodeUp
WithStatusCodeUp sets an HTTP status code that will be used for responses where the system is considered to be available ("up"). Default is HTTP statu
config.go:112
↓ 2 callersMethodWrite
Write writes a CheckerResult into a http.ResponseWriter in a format that the ResultWriter supports (such as XML, JSON, etc.). A ResultWriter is expect
handler.go:41
↓ 2 callersMethodcriticality
()
check.go:184
↓ 2 callersFunctionevaluateCheckStatus
(state *CheckState, maxTimeInError time.Duration, maxFails uint)
check.go:529
↓ 2 callersFunctionexecuteCheck
( ctx context.Context, cfg *checkerConfig, check *Check, oldState CheckState, )
check.go:447
↓ 2 callersFunctionisPeriodicCheck
(check *Check)
check.go:420
↓ 2 callersFunctionsetLogger
(ctx context.Context, logger *log.Entry)
examples/hooks/main.go:82
↓ 2 callersMethodupdateState
(ctx context.Context, updates ...checkResult)
check.go:381
↓ 2 callersFunctionwaitForStopSignal
(ctx context.Context, waitTime time.Duration)
check.go:424
↓ 2 callersFunctionwithCheckContext
(ctx context.Context, check *Check, f func(checkCtx context.Context))
check.go:438
↓ 1 callersFunctionBasicAuth
BasicAuth is a middleware that removes check details (such as service names, error messages, etc.) from the HTTP response on authentication failure. A
middleware/auth.go:19
↓ 1 callersFunctionBasicLogger
BasicLogger is a basic logger that is mostly used to showcase this library.
middleware/logging.go:11
↓ 1 callersMethodCheck
Check implements Checker.Check. Please refer to Checker.Check for more information.
check.go:267
↓ 1 callersFunctionCustomAuth
CustomAuth is a middleware that removes check details (such as service names, error messages, etc.) from the HTTP response on authentication failure.
middleware/auth.go:37
↓ 1 callersFunctionFullDetailsOnQueryParam
FullDetailsOnQueryParam is a middleware that removes check details (such as service names, error messages, etc.) from the HTTP response unless the req
middleware/filter.go:11
↓ 1 callersFunctionNewJSONResultWriter
NewJSONResultWriter creates a new instance of a JSONResultWriter.
handler.go:62
↓ 1 callersMethodStart
Start implements Checker.Start. Please refer to Checker.Start for more information.
check.go:218
↓ 1 callersFunctionWithInfoFunc
WithInfoFunc sets functions that compute values to be added to every health check result. It works similarly to WithInfo, but allows dynamic computati
config.go:221
↓ 1 callersFunctioncreateConfig
(options []HandlerOption)
handler.go:97
↓ 1 callersFunctioncreateInfoMap
(infoMap map[string]interface{}, infoFuncs []func(map[string]interface{}))
check.go:570
↓ 1 callersFunctioncreateNextCheckState
(result error, check *Check, state CheckState)
check.go:510
↓ 1 callersFunctiondisableResponseCache
(w http.ResponseWriter)
handler.go:83
↓ 1 callersFunctionexecuteCheckFunc
(ctx context.Context, check *Check)
check.go:478
↓ 1 callersFunctionisCacheExpired
(cacheDuration time.Duration, state *CheckState)
check.go:416
↓ 1 callersFunctionmapHTTPStatusCode
(status AvailabilityStatus, statusCodeUp int, statusCodeDown int)
handler.go:90
↓ 1 callersMethodmapStateToCheckerResult
()
check.go:394
↓ 1 callersFunctionnewChecker
(cfg checkerConfig)
check.go:199
↓ 1 callersMethodrunSynchronousChecks
(ctx context.Context)
check.go:279
↓ 1 callersMethodstartPeriodicChecks
(ctx context.Context)
check.go:315
↓ 1 callersFunctionvolatileFunc
()
examples/listeners/main.go:66
↓ 1 callersFunctionvolatileFunc
()
examples/showcase/main.go:148
↓ 1 callersFunctionwithInterceptors
(interceptors []Interceptor, target InterceptorFunc)
check.go:560
↓ 1 callersFunctionwithMiddleware
(interceptors []Middleware, target MiddlewareFunc)
handler.go:115
MethodCheck
(ctx context.Context)
handler_test.go:30
MethodGetRunningPeriodicCheckCount
GetRunningPeriodicCheckCount implements Checker.GetRunningPeriodicCheckCount. Please refer to Checker.GetRunningPeriodicCheckCount for more informatio
check.go:253
MethodGetRunningPeriodicCheckCount
()
handler_test.go:34
MethodIsStarted
IsStarted implements Checker.IsStarted. Please refer to Checker.IsStarted for more information.
check.go:260
MethodIsStarted
()
handler_test.go:38
MethodMarshalJSON
MarshalJSON provides a custom marshaller for the CheckResult type.
check.go:155
MethodStart
()
handler_test.go:22
MethodStop
Stop implements Checker.Stop. Please refer to Checker.Stop for more information.
check.go:240
MethodStop
()
handler_test.go:26
FunctionTestCheckSuccessNotAllChecksExecutedYet
(t *testing.T)
check_test.go:154
FunctionTestCheckerAutostartConfig
(t *testing.T)
config_test.go:195
FunctionTestCheckerAutostartDisabledConfig
(t *testing.T)
config_test.go:203
FunctionTestHandlerIfAuthFailsThenReturnNoDetails
(t *testing.T)
handler_test.go:100
FunctionTestHandlerIfCheckFailThenRespondWithNotAvailable
(t *testing.T)
handler_test.go:77
FunctionTestHandlerIfCheckSucceedsThenRespondWithAvailable
(t *testing.T)
handler_test.go:89
FunctionTestNewCheckerWithDefaults
(t *testing.T)
config_test.go:180
FunctionTestNewWithDefaults
(t *testing.T)
config_test.go:165
FunctionTestPanicRecovery
(t *testing.T)
check_test.go:158
FunctionTestStartStopManualPeriodicChecks
(t *testing.T)
check_test.go:97
FunctionTestStatusDownBeforeStatusUnknown
(t *testing.T)
check_test.go:23
FunctionTestStatusUnknownBeforeStatusUp
(t *testing.T)
check_test.go:12
FunctionTestWhenChecksEmptyThenHandlerResultContainNoChecksMap
(t *testing.T)
handler_test.go:110
FunctionTestWhenChecksExecutedThenAggregatedResultUp
(t *testing.T)
check_test.go:146
FunctionTestWhenErrorAndAllThresholdsCrossedThenStatusDown
(t *testing.T)
check_test.go:87
FunctionTestWhenErrorAndMaxFailuresThresholdNotCrossedThenStatusWarn
(t *testing.T)
check_test.go:67
FunctionTestWhenErrorAndMaxTimeInErrorThresholdNotCrossedThenStatusWarn
(t *testing.T)
check_test.go:77
FunctionTestWhenErrorThenStatusDown
(t *testing.T)
check_test.go:60
FunctionTestWhenNoChecksMadeYetThenStatusUnknown
(t *testing.T)
check_test.go:48
FunctionTestWhenNoErrorThenStatusUp
(t *testing.T)
check_test.go:54
FunctionTestWhenOneCheckFailedThenAggregatedResultDown
(t *testing.T)
check_test.go:150
FunctionTestWithCacheDurationConfig
(t *testing.T)
config_test.go:63
FunctionTestWithCheckConfig
(t *testing.T)
config_test.go:30
FunctionTestWithChecks
(t *testing.T)
config_test.go:211
FunctionTestWithChecksConfig
(t *testing.T)
config_test.go:44
FunctionTestWithDisabledCacheConfig
(t *testing.T)
config_test.go:75
FunctionTestWithDisabledDetailsConfig
(t *testing.T)
config_test.go:97
FunctionTestWithInterceptorConfig
(t *testing.T)
config_test.go:124
FunctionTestWithMiddlewareConfig
(t *testing.T)
config_test.go:108
FunctionTestWithPeriodicCheckConfig
(t *testing.T)
config_test.go:14
FunctionTestWithResultWriterConfig
(t *testing.T)
config_test.go:140
next →1–100 of 122, ranked by callers