Documentation
¶
Overview ¶
Package probe contains facilities for asserting the readiness of a multi-tenant receive adapter.
Index ¶
Constants ¶
const EndpointPath = "/health"
EndpointPath is the recommended URL path of the health endpoint to serve a ReadinessChecker over HTTP.
Variables ¶
This section is empty.
Functions ¶
func ReadinessCheckerHTTPHandler ¶
func ReadinessCheckerHTTPHandler(c ReadinessChecker) http.Handler
ReadinessCheckerHTTPHandler returns a http.Handler which executes the given ReadinessChecker.
Types ¶
type AdapterReadyChecker ¶
AdapterReadyChecker asserts the readiness of a receive adapter.
func NewAdapterReadyChecker ¶
func NewAdapterReadyChecker(ls listersv1alpha1.AWSSNSSourceLister, r *router.Router) *AdapterReadyChecker
NewAdapterReadyChecker returns an AdapterReadyChecker initialized with the given Lister and Router.
func (*AdapterReadyChecker) IsReady ¶
func (c *AdapterReadyChecker) IsReady() (bool, error)
IsReady implements ReadinessChecker. It checks whether the adapter has registered a handler for all observed sources.
NOTE(antoineco): we might want to revisit this in the future, because the following implementation details are currently leaking into this ReadinessChecker implementation:
- The fact that the adapter exposes a health endpoint via the HTTP router. - The exact URL path of this health endpoint. - The fact that a handler isn't registered for sources which don't have a valid sink.
We consider this tight coupling acceptable for the time being, because this is a sub-package of the main adapter package for the SNS source specifically.
type ReadinessChecker ¶
ReadinessChecker can assert the readiness of a component.