Documentation ¶
Index ¶
- Constants
- func NewExampleServiceHandler(svc ExampleServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- func NewStreamingServiceHandler(svc StreamingServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler)
- type ExampleServiceClient
- type ExampleServiceHandler
- type StreamingServiceClient
- type StreamingServiceHandler
- type UnimplementedExampleServiceHandler
- func (UnimplementedExampleServiceHandler) CreateExample(context.Context, *connect.Request[sample.Example]) (*connect.Response[sample.Example], error)
- func (UnimplementedExampleServiceHandler) DeleteExample(context.Context, *connect.Request[sample.DeleteExampleRequest]) (*connect.Response[emptypb.Empty], error)
- func (UnimplementedExampleServiceHandler) GetExample(context.Context, *connect.Request[sample.GetExampleRequest]) (*connect.Response[sample.Example], error)
- func (UnimplementedExampleServiceHandler) ListExamples(context.Context, *connect.Request[sample.ListExampleRequest]) (*connect.Response[sample.ListExampleResponse], error)
- func (UnimplementedExampleServiceHandler) UpdateExample(context.Context, *connect.Request[sample.Example]) (*connect.Response[sample.Example], error)
- type UnimplementedStreamingServiceHandler
- func (UnimplementedStreamingServiceHandler) BiDirectionalStream(context.Context, ...) error
- func (UnimplementedStreamingServiceHandler) ClientStream(context.Context, *connect_go.ClientStream[sample.GreetRequest]) (*connect_go.Response[sample.GreetResponse], error)
- func (UnimplementedStreamingServiceHandler) ResponseStream(context.Context, *connect_go.Request[sample.GreetRequest], ...) error
Constants ¶
const ( // ExampleServiceCreateExampleProcedure is the fully-qualified name of the ExampleService's // CreateExample RPC. ExampleServiceCreateExampleProcedure = "/tutorial.ExampleService/CreateExample" // ExampleServiceGetExampleProcedure is the fully-qualified name of the ExampleService's GetExample // RPC. ExampleServiceGetExampleProcedure = "/tutorial.ExampleService/GetExample" // ExampleServiceListExamplesProcedure is the fully-qualified name of the ExampleService's // ListExamples RPC. ExampleServiceListExamplesProcedure = "/tutorial.ExampleService/ListExamples" // ExampleServiceUpdateExampleProcedure is the fully-qualified name of the ExampleService's // UpdateExample RPC. ExampleServiceUpdateExampleProcedure = "/tutorial.ExampleService/UpdateExample" // ExampleServiceDeleteExampleProcedure is the fully-qualified name of the ExampleService's // DeleteExample RPC. ExampleServiceDeleteExampleProcedure = "/tutorial.ExampleService/DeleteExample" )
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 (
// ExampleServiceName is the fully-qualified name of the ExampleService service.
ExampleServiceName = "tutorial.ExampleService"
)
const (
// StreamingServiceName is the fully-qualified name of the StreamingService service.
StreamingServiceName = "tutorial.StreamingService"
)
Variables ¶
This section is empty.
Functions ¶
func NewExampleServiceHandler ¶
func NewExampleServiceHandler(svc ExampleServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewExampleServiceHandler 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 NewStreamingServiceHandler ¶ added in v0.1.5
func NewStreamingServiceHandler(svc StreamingServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler)
NewStreamingServiceHandler 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 ExampleServiceClient ¶
type ExampleServiceClient interface { CreateExample(context.Context, *connect.Request[sample.Example]) (*connect.Response[sample.Example], error) GetExample(context.Context, *connect.Request[sample.GetExampleRequest]) (*connect.Response[sample.Example], error) ListExamples(context.Context, *connect.Request[sample.ListExampleRequest]) (*connect.Response[sample.ListExampleResponse], error) UpdateExample(context.Context, *connect.Request[sample.Example]) (*connect.Response[sample.Example], error) DeleteExample(context.Context, *connect.Request[sample.DeleteExampleRequest]) (*connect.Response[emptypb.Empty], error) }
ExampleServiceClient is a client for the tutorial.ExampleService service.
func NewExampleServiceClient ¶
func NewExampleServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ExampleServiceClient
NewExampleServiceClient constructs a client for the tutorial.ExampleService 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 ExampleServiceHandler ¶
type ExampleServiceHandler interface { CreateExample(context.Context, *connect.Request[sample.Example]) (*connect.Response[sample.Example], error) GetExample(context.Context, *connect.Request[sample.GetExampleRequest]) (*connect.Response[sample.Example], error) ListExamples(context.Context, *connect.Request[sample.ListExampleRequest]) (*connect.Response[sample.ListExampleResponse], error) UpdateExample(context.Context, *connect.Request[sample.Example]) (*connect.Response[sample.Example], error) DeleteExample(context.Context, *connect.Request[sample.DeleteExampleRequest]) (*connect.Response[emptypb.Empty], error) }
ExampleServiceHandler is an implementation of the tutorial.ExampleService service.
type StreamingServiceClient ¶ added in v0.1.5
type StreamingServiceClient interface { ClientStream(context.Context) *connect_go.ClientStreamForClient[sample.GreetRequest, sample.GreetResponse] ResponseStream(context.Context, *connect_go.Request[sample.GreetRequest]) (*connect_go.ServerStreamForClient[sample.GreetResponse], error) BiDirectionalStream(context.Context) *connect_go.BidiStreamForClient[sample.GreetRequest, sample.GreetResponse] }
StreamingServiceClient is a client for the tutorial.StreamingService service.
func NewStreamingServiceClient ¶ added in v0.1.5
func NewStreamingServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) StreamingServiceClient
NewStreamingServiceClient constructs a client for the tutorial.StreamingService 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 StreamingServiceHandler ¶ added in v0.1.5
type StreamingServiceHandler interface { ClientStream(context.Context, *connect_go.ClientStream[sample.GreetRequest]) (*connect_go.Response[sample.GreetResponse], error) ResponseStream(context.Context, *connect_go.Request[sample.GreetRequest], *connect_go.ServerStream[sample.GreetResponse]) error BiDirectionalStream(context.Context, *connect_go.BidiStream[sample.GreetRequest, sample.GreetResponse]) error }
StreamingServiceHandler is an implementation of the tutorial.StreamingService service.
type UnimplementedExampleServiceHandler ¶
type UnimplementedExampleServiceHandler struct{}
UnimplementedExampleServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedExampleServiceHandler) CreateExample ¶
func (UnimplementedExampleServiceHandler) DeleteExample ¶ added in v0.1.5
func (UnimplementedExampleServiceHandler) GetExample ¶
func (UnimplementedExampleServiceHandler) ListExamples ¶
func (UnimplementedExampleServiceHandler) ListExamples(context.Context, *connect.Request[sample.ListExampleRequest]) (*connect.Response[sample.ListExampleResponse], error)
type UnimplementedStreamingServiceHandler ¶ added in v0.1.5
type UnimplementedStreamingServiceHandler struct{}
UnimplementedStreamingServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedStreamingServiceHandler) BiDirectionalStream ¶ added in v0.1.5
func (UnimplementedStreamingServiceHandler) BiDirectionalStream(context.Context, *connect_go.BidiStream[sample.GreetRequest, sample.GreetResponse]) error
func (UnimplementedStreamingServiceHandler) ClientStream ¶ added in v0.1.5
func (UnimplementedStreamingServiceHandler) ClientStream(context.Context, *connect_go.ClientStream[sample.GreetRequest]) (*connect_go.Response[sample.GreetResponse], error)
func (UnimplementedStreamingServiceHandler) ResponseStream ¶ added in v0.1.5
func (UnimplementedStreamingServiceHandler) ResponseStream(context.Context, *connect_go.Request[sample.GreetRequest], *connect_go.ServerStream[sample.GreetResponse]) error