1
2
3
4
5
6
7 package pb_lyft_ratelimit
8
9 import (
10 context "context"
11 _ "github.com/cncf/udpa/go/udpa/annotations"
12 v2 "github.com/datawire/ambassador/v2/pkg/api/envoy/service/ratelimit/v2"
13 proto "github.com/golang/protobuf/proto"
14 grpc "google.golang.org/grpc"
15 codes "google.golang.org/grpc/codes"
16 status "google.golang.org/grpc/status"
17 protoreflect "google.golang.org/protobuf/reflect/protoreflect"
18 protoimpl "google.golang.org/protobuf/runtime/protoimpl"
19 reflect "reflect"
20 )
21
22 const (
23
24 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
25
26 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
27 )
28
29
30
31 const _ = proto.ProtoPackageIsVersion4
32
33 var File_pb_lyft_ratelimit_rls_proto protoreflect.FileDescriptor
34
35 var file_pb_lyft_ratelimit_rls_proto_rawDesc = []byte{
36 0x0a, 0x1b, 0x70, 0x62, 0x2f, 0x6c, 0x79, 0x66, 0x74, 0x2f, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69,
37 0x6d, 0x69, 0x74, 0x2f, 0x72, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x70,
38 0x62, 0x2e, 0x6c, 0x79, 0x66, 0x74, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74,
39 0x1a, 0x24, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f,
40 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x6c, 0x73,
41 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e,
42 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65,
43 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e,
44 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e,
45 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x84, 0x01, 0x0a, 0x10, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69,
46 0x6d, 0x69, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x70, 0x0a, 0x0f, 0x53, 0x68,
47 0x6f, 0x75, 0x6c, 0x64, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x2c, 0x2e,
48 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x72, 0x61,
49 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c,
50 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x6e,
51 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x72, 0x61, 0x74, 0x65,
52 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d,
53 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x5a, 0x0a, 0x1f,
54 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x70, 0x62,
55 0x2e, 0x6c, 0x79, 0x66, 0x74, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x42,
56 0x08, 0x52, 0x6c, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x88, 0x01, 0x01, 0xf2, 0x98,
57 0xfe, 0x8f, 0x05, 0x1c, 0x12, 0x1a, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76,
58 0x69, 0x63, 0x65, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x76, 0x33,
59 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
60 }
61
62 var file_pb_lyft_ratelimit_rls_proto_goTypes = []interface{}{
63 (*v2.RateLimitRequest)(nil),
64 (*v2.RateLimitResponse)(nil),
65 }
66 var file_pb_lyft_ratelimit_rls_proto_depIdxs = []int32{
67 0,
68 1,
69 1,
70 0,
71 0,
72 0,
73 0,
74 }
75
76 func init() { file_pb_lyft_ratelimit_rls_proto_init() }
77 func file_pb_lyft_ratelimit_rls_proto_init() {
78 if File_pb_lyft_ratelimit_rls_proto != nil {
79 return
80 }
81 type x struct{}
82 out := protoimpl.TypeBuilder{
83 File: protoimpl.DescBuilder{
84 GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
85 RawDescriptor: file_pb_lyft_ratelimit_rls_proto_rawDesc,
86 NumEnums: 0,
87 NumMessages: 0,
88 NumExtensions: 0,
89 NumServices: 1,
90 },
91 GoTypes: file_pb_lyft_ratelimit_rls_proto_goTypes,
92 DependencyIndexes: file_pb_lyft_ratelimit_rls_proto_depIdxs,
93 }.Build()
94 File_pb_lyft_ratelimit_rls_proto = out.File
95 file_pb_lyft_ratelimit_rls_proto_rawDesc = nil
96 file_pb_lyft_ratelimit_rls_proto_goTypes = nil
97 file_pb_lyft_ratelimit_rls_proto_depIdxs = nil
98 }
99
100
101 var _ context.Context
102 var _ grpc.ClientConnInterface
103
104
105
106 const _ = grpc.SupportPackageIsVersion6
107
108
109
110
111 type RateLimitServiceClient interface {
112 ShouldRateLimit(ctx context.Context, in *v2.RateLimitRequest, opts ...grpc.CallOption) (*v2.RateLimitResponse, error)
113 }
114
115 type rateLimitServiceClient struct {
116 cc grpc.ClientConnInterface
117 }
118
119 func NewRateLimitServiceClient(cc grpc.ClientConnInterface) RateLimitServiceClient {
120 return &rateLimitServiceClient{cc}
121 }
122
123 func (c *rateLimitServiceClient) ShouldRateLimit(ctx context.Context, in *v2.RateLimitRequest, opts ...grpc.CallOption) (*v2.RateLimitResponse, error) {
124 out := new(v2.RateLimitResponse)
125 err := c.cc.Invoke(ctx, "/pb.lyft.ratelimit.RateLimitService/ShouldRateLimit", in, out, opts...)
126 if err != nil {
127 return nil, err
128 }
129 return out, nil
130 }
131
132
133 type RateLimitServiceServer interface {
134 ShouldRateLimit(context.Context, *v2.RateLimitRequest) (*v2.RateLimitResponse, error)
135 }
136
137
138 type UnimplementedRateLimitServiceServer struct {
139 }
140
141 func (*UnimplementedRateLimitServiceServer) ShouldRateLimit(context.Context, *v2.RateLimitRequest) (*v2.RateLimitResponse, error) {
142 return nil, status.Errorf(codes.Unimplemented, "method ShouldRateLimit not implemented")
143 }
144
145 func RegisterRateLimitServiceServer(s *grpc.Server, srv RateLimitServiceServer) {
146 s.RegisterService(&_RateLimitService_serviceDesc, srv)
147 }
148
149 func _RateLimitService_ShouldRateLimit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
150 in := new(v2.RateLimitRequest)
151 if err := dec(in); err != nil {
152 return nil, err
153 }
154 if interceptor == nil {
155 return srv.(RateLimitServiceServer).ShouldRateLimit(ctx, in)
156 }
157 info := &grpc.UnaryServerInfo{
158 Server: srv,
159 FullMethod: "/pb.lyft.ratelimit.RateLimitService/ShouldRateLimit",
160 }
161 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
162 return srv.(RateLimitServiceServer).ShouldRateLimit(ctx, req.(*v2.RateLimitRequest))
163 }
164 return interceptor(ctx, in, info, handler)
165 }
166
167 var _RateLimitService_serviceDesc = grpc.ServiceDesc{
168 ServiceName: "pb.lyft.ratelimit.RateLimitService",
169 HandlerType: (*RateLimitServiceServer)(nil),
170 Methods: []grpc.MethodDesc{
171 {
172 MethodName: "ShouldRateLimit",
173 Handler: _RateLimitService_ShouldRateLimit_Handler,
174 },
175 },
176 Streams: []grpc.StreamDesc{},
177 Metadata: "pb/lyft/ratelimit/rls.proto",
178 }
179
View as plain text