TransportHealthChecker may be implemented by transports that support health checking. Transports that do not implement this interface are assumed to always be healthy.
| 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. |
| 48 | type 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. |
| 62 | var ErrClosedTransport = errors.New("hub: read/write on closed Transport") |
no outgoing calls
no test coverage detected