Documentation ¶
Index ¶
Constants ¶
const (
// RateLimitServiceName is the fully-qualified name of the RateLimitService service.
RateLimitServiceName = "envoy.service.ratelimit.v3.RateLimitService"
)
const ( // RateLimitServiceShouldRateLimitProcedure is the fully-qualified name of the RateLimitService's // ShouldRateLimit RPC. RateLimitServiceShouldRateLimitProcedure = "/envoy.service.ratelimit.v3.RateLimitService/ShouldRateLimit" )
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 NewRateLimitServiceHandler ¶
func NewRateLimitServiceHandler(svc RateLimitServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewRateLimitServiceHandler 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 RateLimitServiceClient ¶
type RateLimitServiceClient interface { // Determine whether rate limiting should take place. ShouldRateLimit(context.Context, *connect.Request[v3.RateLimitRequest]) (*connect.Response[v3.RateLimitResponse], error) }
RateLimitServiceClient is a client for the envoy.service.ratelimit.v3.RateLimitService service.
func NewRateLimitServiceClient ¶
func NewRateLimitServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) RateLimitServiceClient
NewRateLimitServiceClient constructs a client for the envoy.service.ratelimit.v3.RateLimitService 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 RateLimitServiceHandler ¶
type RateLimitServiceHandler interface { // Determine whether rate limiting should take place. ShouldRateLimit(context.Context, *connect.Request[v3.RateLimitRequest]) (*connect.Response[v3.RateLimitResponse], error) }
RateLimitServiceHandler is an implementation of the envoy.service.ratelimit.v3.RateLimitService service.
type UnimplementedRateLimitServiceHandler ¶
type UnimplementedRateLimitServiceHandler struct{}
UnimplementedRateLimitServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedRateLimitServiceHandler) ShouldRateLimit ¶
func (UnimplementedRateLimitServiceHandler) ShouldRateLimit(context.Context, *connect.Request[v3.RateLimitRequest]) (*connect.Response[v3.RateLimitResponse], error)