MCPcopy
hub / github.com/dunglas/mercure / TransportHealthChecker

Interface TransportHealthChecker

transport.go:48–59  ·  view source on GitHub ↗

TransportHealthChecker may be implemented by transports that support health checking. Transports that do not implement this interface are assumed to always be healthy.

Source from the content-addressed store, hash-verified

46// TransportHealthChecker may be implemented by transports that support health checking.
47// Transports that do not implement this interface are assumed to always be healthy.
48type TransportHealthChecker interface {
49 // Ready reports whether the transport can currently serve traffic.
50 // Returns nil if healthy, or an error describing the problem.
51 // This is typically used for readiness probes (e.g. Kubernetes).
52 Ready(ctx context.Context) error
53
54 // Live reports whether the transport is fundamentally operational.
55 // Returns nil if alive, or an error if the transport has been unhealthy
56 // for an extended period and should be restarted.
57 // This is typically used for liveness probes (e.g. Kubernetes).
58 Live(ctx context.Context) error
59}
60
61// ErrClosedTransport is returned by the Transport's Dispatch and AddSubscriber methods after a call to Close.
62var ErrClosedTransport = errors.New("hub: read/write on closed Transport")

Callers 4

AddSubscriberMethod · 0.65
AddSubscriberMethod · 0.65
checkTransportsMethod · 0.65
checkTransportsMethod · 0.65

Implementers 1

failingTransportcaddy/health_test.go

Calls

no outgoing calls

Tested by

no test coverage detected