Documentation ¶
Index ¶
Constants ¶
const ( ExampleService_Allow100PerMinute_FullMethodName = "/ratelimit.ExampleService/Allow100PerMinute" ExampleService_Allow1PerMinute_FullMethodName = "/ratelimit.ExampleService/Allow1PerMinute" )
Variables ¶
var ExampleService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "ratelimit.ExampleService", HandlerType: (*ExampleServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Allow100PerMinute", Handler: _ExampleService_Allow100PerMinute_Handler, }, { MethodName: "Allow1PerMinute", Handler: _ExampleService_Allow1PerMinute_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "example/example.proto", }
ExampleService_ServiceDesc is the grpc.ServiceDesc for ExampleService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_example_example_proto protoreflect.FileDescriptor
Functions ¶
func NewRateLimiter ¶
NewRateLimiter returns a new inmemory ratelimiter
func RegisterExampleServiceServer ¶
func RegisterExampleServiceServer(s grpc.ServiceRegistrar, srv ExampleServiceServer)
Types ¶
type ExampleServiceClient ¶
type ExampleServiceClient interface { Allow100PerMinute(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) Allow1PerMinute(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) }
ExampleServiceClient is the client API for ExampleService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewExampleServiceClient ¶
func NewExampleServiceClient(cc grpc.ClientConnInterface) ExampleServiceClient
type ExampleServiceServer ¶
type ExampleServiceServer interface { Allow100PerMinute(context.Context, *emptypb.Empty) (*emptypb.Empty, error) Allow1PerMinute(context.Context, *emptypb.Empty) (*emptypb.Empty, error) // contains filtered or unexported methods }
ExampleServiceServer is the server API for ExampleService service. All implementations must embed UnimplementedExampleServiceServer for forward compatibility
type UnimplementedExampleServiceServer ¶
type UnimplementedExampleServiceServer struct { }
UnimplementedExampleServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedExampleServiceServer) Allow100PerMinute ¶
func (UnimplementedExampleServiceServer) Allow1PerMinute ¶
type UnsafeExampleServiceServer ¶
type UnsafeExampleServiceServer interface {
// contains filtered or unexported methods
}
UnsafeExampleServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ExampleServiceServer will result in compilation errors.