vitess.io/vitess@v0.16.2/go/vt/proto/throttlerservice/throttlerservice_grpc.pb.go (about) 1 // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 // versions: 3 // - protoc-gen-go-grpc v1.2.0 4 // - protoc v3.21.3 5 // source: throttlerservice.proto 6 7 package throttlerservice 8 9 import ( 10 context "context" 11 grpc "google.golang.org/grpc" 12 codes "google.golang.org/grpc/codes" 13 status "google.golang.org/grpc/status" 14 throttlerdata "vitess.io/vitess/go/vt/proto/throttlerdata" 15 ) 16 17 // This is a compile-time assertion to ensure that this generated file 18 // is compatible with the grpc package it is being compiled against. 19 // Requires gRPC-Go v1.32.0 or later. 20 const _ = grpc.SupportPackageIsVersion7 21 22 // ThrottlerClient is the client API for Throttler service. 23 // 24 // 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. 25 type ThrottlerClient interface { 26 // MaxRates returns the current max rate for each throttler of the process. 27 MaxRates(ctx context.Context, in *throttlerdata.MaxRatesRequest, opts ...grpc.CallOption) (*throttlerdata.MaxRatesResponse, error) 28 // SetMaxRate allows to change the current max rate for all throttlers 29 // of the process. 30 SetMaxRate(ctx context.Context, in *throttlerdata.SetMaxRateRequest, opts ...grpc.CallOption) (*throttlerdata.SetMaxRateResponse, error) 31 // GetConfiguration returns the configuration of the MaxReplicationlag module 32 // for the given throttler or all throttlers if "throttler_name" is empty. 33 GetConfiguration(ctx context.Context, in *throttlerdata.GetConfigurationRequest, opts ...grpc.CallOption) (*throttlerdata.GetConfigurationResponse, error) 34 // UpdateConfiguration (partially) updates the configuration of the 35 // MaxReplicationlag module for the given throttler or all throttlers if 36 // "throttler_name" is empty. 37 // If "copy_zero_values" is true, fields with zero values will be copied 38 // as well. 39 UpdateConfiguration(ctx context.Context, in *throttlerdata.UpdateConfigurationRequest, opts ...grpc.CallOption) (*throttlerdata.UpdateConfigurationResponse, error) 40 // ResetConfiguration resets the configuration of the MaxReplicationlag module 41 // to the initial configuration for the given throttler or all throttlers if 42 // "throttler_name" is empty. 43 ResetConfiguration(ctx context.Context, in *throttlerdata.ResetConfigurationRequest, opts ...grpc.CallOption) (*throttlerdata.ResetConfigurationResponse, error) 44 } 45 46 type throttlerClient struct { 47 cc grpc.ClientConnInterface 48 } 49 50 func NewThrottlerClient(cc grpc.ClientConnInterface) ThrottlerClient { 51 return &throttlerClient{cc} 52 } 53 54 func (c *throttlerClient) MaxRates(ctx context.Context, in *throttlerdata.MaxRatesRequest, opts ...grpc.CallOption) (*throttlerdata.MaxRatesResponse, error) { 55 out := new(throttlerdata.MaxRatesResponse) 56 err := c.cc.Invoke(ctx, "/throttlerservice.Throttler/MaxRates", in, out, opts...) 57 if err != nil { 58 return nil, err 59 } 60 return out, nil 61 } 62 63 func (c *throttlerClient) SetMaxRate(ctx context.Context, in *throttlerdata.SetMaxRateRequest, opts ...grpc.CallOption) (*throttlerdata.SetMaxRateResponse, error) { 64 out := new(throttlerdata.SetMaxRateResponse) 65 err := c.cc.Invoke(ctx, "/throttlerservice.Throttler/SetMaxRate", in, out, opts...) 66 if err != nil { 67 return nil, err 68 } 69 return out, nil 70 } 71 72 func (c *throttlerClient) GetConfiguration(ctx context.Context, in *throttlerdata.GetConfigurationRequest, opts ...grpc.CallOption) (*throttlerdata.GetConfigurationResponse, error) { 73 out := new(throttlerdata.GetConfigurationResponse) 74 err := c.cc.Invoke(ctx, "/throttlerservice.Throttler/GetConfiguration", in, out, opts...) 75 if err != nil { 76 return nil, err 77 } 78 return out, nil 79 } 80 81 func (c *throttlerClient) UpdateConfiguration(ctx context.Context, in *throttlerdata.UpdateConfigurationRequest, opts ...grpc.CallOption) (*throttlerdata.UpdateConfigurationResponse, error) { 82 out := new(throttlerdata.UpdateConfigurationResponse) 83 err := c.cc.Invoke(ctx, "/throttlerservice.Throttler/UpdateConfiguration", in, out, opts...) 84 if err != nil { 85 return nil, err 86 } 87 return out, nil 88 } 89 90 func (c *throttlerClient) ResetConfiguration(ctx context.Context, in *throttlerdata.ResetConfigurationRequest, opts ...grpc.CallOption) (*throttlerdata.ResetConfigurationResponse, error) { 91 out := new(throttlerdata.ResetConfigurationResponse) 92 err := c.cc.Invoke(ctx, "/throttlerservice.Throttler/ResetConfiguration", in, out, opts...) 93 if err != nil { 94 return nil, err 95 } 96 return out, nil 97 } 98 99 // ThrottlerServer is the server API for Throttler service. 100 // All implementations must embed UnimplementedThrottlerServer 101 // for forward compatibility 102 type ThrottlerServer interface { 103 // MaxRates returns the current max rate for each throttler of the process. 104 MaxRates(context.Context, *throttlerdata.MaxRatesRequest) (*throttlerdata.MaxRatesResponse, error) 105 // SetMaxRate allows to change the current max rate for all throttlers 106 // of the process. 107 SetMaxRate(context.Context, *throttlerdata.SetMaxRateRequest) (*throttlerdata.SetMaxRateResponse, error) 108 // GetConfiguration returns the configuration of the MaxReplicationlag module 109 // for the given throttler or all throttlers if "throttler_name" is empty. 110 GetConfiguration(context.Context, *throttlerdata.GetConfigurationRequest) (*throttlerdata.GetConfigurationResponse, error) 111 // UpdateConfiguration (partially) updates the configuration of the 112 // MaxReplicationlag module for the given throttler or all throttlers if 113 // "throttler_name" is empty. 114 // If "copy_zero_values" is true, fields with zero values will be copied 115 // as well. 116 UpdateConfiguration(context.Context, *throttlerdata.UpdateConfigurationRequest) (*throttlerdata.UpdateConfigurationResponse, error) 117 // ResetConfiguration resets the configuration of the MaxReplicationlag module 118 // to the initial configuration for the given throttler or all throttlers if 119 // "throttler_name" is empty. 120 ResetConfiguration(context.Context, *throttlerdata.ResetConfigurationRequest) (*throttlerdata.ResetConfigurationResponse, error) 121 mustEmbedUnimplementedThrottlerServer() 122 } 123 124 // UnimplementedThrottlerServer must be embedded to have forward compatible implementations. 125 type UnimplementedThrottlerServer struct { 126 } 127 128 func (UnimplementedThrottlerServer) MaxRates(context.Context, *throttlerdata.MaxRatesRequest) (*throttlerdata.MaxRatesResponse, error) { 129 return nil, status.Errorf(codes.Unimplemented, "method MaxRates not implemented") 130 } 131 func (UnimplementedThrottlerServer) SetMaxRate(context.Context, *throttlerdata.SetMaxRateRequest) (*throttlerdata.SetMaxRateResponse, error) { 132 return nil, status.Errorf(codes.Unimplemented, "method SetMaxRate not implemented") 133 } 134 func (UnimplementedThrottlerServer) GetConfiguration(context.Context, *throttlerdata.GetConfigurationRequest) (*throttlerdata.GetConfigurationResponse, error) { 135 return nil, status.Errorf(codes.Unimplemented, "method GetConfiguration not implemented") 136 } 137 func (UnimplementedThrottlerServer) UpdateConfiguration(context.Context, *throttlerdata.UpdateConfigurationRequest) (*throttlerdata.UpdateConfigurationResponse, error) { 138 return nil, status.Errorf(codes.Unimplemented, "method UpdateConfiguration not implemented") 139 } 140 func (UnimplementedThrottlerServer) ResetConfiguration(context.Context, *throttlerdata.ResetConfigurationRequest) (*throttlerdata.ResetConfigurationResponse, error) { 141 return nil, status.Errorf(codes.Unimplemented, "method ResetConfiguration not implemented") 142 } 143 func (UnimplementedThrottlerServer) mustEmbedUnimplementedThrottlerServer() {} 144 145 // UnsafeThrottlerServer may be embedded to opt out of forward compatibility for this service. 146 // Use of this interface is not recommended, as added methods to ThrottlerServer will 147 // result in compilation errors. 148 type UnsafeThrottlerServer interface { 149 mustEmbedUnimplementedThrottlerServer() 150 } 151 152 func RegisterThrottlerServer(s grpc.ServiceRegistrar, srv ThrottlerServer) { 153 s.RegisterService(&Throttler_ServiceDesc, srv) 154 } 155 156 func _Throttler_MaxRates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 157 in := new(throttlerdata.MaxRatesRequest) 158 if err := dec(in); err != nil { 159 return nil, err 160 } 161 if interceptor == nil { 162 return srv.(ThrottlerServer).MaxRates(ctx, in) 163 } 164 info := &grpc.UnaryServerInfo{ 165 Server: srv, 166 FullMethod: "/throttlerservice.Throttler/MaxRates", 167 } 168 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 169 return srv.(ThrottlerServer).MaxRates(ctx, req.(*throttlerdata.MaxRatesRequest)) 170 } 171 return interceptor(ctx, in, info, handler) 172 } 173 174 func _Throttler_SetMaxRate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 175 in := new(throttlerdata.SetMaxRateRequest) 176 if err := dec(in); err != nil { 177 return nil, err 178 } 179 if interceptor == nil { 180 return srv.(ThrottlerServer).SetMaxRate(ctx, in) 181 } 182 info := &grpc.UnaryServerInfo{ 183 Server: srv, 184 FullMethod: "/throttlerservice.Throttler/SetMaxRate", 185 } 186 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 187 return srv.(ThrottlerServer).SetMaxRate(ctx, req.(*throttlerdata.SetMaxRateRequest)) 188 } 189 return interceptor(ctx, in, info, handler) 190 } 191 192 func _Throttler_GetConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 193 in := new(throttlerdata.GetConfigurationRequest) 194 if err := dec(in); err != nil { 195 return nil, err 196 } 197 if interceptor == nil { 198 return srv.(ThrottlerServer).GetConfiguration(ctx, in) 199 } 200 info := &grpc.UnaryServerInfo{ 201 Server: srv, 202 FullMethod: "/throttlerservice.Throttler/GetConfiguration", 203 } 204 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 205 return srv.(ThrottlerServer).GetConfiguration(ctx, req.(*throttlerdata.GetConfigurationRequest)) 206 } 207 return interceptor(ctx, in, info, handler) 208 } 209 210 func _Throttler_UpdateConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 211 in := new(throttlerdata.UpdateConfigurationRequest) 212 if err := dec(in); err != nil { 213 return nil, err 214 } 215 if interceptor == nil { 216 return srv.(ThrottlerServer).UpdateConfiguration(ctx, in) 217 } 218 info := &grpc.UnaryServerInfo{ 219 Server: srv, 220 FullMethod: "/throttlerservice.Throttler/UpdateConfiguration", 221 } 222 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 223 return srv.(ThrottlerServer).UpdateConfiguration(ctx, req.(*throttlerdata.UpdateConfigurationRequest)) 224 } 225 return interceptor(ctx, in, info, handler) 226 } 227 228 func _Throttler_ResetConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 229 in := new(throttlerdata.ResetConfigurationRequest) 230 if err := dec(in); err != nil { 231 return nil, err 232 } 233 if interceptor == nil { 234 return srv.(ThrottlerServer).ResetConfiguration(ctx, in) 235 } 236 info := &grpc.UnaryServerInfo{ 237 Server: srv, 238 FullMethod: "/throttlerservice.Throttler/ResetConfiguration", 239 } 240 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 241 return srv.(ThrottlerServer).ResetConfiguration(ctx, req.(*throttlerdata.ResetConfigurationRequest)) 242 } 243 return interceptor(ctx, in, info, handler) 244 } 245 246 // Throttler_ServiceDesc is the grpc.ServiceDesc for Throttler service. 247 // It's only intended for direct use with grpc.RegisterService, 248 // and not to be introspected or modified (even as a copy) 249 var Throttler_ServiceDesc = grpc.ServiceDesc{ 250 ServiceName: "throttlerservice.Throttler", 251 HandlerType: (*ThrottlerServer)(nil), 252 Methods: []grpc.MethodDesc{ 253 { 254 MethodName: "MaxRates", 255 Handler: _Throttler_MaxRates_Handler, 256 }, 257 { 258 MethodName: "SetMaxRate", 259 Handler: _Throttler_SetMaxRate_Handler, 260 }, 261 { 262 MethodName: "GetConfiguration", 263 Handler: _Throttler_GetConfiguration_Handler, 264 }, 265 { 266 MethodName: "UpdateConfiguration", 267 Handler: _Throttler_UpdateConfiguration_Handler, 268 }, 269 { 270 MethodName: "ResetConfiguration", 271 Handler: _Throttler_ResetConfiguration_Handler, 272 }, 273 }, 274 Streams: []grpc.StreamDesc{}, 275 Metadata: "throttlerservice.proto", 276 }