probe

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package probe contains facilities for asserting the readiness of a multi-tenant receive adapter.

Index

Constants

View Source
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

type AdapterReadyChecker struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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

type ReadinessChecker interface {
	IsReady() (bool, error)
}

ReadinessChecker can assert the readiness of a component.

Jump to

Keyboard shortcuts

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