Documentation ¶
Overview ¶
This package is intended for internal use by connect-grpc-go, and provides no backward compatibility guarantees whatsoever. Apart from the package name, the schema here must remain wire compatible with the original.
Copied from gRPC's health check schema, with small modifications to prevent init-time panics: https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto
Index ¶
- Constants
- Variables
- func DialEventService(ctx context.Context, options ...ServiceClientOption) (runtimev1.EventServiceClient, error)
- func DialHealthService(uri string, options ...ServiceClientOption) runtimev1.HealthServiceClient
- func DialMessageService(uri string, options ...ServiceClientOption) runtimev1.MessageServiceClient
- func NewEventServiceHandler(svc EventServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler)
- func NewHealthServiceHandler(svc HealthServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler)
- func NewMessageServiceHandler(svc MessageServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler)
- type EventServiceClient
- type EventServiceConn
- type EventServiceController
- type EventServiceHandler
- type HealthServiceClient
- type HealthServiceConn
- type HealthServiceController
- func (x *HealthServiceController) Check(ctx context.Context, r *connect.Request[runtimev1.HealthCheckRequest]) (*connect.Response[runtimev1.HealthCheckResponse], error)
- func (x *HealthServiceController) Mount(r chi.Router)
- func (x *HealthServiceController) Watch(ctx context.Context, r *connect.Request[runtimev1.HealthCheckRequest], ...) error
- type HealthServiceHandler
- type MessageServiceClient
- type MessageServiceConn
- type MessageServiceController
- type MessageServiceHandler
- type ReflectionServiceController
- type ServiceClientConfig
- type ServiceClientOption
- type ServiceClientOptionFunc
- type UnimplementedEventServiceHandler
- type UnimplementedHealthServiceHandler
- type UnimplementedMessageServiceHandler
Constants ¶
const ( // HealthServiceCheckProcedure is the fully-qualified name of the HealthService's Check RPC. HealthServiceCheckProcedure = "/connect.runtime.v1.HealthService/Check" // HealthServiceWatchProcedure is the fully-qualified name of the HealthService's Watch RPC. HealthServiceWatchProcedure = "/connect.runtime.v1.HealthService/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 (
// EventServiceName is the fully-qualified name of the EventService service.
EventServiceName = "connect.runtime.v1.EventService"
)
const (
// EventServicePushEventProcedure is the fully-qualified name of the EventService's PushEvent RPC.
EventServicePushEventProcedure = "/connect.runtime.v1.EventService/PushEvent"
)
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 (
// HealthServiceName is the fully-qualified name of the HealthService service.
HealthServiceName = "connect.runtime.v1.HealthService"
)
const (
// MessageServiceName is the fully-qualified name of the MessageService service.
MessageServiceName = "connect.runtime.v1.MessageService"
)
const ( // MessageServicePushMessageProcedure is the fully-qualified name of the MessageService's // PushMessage RPC. MessageServicePushMessageProcedure = "/connect.runtime.v1.MessageService/PushMessage" )
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.
Variables ¶
var ( // ErrMissingTopic is returned by NewEventServiceBrokerClient when the topic argument is not provided. ErrMissingTopic = fmt.Errorf("no topic") // ErrMissingProject is returned by NewEventServiceBrokerClient when the project argument is not provided. ErrMissingProject = fmt.Errorf("no project") )
Functions ¶
func DialEventService ¶
func DialEventService(ctx context.Context, options ...ServiceClientOption) (runtimev1.EventServiceClient, error)
DialEventService constructs the connect.runtime.v1.EventServiceClient client.
func DialHealthService ¶
func DialHealthService(uri string, options ...ServiceClientOption) runtimev1.HealthServiceClient
DialHealthService constructs the connect.runtime.v1.runtimev1.HealthServiceClient client.
func DialMessageService ¶
func DialMessageService(uri string, options ...ServiceClientOption) runtimev1.MessageServiceClient
DialMessageService constructs the connect.runtime.v1.runtimev1.MessageServiceClient client.
func NewEventServiceHandler ¶
func NewEventServiceHandler(svc EventServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler)
NewEventServiceHandler 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.
func NewHealthServiceHandler ¶
func NewHealthServiceHandler(svc HealthServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler)
NewHealthServiceHandler 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.
func NewMessageServiceHandler ¶
func NewMessageServiceHandler(svc MessageServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler)
NewMessageServiceHandler 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 EventServiceClient ¶
type EventServiceClient interface { // PushEvent pushes a given event to connect.runtime.v1.EventService service. PushEvent(context.Context, *connect_go.Request[v1.PushEventRequest]) (*connect_go.Response[v1.PushEventResponse], error) }
EventServiceClient is a client for the connect.runtime.v1.EventService service.
func NewEventServiceClient ¶
func NewEventServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) EventServiceClient
NewEventServiceClient constructs a client for the connect.runtime.v1.EventService 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 EventServiceConn ¶
type EventServiceConn struct {
// contains filtered or unexported fields
}
EventServiceConn is a client for the connect.runtime.v1.EventService service.
func (*EventServiceConn) PushEvent ¶
func (x *EventServiceConn) PushEvent(ctx context.Context, r *runtimev1.PushEventRequest) (*runtimev1.PushEventResponse, error)
PushEvent pushes a given event to connect.runtime.v1.EventService service.
type EventServiceController ¶
type EventServiceController struct { // EventService contains an instance of cloud.runtime.v1.EventService service. EventService runtimev1.EventService }
EventServiceController represents a controller for cloud.runtime.v1.EventServiceHandler handler.
func (*EventServiceController) Mount ¶
func (x *EventServiceController) Mount(r chi.Router)
Mount mounts the controller to a given router.
func (*EventServiceController) PushEvent ¶
func (x *EventServiceController) PushEvent(ctx context.Context, r *connect.Request[runtimev1.PushEventRequest]) (*connect.Response[runtimev1.PushEventResponse], error)
PushEvent pushes a given event to connect.runtime.v1.EventService service.
type EventServiceHandler ¶
type EventServiceHandler interface { // PushEvent pushes a given event to connect.runtime.v1.EventService service. PushEvent(context.Context, *connect_go.Request[v1.PushEventRequest]) (*connect_go.Response[v1.PushEventResponse], error) }
EventServiceHandler is an implementation of the connect.runtime.v1.EventService service.
type HealthServiceClient ¶
type HealthServiceClient interface { // If the requested service is unknown, the call will fail with status // NOT_FOUND. Check(context.Context, *connect_go.Request[v1.HealthCheckRequest]) (*connect_go.Response[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[v1.HealthCheckRequest]) (*connect_go.ServerStreamForClient[v1.HealthCheckResponse], error) }
HealthServiceClient is a client for the connect.runtime.v1.HealthService service.
func NewHealthServiceClient ¶
func NewHealthServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) HealthServiceClient
NewHealthServiceClient constructs a client for the connect.runtime.v1.HealthService 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 HealthServiceConn ¶
type HealthServiceConn struct {
// contains filtered or unexported fields
}
HealthServiceConn is a client for the connect.runtime.v1.EventService service.
func (*HealthServiceConn) Check ¶
func (x *HealthServiceConn) Check(ctx context.Context, r *runtimev1.HealthCheckRequest) (*runtimev1.HealthCheckResponse, error)
Check implements runtimev1.HealthServiceClient.
type HealthServiceController ¶
type HealthServiceController struct { // HealthService contains an instance of cloud.runtime.v1.HealthService service. HealthService runtimev1.HealthService }
HealthServiceController represents a controller for connect.runtime.v1.HealthServiceHandler handler.
func (*HealthServiceController) Check ¶
func (x *HealthServiceController) Check(ctx context.Context, r *connect.Request[runtimev1.HealthCheckRequest]) (*connect.Response[runtimev1.HealthCheckResponse], error)
Check implements HealthServiceHandler.
func (*HealthServiceController) Mount ¶
func (x *HealthServiceController) Mount(r chi.Router)
Mount mounts the handler to a given router.
func (*HealthServiceController) Watch ¶
func (x *HealthServiceController) Watch(ctx context.Context, r *connect.Request[runtimev1.HealthCheckRequest], s *connect.ServerStream[runtimev1.HealthCheckResponse]) error
Watch implements HealthServiceHandler.
type HealthServiceHandler ¶
type HealthServiceHandler interface { // If the requested service is unknown, the call will fail with status // NOT_FOUND. Check(context.Context, *connect_go.Request[v1.HealthCheckRequest]) (*connect_go.Response[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[v1.HealthCheckRequest], *connect_go.ServerStream[v1.HealthCheckResponse]) error }
HealthServiceHandler is an implementation of the connect.runtime.v1.HealthService service.
type MessageServiceClient ¶
type MessageServiceClient interface { // PushEvent pushes a given message to connect.runtime.v1.MessageService service. PushMessage(context.Context, *connect_go.Request[v1.PushMessageRequest]) (*connect_go.Response[v1.PushMessageResponse], error) }
MessageServiceClient is a client for the connect.runtime.v1.MessageService service.
func NewMessageServiceClient ¶
func NewMessageServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) MessageServiceClient
NewMessageServiceClient constructs a client for the connect.runtime.v1.MessageService 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 MessageServiceConn ¶
type MessageServiceConn struct {
// contains filtered or unexported fields
}
MessageServiceConn is a client for the connect.runtime.v1.MessageService service.
func (*MessageServiceConn) PushMessage ¶
func (x *MessageServiceConn) PushMessage(ctx context.Context, r *runtimev1.PushMessageRequest) (*runtimev1.PushMessageResponse, error)
PushMessage implements runtimev1.MessageServiceClient.
type MessageServiceController ¶
type MessageServiceController struct { // MessageService contains an instance of connect.runtime.v1.MessageService handler. MessageService runtimev1.MessageService }
MessageServiceController represents a controller for connect.runtime.v1.MessageServiceHandler handler.
func (*MessageServiceController) Mount ¶
func (x *MessageServiceController) Mount(r chi.Router)
Mount mounts the controller to a given router.
func (*MessageServiceController) PushMessage ¶
func (x *MessageServiceController) PushMessage(ctx context.Context, r *connect.Request[runtimev1.PushMessageRequest]) (*connect.Response[runtimev1.PushMessageResponse], error)
PushMessage implements MessageServiceHandler.
type MessageServiceHandler ¶
type MessageServiceHandler interface { // PushEvent pushes a given message to connect.runtime.v1.MessageService service. PushMessage(context.Context, *connect_go.Request[v1.PushMessageRequest]) (*connect_go.Response[v1.PushMessageResponse], error) }
MessageServiceHandler is an implementation of the connect.runtime.v1.MessageService service.
type ReflectionServiceController ¶
type ReflectionServiceController struct { // Services contains a collection of service names Services []string }
ReflectionServiceController represents a controller for grpc.reflection.v1.ServerReflection handler and grpc.reflection.v1alpha.ServerReflection handler.
func (*ReflectionServiceController) Mount ¶
func (x *ReflectionServiceController) Mount(r chi.Router)
Mount mounts the controller to a given router.
type ServiceClientConfig ¶
type ServiceClientConfig struct { Client *http.Client ClientURL string ClientConfig map[string]string ClientOptions []connect.ClientOption }
ServiceClientConfig represents the config for clichepress.operation.v1.ServiceClient client.
type ServiceClientOption ¶
type ServiceClientOption interface { // Apply applies the option. Apply(config *ServiceClientConfig) }
ServiceClientOption represents an option for clichepress.storage.v1.ServiceClient client.
func WithAuthorization ¶
func WithAuthorization() ServiceClientOption
WithAuthorization enables an oidc authorization.
func WithProject ¶
func WithProject(name string) ServiceClientOption
WithProject returns a option that sets the connect.runtime.v1.EventService service project.
func WithProtocol ¶
func WithProtocol(name string) ServiceClientOption
WithProtocol enables a given protocol.
func WithTopic ¶
func WithTopic(name string) ServiceClientOption
WithTopic returns a option that sets the connect.runtime.v1.EventService service topic.
type ServiceClientOptionFunc ¶
type ServiceClientOptionFunc func(*ServiceClientConfig)
ServiceClientOptionFunc represent a function that implementes clichepress.storage.v1.ServiceClientOption option.
func (ServiceClientOptionFunc) Apply ¶
func (fn ServiceClientOptionFunc) Apply(config *ServiceClientConfig)
Apply applies the option.
type UnimplementedEventServiceHandler ¶
type UnimplementedEventServiceHandler struct{}
UnimplementedEventServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedEventServiceHandler) PushEvent ¶
func (UnimplementedEventServiceHandler) PushEvent(context.Context, *connect_go.Request[v1.PushEventRequest]) (*connect_go.Response[v1.PushEventResponse], error)
type UnimplementedHealthServiceHandler ¶
type UnimplementedHealthServiceHandler struct{}
UnimplementedHealthServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedHealthServiceHandler) Check ¶
func (UnimplementedHealthServiceHandler) Check(context.Context, *connect_go.Request[v1.HealthCheckRequest]) (*connect_go.Response[v1.HealthCheckResponse], error)
type UnimplementedMessageServiceHandler ¶
type UnimplementedMessageServiceHandler struct{}
UnimplementedMessageServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedMessageServiceHandler) PushMessage ¶
func (UnimplementedMessageServiceHandler) PushMessage(context.Context, *connect_go.Request[v1.PushMessageRequest]) (*connect_go.Response[v1.PushMessageResponse], error)