protoconnect

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ControllerMeshName is the fully-qualified name of the ControllerMesh service.
	ControllerMeshName = "proto.ControllerMesh"
)
View Source
const (
	// ControllerMeshRegisterProcedure is the fully-qualified name of the ControllerMesh's Register RPC.
	ControllerMeshRegisterProcedure = "/proto.ControllerMesh/Register"
)

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 (
	// ThrottlingName is the fully-qualified name of the Throttling service.
	ThrottlingName = "proto.Throttling"
)
View Source
const (
	// ThrottlingSendConfigProcedure is the fully-qualified name of the Throttling's SendConfig RPC.
	ThrottlingSendConfigProcedure = "/proto.Throttling/SendConfig"
)

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 NewControllerMeshHandler

func NewControllerMeshHandler(svc ControllerMeshHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewControllerMeshHandler 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 NewThrottlingHandler

func NewThrottlingHandler(svc ThrottlingHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewThrottlingHandler 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 ControllerMeshClient

type ControllerMeshClient interface {
	Register(context.Context) *connect.BidiStreamForClient[proto.ProxyStatus, proto.ProxySpec]
}

ControllerMeshClient is a client for the proto.ControllerMesh service.

func NewControllerMeshClient

func NewControllerMeshClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ControllerMeshClient

NewControllerMeshClient constructs a client for the proto.ControllerMesh 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 ControllerMeshHandler

type ControllerMeshHandler interface {
	Register(context.Context, *connect.BidiStream[proto.ProxyStatus, proto.ProxySpec]) error
}

ControllerMeshHandler is an implementation of the proto.ControllerMesh service.

type ThrottlingClient

type ThrottlingClient interface {
	SendConfig(context.Context, *connect.Request[proto.CircuitBreaker]) (*connect.Response[proto.ConfigResp], error)
}

ThrottlingClient is a client for the proto.Throttling service.

func NewThrottlingClient

func NewThrottlingClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ThrottlingClient

NewThrottlingClient constructs a client for the proto.Throttling 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 ThrottlingHandler

type ThrottlingHandler interface {
	SendConfig(context.Context, *connect.Request[proto.CircuitBreaker]) (*connect.Response[proto.ConfigResp], error)
}

ThrottlingHandler is an implementation of the proto.Throttling service.

type UnimplementedControllerMeshHandler

type UnimplementedControllerMeshHandler struct{}

UnimplementedControllerMeshHandler returns CodeUnimplemented from all methods.

func (UnimplementedControllerMeshHandler) Register

type UnimplementedThrottlingHandler

type UnimplementedThrottlingHandler struct{}

UnimplementedThrottlingHandler returns CodeUnimplemented from all methods.

Jump to

Keyboard shortcuts

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