clconnectv1connect

package
v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ReadOnlyServiceName is the fully-qualified name of the ReadOnlyService service.
	ReadOnlyServiceName = "clconnect.v1.ReadOnlyService"
	// ReadWriteServiceName is the fully-qualified name of the ReadWriteService service.
	ReadWriteServiceName = "clconnect.v1.ReadWriteService"
)
View Source
const (
	// ReadOnlyServiceFooProcedure is the fully-qualified name of the ReadOnlyService's Foo RPC.
	ReadOnlyServiceFooProcedure = "/clconnect.v1.ReadOnlyService/Foo"
	// ReadWriteServiceCheckHealthProcedure is the fully-qualified name of the ReadWriteService's
	// CheckHealth RPC.
	ReadWriteServiceCheckHealthProcedure = "/clconnect.v1.ReadWriteService/CheckHealth"
)

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

This section is empty.

Functions

func NewReadOnlyServiceHandler

func NewReadOnlyServiceHandler(svc ReadOnlyServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewReadOnlyServiceHandler 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 NewReadWriteServiceHandler

func NewReadWriteServiceHandler(svc ReadWriteServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewReadWriteServiceHandler 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 ReadOnlyServiceClient

type ReadOnlyServiceClient interface {
	// Foo method for testing
	Foo(context.Context, *connect.Request[v1.FooRequest]) (*connect.Response[v1.FooResponse], error)
}

ReadOnlyServiceClient is a client for the clconnect.v1.ReadOnlyService service.

func NewReadOnlyServiceClient

func NewReadOnlyServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ReadOnlyServiceClient

NewReadOnlyServiceClient constructs a client for the clconnect.v1.ReadOnlyService 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 ReadOnlyServiceHandler

type ReadOnlyServiceHandler interface {
	// Foo method for testing
	Foo(context.Context, *connect.Request[v1.FooRequest]) (*connect.Response[v1.FooResponse], error)
}

ReadOnlyServiceHandler is an implementation of the clconnect.v1.ReadOnlyService service.

type ReadWriteServiceClient

type ReadWriteServiceClient interface {
	// Check health endpoint for testing middleware
	CheckHealth(context.Context, *connect.Request[v1.CheckHealthRequest]) (*connect.Response[v1.CheckHealthResponse], error)
}

ReadWriteServiceClient is a client for the clconnect.v1.ReadWriteService service.

func NewReadWriteServiceClient

func NewReadWriteServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ReadWriteServiceClient

NewReadWriteServiceClient constructs a client for the clconnect.v1.ReadWriteService 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 ReadWriteServiceHandler

type ReadWriteServiceHandler interface {
	// Check health endpoint for testing middleware
	CheckHealth(context.Context, *connect.Request[v1.CheckHealthRequest]) (*connect.Response[v1.CheckHealthResponse], error)
}

ReadWriteServiceHandler is an implementation of the clconnect.v1.ReadWriteService service.

type UnimplementedReadOnlyServiceHandler

type UnimplementedReadOnlyServiceHandler struct{}

UnimplementedReadOnlyServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedReadOnlyServiceHandler) Foo added in v0.18.2

type UnimplementedReadWriteServiceHandler

type UnimplementedReadWriteServiceHandler struct{}

UnimplementedReadWriteServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedReadWriteServiceHandler) CheckHealth added in v0.18.1

Jump to

Keyboard shortcuts

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