Documentation ¶
Index ¶
- Constants
- func NewHealthHandler(svc HealthHandler, opts ...connect_go.HandlerOption) (string, http.Handler)
- type HealthClient
- type HealthHandler
- type UnimplementedHealthHandler
- func (UnimplementedHealthHandler) Check(context.Context, *connect_go.Request[grpc_health_v1.HealthCheckRequest]) (*connect_go.Response[grpc_health_v1.HealthCheckResponse], error)
- func (UnimplementedHealthHandler) Watch(context.Context, *connect_go.Request[grpc_health_v1.HealthCheckRequest], ...) error
Constants ¶
const ( // HealthCheckProcedure is the fully-qualified name of the Health's Check RPC. HealthCheckProcedure = "/grpc.health.v1.Health/Check" // HealthWatchProcedure is the fully-qualified name of the Health's Watch RPC. HealthWatchProcedure = "/grpc.health.v1.Health/Watch" )
These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.
const (
// HealthName is the fully-qualified name of the Health service.
HealthName = "grpc.health.v1.Health"
)
Variables ¶
This section is empty.
Functions ¶
func NewHealthHandler ¶
func NewHealthHandler(svc HealthHandler, opts ...connect_go.HandlerOption) (string, http.Handler)
NewHealthHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.
By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.
Types ¶
type HealthClient ¶
type HealthClient interface { // If the requested service is unknown, the call will fail with status // NOT_FOUND. Check(context.Context, *connect_go.Request[grpc_health_v1.HealthCheckRequest]) (*connect_go.Response[grpc_health_v1.HealthCheckResponse], error) // Performs a watch for the serving status of the requested service. // The server will immediately send back a message indicating the current // serving status. It will then subsequently send a new message whenever // the service's serving status changes. // // If the requested service is unknown when the call is received, the // server will send a message setting the serving status to // SERVICE_UNKNOWN but will *not* terminate the call. If at some // future point, the serving status of the service becomes known, the // server will send a new message with the service's serving status. // // If the call terminates with status UNIMPLEMENTED, then clients // should assume this method is not supported and should not retry the // call. If the call terminates with any other status (including OK), // clients should retry the call with appropriate exponential backoff. Watch(context.Context, *connect_go.Request[grpc_health_v1.HealthCheckRequest]) (*connect_go.ServerStreamForClient[grpc_health_v1.HealthCheckResponse], error) }
HealthClient is a client for the grpc.health.v1.Health service.
func NewHealthClient ¶
func NewHealthClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) HealthClient
NewHealthClient constructs a client for the grpc.health.v1.Health service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.
The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).
type HealthHandler ¶
type HealthHandler interface { // If the requested service is unknown, the call will fail with status // NOT_FOUND. Check(context.Context, *connect_go.Request[grpc_health_v1.HealthCheckRequest]) (*connect_go.Response[grpc_health_v1.HealthCheckResponse], error) // Performs a watch for the serving status of the requested service. // The server will immediately send back a message indicating the current // serving status. It will then subsequently send a new message whenever // the service's serving status changes. // // If the requested service is unknown when the call is received, the // server will send a message setting the serving status to // SERVICE_UNKNOWN but will *not* terminate the call. If at some // future point, the serving status of the service becomes known, the // server will send a new message with the service's serving status. // // If the call terminates with status UNIMPLEMENTED, then clients // should assume this method is not supported and should not retry the // call. If the call terminates with any other status (including OK), // clients should retry the call with appropriate exponential backoff. Watch(context.Context, *connect_go.Request[grpc_health_v1.HealthCheckRequest], *connect_go.ServerStream[grpc_health_v1.HealthCheckResponse]) error }
HealthHandler is an implementation of the grpc.health.v1.Health service.