example

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ExampleService_Allow100PerMinute_FullMethodName = "/ratelimit.ExampleService/Allow100PerMinute"
	ExampleService_Allow1PerMinute_FullMethodName   = "/ratelimit.ExampleService/Allow1PerMinute"
)

Variables

View Source
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)

View Source
var File_example_example_proto protoreflect.FileDescriptor

Functions

func NewRateLimiter

func NewRateLimiter() (limiter.Limiter, error)

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.

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.

Jump to

Keyboard shortcuts

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