sampleconnect

package
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
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.

View Source
const (
	// ExampleServiceName is the fully-qualified name of the ExampleService service.
	ExampleServiceName = "tutorial.ExampleService"
)
View Source
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

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

ExampleServiceHandler is an implementation of the tutorial.ExampleService service.

type StreamingServiceClient added in v0.1.5

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

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) UpdateExample added in v0.1.5

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) ClientStream added in v0.1.5

func (UnimplementedStreamingServiceHandler) ResponseStream added in v0.1.5

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL