protoconnect

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 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 (
	// FaultInjectName is the fully-qualified name of the FaultInject service.
	FaultInjectName = "proto.FaultInject"
)
View Source
const (
	// FaultInjectSendConfigProcedure is the fully-qualified name of the FaultInject's SendConfig RPC.
	FaultInjectSendConfigProcedure = "/proto.FaultInject/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.

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 NewFaultInjectHandler added in v0.2.0

func NewFaultInjectHandler(svc FaultInjectHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewFaultInjectHandler 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 FaultInjectClient added in v0.2.0

type FaultInjectClient interface {
	SendConfig(context.Context, *connect.Request[proto.FaultInjection]) (*connect.Response[proto.FaultInjectConfigResp], error)
}

FaultInjectClient is a client for the proto.FaultInject service.

func NewFaultInjectClient added in v0.2.0

func NewFaultInjectClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) FaultInjectClient

NewFaultInjectClient constructs a client for the proto.FaultInject 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 FaultInjectHandler added in v0.2.0

type FaultInjectHandler interface {
	SendConfig(context.Context, *connect.Request[proto.FaultInjection]) (*connect.Response[proto.FaultInjectConfigResp], error)
}

FaultInjectHandler is an implementation of the proto.FaultInject 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 UnimplementedFaultInjectHandler added in v0.2.0

type UnimplementedFaultInjectHandler struct{}

UnimplementedFaultInjectHandler returns CodeUnimplemented from all methods.

func (UnimplementedFaultInjectHandler) SendConfig added in v0.2.0

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