Documentation ¶
Index ¶
- Constants
- func NewThrottlerHandler(svc ThrottlerHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type ThrottlerClient
- type ThrottlerHandler
- type UnimplementedThrottlerHandler
- func (UnimplementedThrottlerHandler) GetConfiguration(context.Context, *connect.Request[v16.GetConfigurationRequest]) (*connect.Response[v16.GetConfigurationResponse], error)
- func (UnimplementedThrottlerHandler) MaxRates(context.Context, *connect.Request[v16.MaxRatesRequest]) (*connect.Response[v16.MaxRatesResponse], error)
- func (UnimplementedThrottlerHandler) ResetConfiguration(context.Context, *connect.Request[v16.ResetConfigurationRequest]) (*connect.Response[v16.ResetConfigurationResponse], error)
- func (UnimplementedThrottlerHandler) SetMaxRate(context.Context, *connect.Request[v16.SetMaxRateRequest]) (*connect.Response[v16.SetMaxRateResponse], error)
- func (UnimplementedThrottlerHandler) UpdateConfiguration(context.Context, *connect.Request[v16.UpdateConfigurationRequest]) (*connect.Response[v16.UpdateConfigurationResponse], error)
Constants ¶
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.
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.
func (UnimplementedThrottlerHandler) GetConfiguration ¶
func (UnimplementedThrottlerHandler) GetConfiguration(context.Context, *connect.Request[v16.GetConfigurationRequest]) (*connect.Response[v16.GetConfigurationResponse], error)
func (UnimplementedThrottlerHandler) MaxRates ¶
func (UnimplementedThrottlerHandler) MaxRates(context.Context, *connect.Request[v16.MaxRatesRequest]) (*connect.Response[v16.MaxRatesResponse], error)
func (UnimplementedThrottlerHandler) ResetConfiguration ¶
func (UnimplementedThrottlerHandler) ResetConfiguration(context.Context, *connect.Request[v16.ResetConfigurationRequest]) (*connect.Response[v16.ResetConfigurationResponse], error)
func (UnimplementedThrottlerHandler) SetMaxRate ¶
func (UnimplementedThrottlerHandler) SetMaxRate(context.Context, *connect.Request[v16.SetMaxRateRequest]) (*connect.Response[v16.SetMaxRateResponse], error)
func (UnimplementedThrottlerHandler) UpdateConfiguration ¶
func (UnimplementedThrottlerHandler) UpdateConfiguration(context.Context, *connect.Request[v16.UpdateConfigurationRequest]) (*connect.Response[v16.UpdateConfigurationResponse], error)