throttlerservicev16connect

package
v0.0.0-...-770e144 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// ThrottlerMaxRatesProcedure is the fully-qualified name of the Throttler's MaxRates RPC.
	ThrottlerMaxRatesProcedure = "/throttlerservice.Throttler/MaxRates"
	// ThrottlerSetMaxRateProcedure is the fully-qualified name of the Throttler's SetMaxRate RPC.
	ThrottlerSetMaxRateProcedure = "/throttlerservice.Throttler/SetMaxRate"
	// ThrottlerGetConfigurationProcedure is the fully-qualified name of the Throttler's
	// GetConfiguration RPC.
	ThrottlerGetConfigurationProcedure = "/throttlerservice.Throttler/GetConfiguration"
	// ThrottlerUpdateConfigurationProcedure is the fully-qualified name of the Throttler's
	// UpdateConfiguration RPC.
	ThrottlerUpdateConfigurationProcedure = "/throttlerservice.Throttler/UpdateConfiguration"
	// ThrottlerResetConfigurationProcedure is the fully-qualified name of the Throttler's
	// ResetConfiguration RPC.
	ThrottlerResetConfigurationProcedure = "/throttlerservice.Throttler/ResetConfiguration"
)

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 (
	// ThrottlerName is the fully-qualified name of the Throttler service.
	ThrottlerName = "throttlerservice.Throttler"
)

Variables

This section is empty.

Functions

func NewThrottlerHandler

func NewThrottlerHandler(svc ThrottlerHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewThrottlerHandler 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 ThrottlerClient

type ThrottlerClient interface {
	// MaxRates returns the current max rate for each throttler of the process.
	MaxRates(context.Context, *connect.Request[v16.MaxRatesRequest]) (*connect.Response[v16.MaxRatesResponse], error)
	// SetMaxRate allows to change the current max rate for all throttlers
	// of the process.
	SetMaxRate(context.Context, *connect.Request[v16.SetMaxRateRequest]) (*connect.Response[v16.SetMaxRateResponse], error)
	// GetConfiguration returns the configuration of the MaxReplicationlag module
	// for the given throttler or all throttlers if "throttler_name" is empty.
	GetConfiguration(context.Context, *connect.Request[v16.GetConfigurationRequest]) (*connect.Response[v16.GetConfigurationResponse], error)
	// UpdateConfiguration (partially) updates the configuration of the
	// MaxReplicationlag module for the given throttler or all throttlers if
	// "throttler_name" is empty.
	// If "copy_zero_values" is true, fields with zero values will be copied
	// as well.
	UpdateConfiguration(context.Context, *connect.Request[v16.UpdateConfigurationRequest]) (*connect.Response[v16.UpdateConfigurationResponse], error)
	// ResetConfiguration resets the configuration of the MaxReplicationlag module
	// to the initial configuration for the given throttler or all throttlers if
	// "throttler_name" is empty.
	ResetConfiguration(context.Context, *connect.Request[v16.ResetConfigurationRequest]) (*connect.Response[v16.ResetConfigurationResponse], error)
}

ThrottlerClient is a client for the throttlerservice.Throttler service.

func NewThrottlerClient

func NewThrottlerClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ThrottlerClient

NewThrottlerClient constructs a client for the throttlerservice.Throttler 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 ThrottlerHandler

type ThrottlerHandler interface {
	// MaxRates returns the current max rate for each throttler of the process.
	MaxRates(context.Context, *connect.Request[v16.MaxRatesRequest]) (*connect.Response[v16.MaxRatesResponse], error)
	// SetMaxRate allows to change the current max rate for all throttlers
	// of the process.
	SetMaxRate(context.Context, *connect.Request[v16.SetMaxRateRequest]) (*connect.Response[v16.SetMaxRateResponse], error)
	// GetConfiguration returns the configuration of the MaxReplicationlag module
	// for the given throttler or all throttlers if "throttler_name" is empty.
	GetConfiguration(context.Context, *connect.Request[v16.GetConfigurationRequest]) (*connect.Response[v16.GetConfigurationResponse], error)
	// UpdateConfiguration (partially) updates the configuration of the
	// MaxReplicationlag module for the given throttler or all throttlers if
	// "throttler_name" is empty.
	// If "copy_zero_values" is true, fields with zero values will be copied
	// as well.
	UpdateConfiguration(context.Context, *connect.Request[v16.UpdateConfigurationRequest]) (*connect.Response[v16.UpdateConfigurationResponse], error)
	// ResetConfiguration resets the configuration of the MaxReplicationlag module
	// to the initial configuration for the given throttler or all throttlers if
	// "throttler_name" is empty.
	ResetConfiguration(context.Context, *connect.Request[v16.ResetConfigurationRequest]) (*connect.Response[v16.ResetConfigurationResponse], error)
}

ThrottlerHandler is an implementation of the throttlerservice.Throttler service.

type UnimplementedThrottlerHandler

type UnimplementedThrottlerHandler struct{}

UnimplementedThrottlerHandler returns CodeUnimplemented from all methods.

Jump to

Keyboard shortcuts

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