From 9afc4193bf8688467f352e8b1565f3d65187a5e4 Mon Sep 17 00:00:00 2001 From: Martin Buhr Date: Thu, 15 Aug 2024 18:56:48 +1200 Subject: [PATCH] connect to mdcb using grpc, allow for grpc encoding to be human readable (json) --- apidef/oas/linter_test.go | 2 +- config/config.go | 4 +- dispatcher/handler.pb.go | 2157 ++++++++++++++++++++++ dispatcher/handler_grpc.pb.go | 996 ++++++++++ gateway/api_definition.go | 2 +- gateway/api_loader.go | 8 +- gateway/grpc_storage_handler.go | 862 +++++++++ gateway/health_check.go | 9 +- gateway/rpc_storage_handler.go | 144 +- gateway/server.go | 88 +- gateway/testutil.go | 4 +- internal/graphql/graphql_request.go | 2 +- internal/graphql/graphql_request_test.go | 4 +- rpc/grpcHandler.go | 42 + rpc/rpc_analytics_purger.go | 6 +- rpc/rpc_client.go | 138 +- rpc/rpc_client_test.go | 4 +- storage/connection_handler.go | 5 - storage/mdcb_storage.go | 2 +- storage/storage.go | 7 + 20 files changed, 4347 insertions(+), 139 deletions(-) create mode 100644 dispatcher/handler.pb.go create mode 100644 dispatcher/handler_grpc.pb.go create mode 100644 gateway/grpc_storage_handler.go create mode 100644 rpc/grpcHandler.go diff --git a/apidef/oas/linter_test.go b/apidef/oas/linter_test.go index eb90e250998..307c8ae40c7 100644 --- a/apidef/oas/linter_test.go +++ b/apidef/oas/linter_test.go @@ -78,7 +78,7 @@ func TestXTykGateway_Lint(t *testing.T) { settings.Server.EventHandlers[i].Webhook.CoolDownPeriod = ReadableDuration(time.Second * 20) } - for idx, _ := range settings.Middleware.Operations { + for idx := range settings.Middleware.Operations { settings.Middleware.Operations[idx].CircuitBreaker.Threshold = 0.5 } diff --git a/config/config.go b/config/config.go index 9d0d54f84df..c6621cfb4c0 100644 --- a/config/config.go +++ b/config/config.go @@ -310,7 +310,9 @@ type WebHookHandlerConf struct { type SlaveOptionsConfig struct { // Set to `true` to connect a worker Gateway using RPC. - UseRPC bool `json:"use_rpc"` + UseRPC bool `json:"use_rpc"` + RPCType string `json:"rpc_type"` + GRPCForceJSON bool `json:"grpc_force_json"` // Set this option to `true` to use an SSL RPC connection. UseSSL bool `json:"use_ssl"` diff --git a/dispatcher/handler.pb.go b/dispatcher/handler.pb.go new file mode 100644 index 00000000000..03c93afd92d --- /dev/null +++ b/dispatcher/handler.pb.go @@ -0,0 +1,2157 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.3 +// source: handler.proto + +package dispatcher + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + _ "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type LoginRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + UserKey string `protobuf:"bytes,2,opt,name=user_key,json=userKey,proto3" json:"user_key,omitempty"` +} + +func (x *LoginRequest) Reset() { + *x = LoginRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginRequest) ProtoMessage() {} + +func (x *LoginRequest) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead. +func (*LoginRequest) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{0} +} + +func (x *LoginRequest) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *LoginRequest) GetUserKey() string { + if x != nil { + return x.UserKey + } + return "" +} + +type LoginResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` +} + +func (x *LoginResponse) Reset() { + *x = LoginResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginResponse) ProtoMessage() {} + +func (x *LoginResponse) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead. +func (*LoginResponse) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{1} +} + +func (x *LoginResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +type GroupLoginRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserKey string `protobuf:"bytes,1,opt,name=user_key,json=userKey,proto3" json:"user_key,omitempty"` + GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + ForceSync bool `protobuf:"varint,3,opt,name=force_sync,json=forceSync,proto3" json:"force_sync,omitempty"` + Node []byte `protobuf:"bytes,4,opt,name=node,proto3" json:"node,omitempty"` +} + +func (x *GroupLoginRequest) Reset() { + *x = GroupLoginRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupLoginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupLoginRequest) ProtoMessage() {} + +func (x *GroupLoginRequest) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupLoginRequest.ProtoReflect.Descriptor instead. +func (*GroupLoginRequest) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{2} +} + +func (x *GroupLoginRequest) GetUserKey() string { + if x != nil { + return x.UserKey + } + return "" +} + +func (x *GroupLoginRequest) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *GroupLoginRequest) GetForceSync() bool { + if x != nil { + return x.ForceSync + } + return false +} + +func (x *GroupLoginRequest) GetNode() []byte { + if x != nil { + return x.Node + } + return nil +} + +type KeyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + KeyName string `protobuf:"bytes,2,opt,name=key_name,json=keyName,proto3" json:"key_name,omitempty"` +} + +func (x *KeyRequest) Reset() { + *x = KeyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeyRequest) ProtoMessage() {} + +func (x *KeyRequest) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KeyRequest.ProtoReflect.Descriptor instead. +func (*KeyRequest) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{3} +} + +func (x *KeyRequest) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *KeyRequest) GetKeyName() string { + if x != nil { + return x.KeyName + } + return "" +} + +type KeyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *KeyResponse) Reset() { + *x = KeyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeyResponse) ProtoMessage() {} + +func (x *KeyResponse) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KeyResponse.ProtoReflect.Descriptor instead. +func (*KeyResponse) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{4} +} + +func (x *KeyResponse) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type SetKeyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + Data *InboundData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *SetKeyRequest) Reset() { + *x = SetKeyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetKeyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetKeyRequest) ProtoMessage() {} + +func (x *SetKeyRequest) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetKeyRequest.ProtoReflect.Descriptor instead. +func (*SetKeyRequest) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{5} +} + +func (x *SetKeyRequest) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *SetKeyRequest) GetData() *InboundData { + if x != nil { + return x.Data + } + return nil +} + +type ExpResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Expiration int64 `protobuf:"varint,1,opt,name=expiration,proto3" json:"expiration,omitempty"` +} + +func (x *ExpResponse) Reset() { + *x = ExpResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExpResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExpResponse) ProtoMessage() {} + +func (x *ExpResponse) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExpResponse.ProtoReflect.Descriptor instead. +func (*ExpResponse) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{6} +} + +func (x *ExpResponse) GetExpiration() int64 { + if x != nil { + return x.Expiration + } + return 0 +} + +type KeysResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Keys []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` +} + +func (x *KeysResponse) Reset() { + *x = KeysResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeysResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeysResponse) ProtoMessage() {} + +func (x *KeysResponse) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KeysResponse.ProtoReflect.Descriptor instead. +func (*KeysResponse) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{7} +} + +func (x *KeysResponse) GetKeys() []string { + if x != nil { + return x.Keys + } + return nil +} + +type DeleteResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` +} + +func (x *DeleteResponse) Reset() { + *x = DeleteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteResponse) ProtoMessage() {} + +func (x *DeleteResponse) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. +func (*DeleteResponse) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{8} +} + +func (x *DeleteResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +type SearchRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + SearchString string `protobuf:"bytes,2,opt,name=search_string,json=searchString,proto3" json:"search_string,omitempty"` +} + +func (x *SearchRequest) Reset() { + *x = SearchRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchRequest) ProtoMessage() {} + +func (x *SearchRequest) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead. +func (*SearchRequest) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{9} +} + +func (x *SearchRequest) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *SearchRequest) GetSearchString() string { + if x != nil { + return x.SearchString + } + return "" +} + +type KeysValuesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Keys []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` + Values []string `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"` +} + +func (x *KeysValuesResponse) Reset() { + *x = KeysValuesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeysValuesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeysValuesResponse) ProtoMessage() {} + +func (x *KeysValuesResponse) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KeysValuesResponse.ProtoReflect.Descriptor instead. +func (*KeysValuesResponse) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{10} +} + +func (x *KeysValuesResponse) GetKeys() []string { + if x != nil { + return x.Keys + } + return nil +} + +func (x *KeysValuesResponse) GetValues() []string { + if x != nil { + return x.Values + } + return nil +} + +type DeleteKeysRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + Keys []string `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` +} + +func (x *DeleteKeysRequest) Reset() { + *x = DeleteKeysRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteKeysRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteKeysRequest) ProtoMessage() {} + +func (x *DeleteKeysRequest) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteKeysRequest.ProtoReflect.Descriptor instead. +func (*DeleteKeysRequest) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{11} +} + +func (x *DeleteKeysRequest) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *DeleteKeysRequest) GetKeys() []string { + if x != nil { + return x.Keys + } + return nil +} + +type IncrementRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + Data *InboundData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *IncrementRequest) Reset() { + *x = IncrementRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IncrementRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IncrementRequest) ProtoMessage() {} + +func (x *IncrementRequest) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IncrementRequest.ProtoReflect.Descriptor instead. +func (*IncrementRequest) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{12} +} + +func (x *IncrementRequest) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *IncrementRequest) GetData() *InboundData { + if x != nil { + return x.Data + } + return nil +} + +type IncrementResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *IncrementResponse) Reset() { + *x = IncrementResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IncrementResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IncrementResponse) ProtoMessage() {} + +func (x *IncrementResponse) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IncrementResponse.ProtoReflect.Descriptor instead. +func (*IncrementResponse) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{13} +} + +func (x *IncrementResponse) GetValue() int64 { + if x != nil { + return x.Value + } + return 0 +} + +type AppendToSetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + Data *InboundData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *AppendToSetRequest) Reset() { + *x = AppendToSetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AppendToSetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AppendToSetRequest) ProtoMessage() {} + +func (x *AppendToSetRequest) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AppendToSetRequest.ProtoReflect.Descriptor instead. +func (*AppendToSetRequest) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{14} +} + +func (x *AppendToSetRequest) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *AppendToSetRequest) GetData() *InboundData { + if x != nil { + return x.Data + } + return nil +} + +type SetRollingWindowRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + Data *InboundData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *SetRollingWindowRequest) Reset() { + *x = SetRollingWindowRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetRollingWindowRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetRollingWindowRequest) ProtoMessage() {} + +func (x *SetRollingWindowRequest) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetRollingWindowRequest.ProtoReflect.Descriptor instead. +func (*SetRollingWindowRequest) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{15} +} + +func (x *SetRollingWindowRequest) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *SetRollingWindowRequest) GetData() *InboundData { + if x != nil { + return x.Data + } + return nil +} + +type SetRollingWindowResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *SetRollingWindowResponse) Reset() { + *x = SetRollingWindowResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetRollingWindowResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetRollingWindowResponse) ProtoMessage() {} + +func (x *SetRollingWindowResponse) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetRollingWindowResponse.ProtoReflect.Descriptor instead. +func (*SetRollingWindowResponse) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{16} +} + +func (x *SetRollingWindowResponse) GetCount() int32 { + if x != nil { + return x.Count + } + return 0 +} + +type DefRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OrgId string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"` + Tags []string `protobuf:"bytes,2,rep,name=tags,proto3" json:"tags,omitempty"` + LoadOas bool `protobuf:"varint,3,opt,name=load_oas,json=loadOas,proto3" json:"load_oas,omitempty"` +} + +func (x *DefRequest) Reset() { + *x = DefRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DefRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DefRequest) ProtoMessage() {} + +func (x *DefRequest) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DefRequest.ProtoReflect.Descriptor instead. +func (*DefRequest) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{17} +} + +func (x *DefRequest) GetOrgId() string { + if x != nil { + return x.OrgId + } + return "" +} + +func (x *DefRequest) GetTags() []string { + if x != nil { + return x.Tags + } + return nil +} + +func (x *DefRequest) GetLoadOas() bool { + if x != nil { + return x.LoadOas + } + return false +} + +type ApiDefinitionsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Definitions string `protobuf:"bytes,1,opt,name=definitions,proto3" json:"definitions,omitempty"` +} + +func (x *ApiDefinitionsResponse) Reset() { + *x = ApiDefinitionsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApiDefinitionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApiDefinitionsResponse) ProtoMessage() {} + +func (x *ApiDefinitionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApiDefinitionsResponse.ProtoReflect.Descriptor instead. +func (*ApiDefinitionsResponse) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{18} +} + +func (x *ApiDefinitionsResponse) GetDefinitions() string { + if x != nil { + return x.Definitions + } + return "" +} + +type OrgIdRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + OrgId string `protobuf:"bytes,2,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"` +} + +func (x *OrgIdRequest) Reset() { + *x = OrgIdRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OrgIdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrgIdRequest) ProtoMessage() {} + +func (x *OrgIdRequest) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OrgIdRequest.ProtoReflect.Descriptor instead. +func (*OrgIdRequest) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{19} +} + +func (x *OrgIdRequest) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *OrgIdRequest) GetOrgId() string { + if x != nil { + return x.OrgId + } + return "" +} + +type PoliciesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Policies string `protobuf:"bytes,1,opt,name=policies,proto3" json:"policies,omitempty"` +} + +func (x *PoliciesResponse) Reset() { + *x = PoliciesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PoliciesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PoliciesResponse) ProtoMessage() {} + +func (x *PoliciesResponse) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PoliciesResponse.ProtoReflect.Descriptor instead. +func (*PoliciesResponse) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{20} +} + +func (x *PoliciesResponse) GetPolicies() string { + if x != nil { + return x.Policies + } + return "" +} + +type AnalyticsDataRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *AnalyticsDataRequest) Reset() { + *x = AnalyticsDataRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnalyticsDataRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnalyticsDataRequest) ProtoMessage() {} + +func (x *AnalyticsDataRequest) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnalyticsDataRequest.ProtoReflect.Descriptor instead. +func (*AnalyticsDataRequest) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{21} +} + +func (x *AnalyticsDataRequest) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *AnalyticsDataRequest) GetData() string { + if x != nil { + return x.Data + } + return "" +} + +type ReloadResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReloadRequired bool `protobuf:"varint,1,opt,name=reload_required,json=reloadRequired,proto3" json:"reload_required,omitempty"` +} + +func (x *ReloadResponse) Reset() { + *x = ReloadResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReloadResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReloadResponse) ProtoMessage() {} + +func (x *ReloadResponse) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReloadResponse.ProtoReflect.Descriptor instead. +func (*ReloadResponse) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{22} +} + +func (x *ReloadResponse) GetReloadRequired() bool { + if x != nil { + return x.ReloadRequired + } + return false +} + +type KeySpaceUpdateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Updates []string `protobuf:"bytes,1,rep,name=updates,proto3" json:"updates,omitempty"` +} + +func (x *KeySpaceUpdateResponse) Reset() { + *x = KeySpaceUpdateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeySpaceUpdateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeySpaceUpdateResponse) ProtoMessage() {} + +func (x *KeySpaceUpdateResponse) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KeySpaceUpdateResponse.ProtoReflect.Descriptor instead. +func (*KeySpaceUpdateResponse) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{23} +} + +func (x *KeySpaceUpdateResponse) GetUpdates() []string { + if x != nil { + return x.Updates + } + return nil +} + +type GroupKeySpaceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OrgId string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"` + GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` +} + +func (x *GroupKeySpaceRequest) Reset() { + *x = GroupKeySpaceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupKeySpaceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupKeySpaceRequest) ProtoMessage() {} + +func (x *GroupKeySpaceRequest) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupKeySpaceRequest.ProtoReflect.Descriptor instead. +func (*GroupKeySpaceRequest) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{24} +} + +func (x *GroupKeySpaceRequest) GetOrgId() string { + if x != nil { + return x.OrgId + } + return "" +} + +func (x *GroupKeySpaceRequest) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +type PingResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pong bool `protobuf:"varint,1,opt,name=pong,proto3" json:"pong,omitempty"` +} + +func (x *PingResponse) Reset() { + *x = PingResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PingResponse) ProtoMessage() {} + +func (x *PingResponse) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PingResponse.ProtoReflect.Descriptor instead. +func (*PingResponse) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{25} +} + +func (x *PingResponse) GetPong() bool { + if x != nil { + return x.Pong + } + return false +} + +type InboundData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeyName string `protobuf:"bytes,1,opt,name=key_name,json=keyName,proto3" json:"key_name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + SessionState string `protobuf:"bytes,3,opt,name=session_state,json=sessionState,proto3" json:"session_state,omitempty"` + Timeout int64 `protobuf:"varint,4,opt,name=timeout,proto3" json:"timeout,omitempty"` + Per int64 `protobuf:"varint,5,opt,name=per,proto3" json:"per,omitempty"` + Expire int64 `protobuf:"varint,6,opt,name=expire,proto3" json:"expire,omitempty"` +} + +func (x *InboundData) Reset() { + *x = InboundData{} + if protoimpl.UnsafeEnabled { + mi := &file_handler_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InboundData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InboundData) ProtoMessage() {} + +func (x *InboundData) ProtoReflect() protoreflect.Message { + mi := &file_handler_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InboundData.ProtoReflect.Descriptor instead. +func (*InboundData) Descriptor() ([]byte, []int) { + return file_handler_proto_rawDescGZIP(), []int{26} +} + +func (x *InboundData) GetKeyName() string { + if x != nil { + return x.KeyName + } + return "" +} + +func (x *InboundData) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *InboundData) GetSessionState() string { + if x != nil { + return x.SessionState + } + return "" +} + +func (x *InboundData) GetTimeout() int64 { + if x != nil { + return x.Timeout + } + return 0 +} + +func (x *InboundData) GetPer() int64 { + if x != nil { + return x.Per + } + return 0 +} + +func (x *InboundData) GetExpire() int64 { + if x != nil { + return x.Expire + } + return 0 +} + +var File_handler_proto protoreflect.FileDescriptor + +var file_handler_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x46, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x4b, 0x65, 0x79, 0x22, 0x29, + 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x7c, 0x0a, 0x11, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, + 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x4b, 0x65, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, 0x73, 0x79, + 0x6e, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x53, + 0x79, 0x6e, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0x44, 0x0a, 0x0a, 0x4b, 0x65, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x23, 0x0a, + 0x0b, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0x56, 0x0a, 0x0d, 0x53, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, + 0x12, 0x28, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, + 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x2d, 0x0a, 0x0b, 0x45, 0x78, + 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x65, + 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x22, 0x0a, 0x0c, 0x4b, 0x65, 0x79, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x22, 0x2a, 0x0a, + 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x51, 0x0a, 0x0d, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x40, 0x0a, 0x12, + 0x4b, 0x65, 0x79, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x44, + 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, + 0x6b, 0x65, 0x79, 0x73, 0x22, 0x59, 0x0a, 0x10, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x49, 0x6e, + 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, + 0x29, 0x0a, 0x11, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x5b, 0x0a, 0x12, 0x41, 0x70, + 0x70, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x53, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x68, 0x61, + 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x44, 0x61, 0x74, + 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x60, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x52, 0x6f, + 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, + 0x28, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x44, + 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x30, 0x0a, 0x18, 0x53, 0x65, 0x74, + 0x52, 0x6f, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x52, 0x0a, 0x0a, 0x44, + 0x65, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, + 0x74, 0x61, 0x67, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x6f, 0x61, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6c, 0x6f, 0x61, 0x64, 0x4f, 0x61, 0x73, 0x22, + 0x3a, 0x0a, 0x16, 0x41, 0x70, 0x69, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x66, + 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x42, 0x0a, 0x0c, 0x4f, + 0x72, 0x67, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x22, + 0x2e, 0x0a, 0x10, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x22, + 0x47, 0x0a, 0x14, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x44, 0x61, 0x74, 0x61, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x39, 0x0a, 0x0e, 0x52, 0x65, 0x6c, 0x6f, + 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, + 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0e, 0x72, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x69, + 0x72, 0x65, 0x64, 0x22, 0x32, 0x0a, 0x16, 0x4b, 0x65, 0x79, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x22, 0x48, 0x0a, 0x14, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x4b, 0x65, 0x79, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, + 0x64, 0x22, 0x22, 0x0a, 0x0c, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x22, 0xa7, 0x01, 0x0a, 0x0b, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, + 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x74, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x74, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x03, 0x70, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x32, + 0xee, 0x0c, 0x0a, 0x07, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x05, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x15, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x68, 0x61, + 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x57, 0x69, 0x74, 0x68, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1a, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x16, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x47, 0x65, 0x74, + 0x4b, 0x65, 0x79, 0x12, 0x13, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x4b, 0x65, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, + 0x65, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, + 0x0a, 0x06, 0x53, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x16, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, + 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x33, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x45, + 0x78, 0x70, 0x12, 0x13, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x4b, 0x65, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x72, 0x2e, 0x45, 0x78, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, + 0x07, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x13, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, + 0x65, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, + 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, + 0x79, 0x12, 0x13, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x3c, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x61, 0x77, 0x4b, 0x65, 0x79, 0x12, + 0x13, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, + 0x10, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x41, 0x6e, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x16, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x68, 0x61, 0x6e, 0x64, + 0x6c, 0x65, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, + 0x73, 0x41, 0x6e, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x68, + 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0a, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x1a, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x09, + 0x44, 0x65, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x13, 0x2e, 0x68, 0x61, 0x6e, 0x64, + 0x6c, 0x65, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4c, 0x0a, 0x13, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x57, 0x69, 0x74, 0x68, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x12, 0x19, 0x2e, + 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, + 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0b, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x54, 0x6f, + 0x53, 0x65, 0x74, 0x12, 0x1b, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x41, 0x70, + 0x70, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x53, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x57, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x52, + 0x6f, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x20, 0x2e, 0x68, + 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x6c, 0x69, 0x6e, + 0x67, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, + 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x6c, + 0x69, 0x6e, 0x67, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x49, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x41, 0x70, 0x69, 0x44, 0x65, 0x66, 0x69, 0x6e, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x13, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, + 0x2e, 0x44, 0x65, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x68, 0x61, + 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x41, 0x70, 0x69, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0b, + 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x15, 0x2e, 0x68, 0x61, + 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x4f, 0x72, 0x67, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x6f, 0x6c, + 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, + 0x12, 0x50, 0x75, 0x72, 0x67, 0x65, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x1d, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x41, 0x6e, + 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x55, 0x0a, 0x1c, 0x50, 0x75, + 0x72, 0x67, 0x65, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x44, 0x61, 0x74, 0x61, + 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1d, 0x2e, 0x68, 0x61, 0x6e, + 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x44, 0x61, + 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x12, 0x3d, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x6f, 0x61, 0x64, + 0x12, 0x15, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x4f, 0x72, 0x67, 0x49, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x72, 0x2e, 0x52, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x4b, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x15, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, + 0x4f, 0x72, 0x67, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x68, + 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, + 0x16, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4b, 0x65, 0x79, 0x53, 0x70, 0x61, 0x63, + 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x72, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4b, 0x65, 0x79, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, + 0x2e, 0x4b, 0x65, 0x79, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x15, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x72, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, + 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x1a, 0x2e, 0x68, + 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, + 0x79, 0x6b, 0x54, 0x65, 0x63, 0x68, 0x6e, 0x6f, 0x6c, 0x6f, 0x67, 0x69, 0x65, 0x73, 0x2f, 0x74, + 0x79, 0x6b, 0x2d, 0x73, 0x69, 0x6e, 0x6b, 0x2f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_handler_proto_rawDescOnce sync.Once + file_handler_proto_rawDescData = file_handler_proto_rawDesc +) + +func file_handler_proto_rawDescGZIP() []byte { + file_handler_proto_rawDescOnce.Do(func() { + file_handler_proto_rawDescData = protoimpl.X.CompressGZIP(file_handler_proto_rawDescData) + }) + return file_handler_proto_rawDescData +} + +var file_handler_proto_msgTypes = make([]protoimpl.MessageInfo, 27) +var file_handler_proto_goTypes = []any{ + (*LoginRequest)(nil), // 0: handler.LoginRequest + (*LoginResponse)(nil), // 1: handler.LoginResponse + (*GroupLoginRequest)(nil), // 2: handler.GroupLoginRequest + (*KeyRequest)(nil), // 3: handler.KeyRequest + (*KeyResponse)(nil), // 4: handler.KeyResponse + (*SetKeyRequest)(nil), // 5: handler.SetKeyRequest + (*ExpResponse)(nil), // 6: handler.ExpResponse + (*KeysResponse)(nil), // 7: handler.KeysResponse + (*DeleteResponse)(nil), // 8: handler.DeleteResponse + (*SearchRequest)(nil), // 9: handler.SearchRequest + (*KeysValuesResponse)(nil), // 10: handler.KeysValuesResponse + (*DeleteKeysRequest)(nil), // 11: handler.DeleteKeysRequest + (*IncrementRequest)(nil), // 12: handler.IncrementRequest + (*IncrementResponse)(nil), // 13: handler.IncrementResponse + (*AppendToSetRequest)(nil), // 14: handler.AppendToSetRequest + (*SetRollingWindowRequest)(nil), // 15: handler.SetRollingWindowRequest + (*SetRollingWindowResponse)(nil), // 16: handler.SetRollingWindowResponse + (*DefRequest)(nil), // 17: handler.DefRequest + (*ApiDefinitionsResponse)(nil), // 18: handler.ApiDefinitionsResponse + (*OrgIdRequest)(nil), // 19: handler.OrgIdRequest + (*PoliciesResponse)(nil), // 20: handler.PoliciesResponse + (*AnalyticsDataRequest)(nil), // 21: handler.AnalyticsDataRequest + (*ReloadResponse)(nil), // 22: handler.ReloadResponse + (*KeySpaceUpdateResponse)(nil), // 23: handler.KeySpaceUpdateResponse + (*GroupKeySpaceRequest)(nil), // 24: handler.GroupKeySpaceRequest + (*PingResponse)(nil), // 25: handler.PingResponse + (*InboundData)(nil), // 26: handler.InboundData + (*emptypb.Empty)(nil), // 27: google.protobuf.Empty +} +var file_handler_proto_depIdxs = []int32{ + 26, // 0: handler.SetKeyRequest.data:type_name -> handler.InboundData + 26, // 1: handler.IncrementRequest.data:type_name -> handler.InboundData + 26, // 2: handler.AppendToSetRequest.data:type_name -> handler.InboundData + 26, // 3: handler.SetRollingWindowRequest.data:type_name -> handler.InboundData + 0, // 4: handler.Handler.Login:input_type -> handler.LoginRequest + 2, // 5: handler.Handler.LoginWithGroup:input_type -> handler.GroupLoginRequest + 3, // 6: handler.Handler.GetKey:input_type -> handler.KeyRequest + 5, // 7: handler.Handler.SetKey:input_type -> handler.SetKeyRequest + 3, // 8: handler.Handler.GetExp:input_type -> handler.KeyRequest + 3, // 9: handler.Handler.GetKeys:input_type -> handler.KeyRequest + 3, // 10: handler.Handler.DeleteKey:input_type -> handler.KeyRequest + 3, // 11: handler.Handler.DeleteRawKey:input_type -> handler.KeyRequest + 9, // 12: handler.Handler.GetKeysAndValues:input_type -> handler.SearchRequest + 9, // 13: handler.Handler.GetKeysAndValuesWithFilter:input_type -> handler.SearchRequest + 11, // 14: handler.Handler.DeleteKeys:input_type -> handler.DeleteKeysRequest + 3, // 15: handler.Handler.Decrement:input_type -> handler.KeyRequest + 12, // 16: handler.Handler.IncrementWithExpire:input_type -> handler.IncrementRequest + 14, // 17: handler.Handler.AppendToSet:input_type -> handler.AppendToSetRequest + 15, // 18: handler.Handler.SetRollingWindow:input_type -> handler.SetRollingWindowRequest + 17, // 19: handler.Handler.GetApiDefinitions:input_type -> handler.DefRequest + 19, // 20: handler.Handler.GetPolicies:input_type -> handler.OrgIdRequest + 21, // 21: handler.Handler.PurgeAnalyticsData:input_type -> handler.AnalyticsDataRequest + 21, // 22: handler.Handler.PurgeAnalyticsDataAggregated:input_type -> handler.AnalyticsDataRequest + 19, // 23: handler.Handler.CheckReload:input_type -> handler.OrgIdRequest + 19, // 24: handler.Handler.GetKeySpaceUpdate:input_type -> handler.OrgIdRequest + 24, // 25: handler.Handler.GetGroupKeySpaceUpdate:input_type -> handler.GroupKeySpaceRequest + 27, // 26: handler.Handler.Ping:input_type -> google.protobuf.Empty + 2, // 27: handler.Handler.Disconnect:input_type -> handler.GroupLoginRequest + 1, // 28: handler.Handler.Login:output_type -> handler.LoginResponse + 1, // 29: handler.Handler.LoginWithGroup:output_type -> handler.LoginResponse + 4, // 30: handler.Handler.GetKey:output_type -> handler.KeyResponse + 27, // 31: handler.Handler.SetKey:output_type -> google.protobuf.Empty + 6, // 32: handler.Handler.GetExp:output_type -> handler.ExpResponse + 7, // 33: handler.Handler.GetKeys:output_type -> handler.KeysResponse + 8, // 34: handler.Handler.DeleteKey:output_type -> handler.DeleteResponse + 8, // 35: handler.Handler.DeleteRawKey:output_type -> handler.DeleteResponse + 10, // 36: handler.Handler.GetKeysAndValues:output_type -> handler.KeysValuesResponse + 10, // 37: handler.Handler.GetKeysAndValuesWithFilter:output_type -> handler.KeysValuesResponse + 8, // 38: handler.Handler.DeleteKeys:output_type -> handler.DeleteResponse + 27, // 39: handler.Handler.Decrement:output_type -> google.protobuf.Empty + 13, // 40: handler.Handler.IncrementWithExpire:output_type -> handler.IncrementResponse + 27, // 41: handler.Handler.AppendToSet:output_type -> google.protobuf.Empty + 16, // 42: handler.Handler.SetRollingWindow:output_type -> handler.SetRollingWindowResponse + 18, // 43: handler.Handler.GetApiDefinitions:output_type -> handler.ApiDefinitionsResponse + 20, // 44: handler.Handler.GetPolicies:output_type -> handler.PoliciesResponse + 27, // 45: handler.Handler.PurgeAnalyticsData:output_type -> google.protobuf.Empty + 27, // 46: handler.Handler.PurgeAnalyticsDataAggregated:output_type -> google.protobuf.Empty + 22, // 47: handler.Handler.CheckReload:output_type -> handler.ReloadResponse + 23, // 48: handler.Handler.GetKeySpaceUpdate:output_type -> handler.KeySpaceUpdateResponse + 23, // 49: handler.Handler.GetGroupKeySpaceUpdate:output_type -> handler.KeySpaceUpdateResponse + 25, // 50: handler.Handler.Ping:output_type -> handler.PingResponse + 27, // 51: handler.Handler.Disconnect:output_type -> google.protobuf.Empty + 28, // [28:52] is the sub-list for method output_type + 4, // [4:28] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_handler_proto_init() } +func file_handler_proto_init() { + if File_handler_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_handler_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*LoginRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*LoginResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*GroupLoginRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*KeyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*KeyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[5].Exporter = func(v any, i int) any { + switch v := v.(*SetKeyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[6].Exporter = func(v any, i int) any { + switch v := v.(*ExpResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[7].Exporter = func(v any, i int) any { + switch v := v.(*KeysResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[8].Exporter = func(v any, i int) any { + switch v := v.(*DeleteResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[9].Exporter = func(v any, i int) any { + switch v := v.(*SearchRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[10].Exporter = func(v any, i int) any { + switch v := v.(*KeysValuesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[11].Exporter = func(v any, i int) any { + switch v := v.(*DeleteKeysRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[12].Exporter = func(v any, i int) any { + switch v := v.(*IncrementRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[13].Exporter = func(v any, i int) any { + switch v := v.(*IncrementResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[14].Exporter = func(v any, i int) any { + switch v := v.(*AppendToSetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[15].Exporter = func(v any, i int) any { + switch v := v.(*SetRollingWindowRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[16].Exporter = func(v any, i int) any { + switch v := v.(*SetRollingWindowResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[17].Exporter = func(v any, i int) any { + switch v := v.(*DefRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[18].Exporter = func(v any, i int) any { + switch v := v.(*ApiDefinitionsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[19].Exporter = func(v any, i int) any { + switch v := v.(*OrgIdRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[20].Exporter = func(v any, i int) any { + switch v := v.(*PoliciesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[21].Exporter = func(v any, i int) any { + switch v := v.(*AnalyticsDataRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[22].Exporter = func(v any, i int) any { + switch v := v.(*ReloadResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[23].Exporter = func(v any, i int) any { + switch v := v.(*KeySpaceUpdateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[24].Exporter = func(v any, i int) any { + switch v := v.(*GroupKeySpaceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[25].Exporter = func(v any, i int) any { + switch v := v.(*PingResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_handler_proto_msgTypes[26].Exporter = func(v any, i int) any { + switch v := v.(*InboundData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_handler_proto_rawDesc, + NumEnums: 0, + NumMessages: 27, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_handler_proto_goTypes, + DependencyIndexes: file_handler_proto_depIdxs, + MessageInfos: file_handler_proto_msgTypes, + }.Build() + File_handler_proto = out.File + file_handler_proto_rawDesc = nil + file_handler_proto_goTypes = nil + file_handler_proto_depIdxs = nil +} diff --git a/dispatcher/handler_grpc.pb.go b/dispatcher/handler_grpc.pb.go new file mode 100644 index 00000000000..b39274fc31d --- /dev/null +++ b/dispatcher/handler_grpc.pb.go @@ -0,0 +1,996 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.27.3 +// source: handler.proto + +package dispatcher + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Handler_Login_FullMethodName = "/handler.Handler/Login" + Handler_LoginWithGroup_FullMethodName = "/handler.Handler/LoginWithGroup" + Handler_GetKey_FullMethodName = "/handler.Handler/GetKey" + Handler_SetKey_FullMethodName = "/handler.Handler/SetKey" + Handler_GetExp_FullMethodName = "/handler.Handler/GetExp" + Handler_GetKeys_FullMethodName = "/handler.Handler/GetKeys" + Handler_DeleteKey_FullMethodName = "/handler.Handler/DeleteKey" + Handler_DeleteRawKey_FullMethodName = "/handler.Handler/DeleteRawKey" + Handler_GetKeysAndValues_FullMethodName = "/handler.Handler/GetKeysAndValues" + Handler_GetKeysAndValuesWithFilter_FullMethodName = "/handler.Handler/GetKeysAndValuesWithFilter" + Handler_DeleteKeys_FullMethodName = "/handler.Handler/DeleteKeys" + Handler_Decrement_FullMethodName = "/handler.Handler/Decrement" + Handler_IncrementWithExpire_FullMethodName = "/handler.Handler/IncrementWithExpire" + Handler_AppendToSet_FullMethodName = "/handler.Handler/AppendToSet" + Handler_SetRollingWindow_FullMethodName = "/handler.Handler/SetRollingWindow" + Handler_GetApiDefinitions_FullMethodName = "/handler.Handler/GetApiDefinitions" + Handler_GetPolicies_FullMethodName = "/handler.Handler/GetPolicies" + Handler_PurgeAnalyticsData_FullMethodName = "/handler.Handler/PurgeAnalyticsData" + Handler_PurgeAnalyticsDataAggregated_FullMethodName = "/handler.Handler/PurgeAnalyticsDataAggregated" + Handler_CheckReload_FullMethodName = "/handler.Handler/CheckReload" + Handler_GetKeySpaceUpdate_FullMethodName = "/handler.Handler/GetKeySpaceUpdate" + Handler_GetGroupKeySpaceUpdate_FullMethodName = "/handler.Handler/GetGroupKeySpaceUpdate" + Handler_Ping_FullMethodName = "/handler.Handler/Ping" + Handler_Disconnect_FullMethodName = "/handler.Handler/Disconnect" +) + +// HandlerClient is the client API for Handler 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 HandlerClient interface { + Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) + LoginWithGroup(ctx context.Context, in *GroupLoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) + GetKey(ctx context.Context, in *KeyRequest, opts ...grpc.CallOption) (*KeyResponse, error) + SetKey(ctx context.Context, in *SetKeyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + GetExp(ctx context.Context, in *KeyRequest, opts ...grpc.CallOption) (*ExpResponse, error) + GetKeys(ctx context.Context, in *KeyRequest, opts ...grpc.CallOption) (*KeysResponse, error) + DeleteKey(ctx context.Context, in *KeyRequest, opts ...grpc.CallOption) (*DeleteResponse, error) + DeleteRawKey(ctx context.Context, in *KeyRequest, opts ...grpc.CallOption) (*DeleteResponse, error) + GetKeysAndValues(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*KeysValuesResponse, error) + GetKeysAndValuesWithFilter(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*KeysValuesResponse, error) + DeleteKeys(ctx context.Context, in *DeleteKeysRequest, opts ...grpc.CallOption) (*DeleteResponse, error) + Decrement(ctx context.Context, in *KeyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + IncrementWithExpire(ctx context.Context, in *IncrementRequest, opts ...grpc.CallOption) (*IncrementResponse, error) + AppendToSet(ctx context.Context, in *AppendToSetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + SetRollingWindow(ctx context.Context, in *SetRollingWindowRequest, opts ...grpc.CallOption) (*SetRollingWindowResponse, error) + GetApiDefinitions(ctx context.Context, in *DefRequest, opts ...grpc.CallOption) (*ApiDefinitionsResponse, error) + GetPolicies(ctx context.Context, in *OrgIdRequest, opts ...grpc.CallOption) (*PoliciesResponse, error) + PurgeAnalyticsData(ctx context.Context, in *AnalyticsDataRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + PurgeAnalyticsDataAggregated(ctx context.Context, in *AnalyticsDataRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + CheckReload(ctx context.Context, in *OrgIdRequest, opts ...grpc.CallOption) (*ReloadResponse, error) + GetKeySpaceUpdate(ctx context.Context, in *OrgIdRequest, opts ...grpc.CallOption) (*KeySpaceUpdateResponse, error) + GetGroupKeySpaceUpdate(ctx context.Context, in *GroupKeySpaceRequest, opts ...grpc.CallOption) (*KeySpaceUpdateResponse, error) + Ping(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PingResponse, error) + Disconnect(ctx context.Context, in *GroupLoginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type handlerClient struct { + cc grpc.ClientConnInterface +} + +func NewHandlerClient(cc grpc.ClientConnInterface) HandlerClient { + return &handlerClient{cc} +} + +func (c *handlerClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(LoginResponse) + err := c.cc.Invoke(ctx, Handler_Login_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) LoginWithGroup(ctx context.Context, in *GroupLoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(LoginResponse) + err := c.cc.Invoke(ctx, Handler_LoginWithGroup_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) GetKey(ctx context.Context, in *KeyRequest, opts ...grpc.CallOption) (*KeyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(KeyResponse) + err := c.cc.Invoke(ctx, Handler_GetKey_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) SetKey(ctx context.Context, in *SetKeyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, Handler_SetKey_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) GetExp(ctx context.Context, in *KeyRequest, opts ...grpc.CallOption) (*ExpResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ExpResponse) + err := c.cc.Invoke(ctx, Handler_GetExp_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) GetKeys(ctx context.Context, in *KeyRequest, opts ...grpc.CallOption) (*KeysResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(KeysResponse) + err := c.cc.Invoke(ctx, Handler_GetKeys_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) DeleteKey(ctx context.Context, in *KeyRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DeleteResponse) + err := c.cc.Invoke(ctx, Handler_DeleteKey_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) DeleteRawKey(ctx context.Context, in *KeyRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DeleteResponse) + err := c.cc.Invoke(ctx, Handler_DeleteRawKey_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) GetKeysAndValues(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*KeysValuesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(KeysValuesResponse) + err := c.cc.Invoke(ctx, Handler_GetKeysAndValues_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) GetKeysAndValuesWithFilter(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*KeysValuesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(KeysValuesResponse) + err := c.cc.Invoke(ctx, Handler_GetKeysAndValuesWithFilter_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) DeleteKeys(ctx context.Context, in *DeleteKeysRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DeleteResponse) + err := c.cc.Invoke(ctx, Handler_DeleteKeys_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) Decrement(ctx context.Context, in *KeyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, Handler_Decrement_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) IncrementWithExpire(ctx context.Context, in *IncrementRequest, opts ...grpc.CallOption) (*IncrementResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(IncrementResponse) + err := c.cc.Invoke(ctx, Handler_IncrementWithExpire_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) AppendToSet(ctx context.Context, in *AppendToSetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, Handler_AppendToSet_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) SetRollingWindow(ctx context.Context, in *SetRollingWindowRequest, opts ...grpc.CallOption) (*SetRollingWindowResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SetRollingWindowResponse) + err := c.cc.Invoke(ctx, Handler_SetRollingWindow_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) GetApiDefinitions(ctx context.Context, in *DefRequest, opts ...grpc.CallOption) (*ApiDefinitionsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ApiDefinitionsResponse) + err := c.cc.Invoke(ctx, Handler_GetApiDefinitions_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) GetPolicies(ctx context.Context, in *OrgIdRequest, opts ...grpc.CallOption) (*PoliciesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PoliciesResponse) + err := c.cc.Invoke(ctx, Handler_GetPolicies_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) PurgeAnalyticsData(ctx context.Context, in *AnalyticsDataRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, Handler_PurgeAnalyticsData_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) PurgeAnalyticsDataAggregated(ctx context.Context, in *AnalyticsDataRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, Handler_PurgeAnalyticsDataAggregated_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) CheckReload(ctx context.Context, in *OrgIdRequest, opts ...grpc.CallOption) (*ReloadResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ReloadResponse) + err := c.cc.Invoke(ctx, Handler_CheckReload_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) GetKeySpaceUpdate(ctx context.Context, in *OrgIdRequest, opts ...grpc.CallOption) (*KeySpaceUpdateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(KeySpaceUpdateResponse) + err := c.cc.Invoke(ctx, Handler_GetKeySpaceUpdate_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) GetGroupKeySpaceUpdate(ctx context.Context, in *GroupKeySpaceRequest, opts ...grpc.CallOption) (*KeySpaceUpdateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(KeySpaceUpdateResponse) + err := c.cc.Invoke(ctx, Handler_GetGroupKeySpaceUpdate_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) Ping(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PingResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PingResponse) + err := c.cc.Invoke(ctx, Handler_Ping_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *handlerClient) Disconnect(ctx context.Context, in *GroupLoginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, Handler_Disconnect_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// HandlerServer is the server API for Handler service. +// All implementations must embed UnimplementedHandlerServer +// for forward compatibility. +type HandlerServer interface { + Login(context.Context, *LoginRequest) (*LoginResponse, error) + LoginWithGroup(context.Context, *GroupLoginRequest) (*LoginResponse, error) + GetKey(context.Context, *KeyRequest) (*KeyResponse, error) + SetKey(context.Context, *SetKeyRequest) (*emptypb.Empty, error) + GetExp(context.Context, *KeyRequest) (*ExpResponse, error) + GetKeys(context.Context, *KeyRequest) (*KeysResponse, error) + DeleteKey(context.Context, *KeyRequest) (*DeleteResponse, error) + DeleteRawKey(context.Context, *KeyRequest) (*DeleteResponse, error) + GetKeysAndValues(context.Context, *SearchRequest) (*KeysValuesResponse, error) + GetKeysAndValuesWithFilter(context.Context, *SearchRequest) (*KeysValuesResponse, error) + DeleteKeys(context.Context, *DeleteKeysRequest) (*DeleteResponse, error) + Decrement(context.Context, *KeyRequest) (*emptypb.Empty, error) + IncrementWithExpire(context.Context, *IncrementRequest) (*IncrementResponse, error) + AppendToSet(context.Context, *AppendToSetRequest) (*emptypb.Empty, error) + SetRollingWindow(context.Context, *SetRollingWindowRequest) (*SetRollingWindowResponse, error) + GetApiDefinitions(context.Context, *DefRequest) (*ApiDefinitionsResponse, error) + GetPolicies(context.Context, *OrgIdRequest) (*PoliciesResponse, error) + PurgeAnalyticsData(context.Context, *AnalyticsDataRequest) (*emptypb.Empty, error) + PurgeAnalyticsDataAggregated(context.Context, *AnalyticsDataRequest) (*emptypb.Empty, error) + CheckReload(context.Context, *OrgIdRequest) (*ReloadResponse, error) + GetKeySpaceUpdate(context.Context, *OrgIdRequest) (*KeySpaceUpdateResponse, error) + GetGroupKeySpaceUpdate(context.Context, *GroupKeySpaceRequest) (*KeySpaceUpdateResponse, error) + Ping(context.Context, *emptypb.Empty) (*PingResponse, error) + Disconnect(context.Context, *GroupLoginRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedHandlerServer() +} + +// UnimplementedHandlerServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedHandlerServer struct{} + +func (UnimplementedHandlerServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") +} +func (UnimplementedHandlerServer) LoginWithGroup(context.Context, *GroupLoginRequest) (*LoginResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LoginWithGroup not implemented") +} +func (UnimplementedHandlerServer) GetKey(context.Context, *KeyRequest) (*KeyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetKey not implemented") +} +func (UnimplementedHandlerServer) SetKey(context.Context, *SetKeyRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetKey not implemented") +} +func (UnimplementedHandlerServer) GetExp(context.Context, *KeyRequest) (*ExpResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetExp not implemented") +} +func (UnimplementedHandlerServer) GetKeys(context.Context, *KeyRequest) (*KeysResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetKeys not implemented") +} +func (UnimplementedHandlerServer) DeleteKey(context.Context, *KeyRequest) (*DeleteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteKey not implemented") +} +func (UnimplementedHandlerServer) DeleteRawKey(context.Context, *KeyRequest) (*DeleteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteRawKey not implemented") +} +func (UnimplementedHandlerServer) GetKeysAndValues(context.Context, *SearchRequest) (*KeysValuesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetKeysAndValues not implemented") +} +func (UnimplementedHandlerServer) GetKeysAndValuesWithFilter(context.Context, *SearchRequest) (*KeysValuesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetKeysAndValuesWithFilter not implemented") +} +func (UnimplementedHandlerServer) DeleteKeys(context.Context, *DeleteKeysRequest) (*DeleteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteKeys not implemented") +} +func (UnimplementedHandlerServer) Decrement(context.Context, *KeyRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Decrement not implemented") +} +func (UnimplementedHandlerServer) IncrementWithExpire(context.Context, *IncrementRequest) (*IncrementResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IncrementWithExpire not implemented") +} +func (UnimplementedHandlerServer) AppendToSet(context.Context, *AppendToSetRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method AppendToSet not implemented") +} +func (UnimplementedHandlerServer) SetRollingWindow(context.Context, *SetRollingWindowRequest) (*SetRollingWindowResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetRollingWindow not implemented") +} +func (UnimplementedHandlerServer) GetApiDefinitions(context.Context, *DefRequest) (*ApiDefinitionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetApiDefinitions not implemented") +} +func (UnimplementedHandlerServer) GetPolicies(context.Context, *OrgIdRequest) (*PoliciesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPolicies not implemented") +} +func (UnimplementedHandlerServer) PurgeAnalyticsData(context.Context, *AnalyticsDataRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method PurgeAnalyticsData not implemented") +} +func (UnimplementedHandlerServer) PurgeAnalyticsDataAggregated(context.Context, *AnalyticsDataRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method PurgeAnalyticsDataAggregated not implemented") +} +func (UnimplementedHandlerServer) CheckReload(context.Context, *OrgIdRequest) (*ReloadResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CheckReload not implemented") +} +func (UnimplementedHandlerServer) GetKeySpaceUpdate(context.Context, *OrgIdRequest) (*KeySpaceUpdateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetKeySpaceUpdate not implemented") +} +func (UnimplementedHandlerServer) GetGroupKeySpaceUpdate(context.Context, *GroupKeySpaceRequest) (*KeySpaceUpdateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGroupKeySpaceUpdate not implemented") +} +func (UnimplementedHandlerServer) Ping(context.Context, *emptypb.Empty) (*PingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") +} +func (UnimplementedHandlerServer) Disconnect(context.Context, *GroupLoginRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Disconnect not implemented") +} +func (UnimplementedHandlerServer) mustEmbedUnimplementedHandlerServer() {} +func (UnimplementedHandlerServer) testEmbeddedByValue() {} + +// UnsafeHandlerServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to HandlerServer will +// result in compilation errors. +type UnsafeHandlerServer interface { + mustEmbedUnimplementedHandlerServer() +} + +func RegisterHandlerServer(s grpc.ServiceRegistrar, srv HandlerServer) { + // If the following call pancis, it indicates UnimplementedHandlerServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Handler_ServiceDesc, srv) +} + +func _Handler_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LoginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).Login(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_Login_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).Login(ctx, req.(*LoginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_LoginWithGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GroupLoginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).LoginWithGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_LoginWithGroup_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).LoginWithGroup(ctx, req.(*GroupLoginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_GetKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(KeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).GetKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_GetKey_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).GetKey(ctx, req.(*KeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_SetKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).SetKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_SetKey_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).SetKey(ctx, req.(*SetKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_GetExp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(KeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).GetExp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_GetExp_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).GetExp(ctx, req.(*KeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_GetKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(KeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).GetKeys(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_GetKeys_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).GetKeys(ctx, req.(*KeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_DeleteKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(KeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).DeleteKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_DeleteKey_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).DeleteKey(ctx, req.(*KeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_DeleteRawKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(KeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).DeleteRawKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_DeleteRawKey_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).DeleteRawKey(ctx, req.(*KeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_GetKeysAndValues_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).GetKeysAndValues(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_GetKeysAndValues_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).GetKeysAndValues(ctx, req.(*SearchRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_GetKeysAndValuesWithFilter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).GetKeysAndValuesWithFilter(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_GetKeysAndValuesWithFilter_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).GetKeysAndValuesWithFilter(ctx, req.(*SearchRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_DeleteKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteKeysRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).DeleteKeys(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_DeleteKeys_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).DeleteKeys(ctx, req.(*DeleteKeysRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_Decrement_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(KeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).Decrement(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_Decrement_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).Decrement(ctx, req.(*KeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_IncrementWithExpire_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IncrementRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).IncrementWithExpire(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_IncrementWithExpire_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).IncrementWithExpire(ctx, req.(*IncrementRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_AppendToSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AppendToSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).AppendToSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_AppendToSet_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).AppendToSet(ctx, req.(*AppendToSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_SetRollingWindow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetRollingWindowRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).SetRollingWindow(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_SetRollingWindow_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).SetRollingWindow(ctx, req.(*SetRollingWindowRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_GetApiDefinitions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DefRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).GetApiDefinitions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_GetApiDefinitions_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).GetApiDefinitions(ctx, req.(*DefRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_GetPolicies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OrgIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).GetPolicies(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_GetPolicies_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).GetPolicies(ctx, req.(*OrgIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_PurgeAnalyticsData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnalyticsDataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).PurgeAnalyticsData(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_PurgeAnalyticsData_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).PurgeAnalyticsData(ctx, req.(*AnalyticsDataRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_PurgeAnalyticsDataAggregated_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnalyticsDataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).PurgeAnalyticsDataAggregated(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_PurgeAnalyticsDataAggregated_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).PurgeAnalyticsDataAggregated(ctx, req.(*AnalyticsDataRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_CheckReload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OrgIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).CheckReload(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_CheckReload_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).CheckReload(ctx, req.(*OrgIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_GetKeySpaceUpdate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OrgIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).GetKeySpaceUpdate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_GetKeySpaceUpdate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).GetKeySpaceUpdate(ctx, req.(*OrgIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_GetGroupKeySpaceUpdate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GroupKeySpaceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).GetGroupKeySpaceUpdate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_GetGroupKeySpaceUpdate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).GetGroupKeySpaceUpdate(ctx, req.(*GroupKeySpaceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).Ping(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_Ping_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).Ping(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Handler_Disconnect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GroupLoginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HandlerServer).Disconnect(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Handler_Disconnect_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServer).Disconnect(ctx, req.(*GroupLoginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Handler_ServiceDesc is the grpc.ServiceDesc for Handler service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Handler_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "handler.Handler", + HandlerType: (*HandlerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Login", + Handler: _Handler_Login_Handler, + }, + { + MethodName: "LoginWithGroup", + Handler: _Handler_LoginWithGroup_Handler, + }, + { + MethodName: "GetKey", + Handler: _Handler_GetKey_Handler, + }, + { + MethodName: "SetKey", + Handler: _Handler_SetKey_Handler, + }, + { + MethodName: "GetExp", + Handler: _Handler_GetExp_Handler, + }, + { + MethodName: "GetKeys", + Handler: _Handler_GetKeys_Handler, + }, + { + MethodName: "DeleteKey", + Handler: _Handler_DeleteKey_Handler, + }, + { + MethodName: "DeleteRawKey", + Handler: _Handler_DeleteRawKey_Handler, + }, + { + MethodName: "GetKeysAndValues", + Handler: _Handler_GetKeysAndValues_Handler, + }, + { + MethodName: "GetKeysAndValuesWithFilter", + Handler: _Handler_GetKeysAndValuesWithFilter_Handler, + }, + { + MethodName: "DeleteKeys", + Handler: _Handler_DeleteKeys_Handler, + }, + { + MethodName: "Decrement", + Handler: _Handler_Decrement_Handler, + }, + { + MethodName: "IncrementWithExpire", + Handler: _Handler_IncrementWithExpire_Handler, + }, + { + MethodName: "AppendToSet", + Handler: _Handler_AppendToSet_Handler, + }, + { + MethodName: "SetRollingWindow", + Handler: _Handler_SetRollingWindow_Handler, + }, + { + MethodName: "GetApiDefinitions", + Handler: _Handler_GetApiDefinitions_Handler, + }, + { + MethodName: "GetPolicies", + Handler: _Handler_GetPolicies_Handler, + }, + { + MethodName: "PurgeAnalyticsData", + Handler: _Handler_PurgeAnalyticsData_Handler, + }, + { + MethodName: "PurgeAnalyticsDataAggregated", + Handler: _Handler_PurgeAnalyticsDataAggregated_Handler, + }, + { + MethodName: "CheckReload", + Handler: _Handler_CheckReload_Handler, + }, + { + MethodName: "GetKeySpaceUpdate", + Handler: _Handler_GetKeySpaceUpdate_Handler, + }, + { + MethodName: "GetGroupKeySpaceUpdate", + Handler: _Handler_GetGroupKeySpaceUpdate_Handler, + }, + { + MethodName: "Ping", + Handler: _Handler_Ping_Handler, + }, + { + MethodName: "Disconnect", + Handler: _Handler_Disconnect_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "handler.proto", +} diff --git a/gateway/api_definition.go b/gateway/api_definition.go index f9cbcbcc58b..6b83d1904ec 100644 --- a/gateway/api_definition.go +++ b/gateway/api_definition.go @@ -672,7 +672,7 @@ func (a APIDefinitionLoader) FromRPC(store RPCDataLoader, orgId string, gw *Gate //store.Disconnect() - if rpc.LoadCount() > 0 { + if rpc.RPC().LoadCount() > 0 { if err := gw.saveRPCDefinitionsBackup(apiCollection); err != nil { log.Error(err) } diff --git a/gateway/api_loader.go b/gateway/api_loader.go index 20f52493e06..74c64a8214e 100644 --- a/gateway/api_loader.go +++ b/gateway/api_loader.go @@ -45,7 +45,13 @@ func (gw *Gateway) prepareStorage() generalStores { gs.redisStore = &storage.RedisCluster{KeyPrefix: "apikey-", HashKeys: gw.GetConfig().HashKeys, ConnectionHandler: gw.StorageConnectionHandler} gs.redisOrgStore = &storage.RedisCluster{KeyPrefix: "orgkey.", ConnectionHandler: gw.StorageConnectionHandler} gs.healthStore = &storage.RedisCluster{KeyPrefix: "apihealth.", ConnectionHandler: gw.StorageConnectionHandler} - gs.rpcAuthStore = &RPCStorageHandler{KeyPrefix: "apikey-", HashKeys: gw.GetConfig().HashKeys, Gw: gw} + gs.rpcAuthStore = GetRPCBackendHandler( + gw.GetConfig().SlaveOptions.RPCType, + &rpcInitConfig{ + KeyPrefix: "apikey-", + HashKeys: gw.GetConfig().HashKeys, + Gw: gw, + }) gs.rpcOrgStore = gw.getGlobalMDCBStorageHandler("orgkey.", false) gw.GlobalSessionManager.Init(gs.redisStore) diff --git a/gateway/grpc_storage_handler.go b/gateway/grpc_storage_handler.go new file mode 100644 index 00000000000..cb94c3ff260 --- /dev/null +++ b/gateway/grpc_storage_handler.go @@ -0,0 +1,862 @@ +package gateway + +import ( + "context" + "crypto/tls" + "encoding/json" + "errors" + "fmt" + "math" + "strings" + "time" + + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/encoding" + "google.golang.org/grpc/status" + + temporalmodel "github.com/TykTechnologies/storage/temporal/model" + "github.com/TykTechnologies/tyk/apidef" + "github.com/TykTechnologies/tyk/dispatcher" + "github.com/TykTechnologies/tyk/internal/cache" + "github.com/TykTechnologies/tyk/internal/model" + "github.com/TykTechnologies/tyk/rpc" + "github.com/TykTechnologies/tyk/storage" + "github.com/sirupsen/logrus" +) + +// GPCStorageHandler is a storage manager that uses gRPC to communicate with the server. +type GPCStorageHandler struct { + KeyPrefix string + HashKeys bool + SuppressRegister bool + DoReload func() + Gw *Gateway `json:"-"` + client dispatcher.HandlerClient + conn *grpc.ClientConn + cfg *rpc.Config +} + +// Custom JSON Codec +type jsonCodec struct{} + +func (jsonCodec) Marshal(v interface{}) ([]byte, error) { + return json.Marshal(v) +} + +func (jsonCodec) Unmarshal(data []byte, v interface{}) error { + return json.Unmarshal(data, v) +} + +func (jsonCodec) Name() string { + return "json" +} + +func init() { + encoding.RegisterCodec(jsonCodec{}) +} + +func (r *GPCStorageHandler) Connect() bool { + slaveOptions := r.Gw.GetConfig().SlaveOptions + rpcConfig := rpc.Config{ + UseSSL: slaveOptions.UseSSL, + SSLInsecureSkipVerify: slaveOptions.SSLInsecureSkipVerify, + SSLMinVersion: r.Gw.GetConfig().HttpServerOptions.MinVersion, + SSLMaxVersion: r.Gw.GetConfig().HttpServerOptions.MaxVersion, + ConnectionString: slaveOptions.ConnectionString, + RPCKey: slaveOptions.RPCKey, + APIKey: slaveOptions.APIKey, + GroupID: slaveOptions.GroupID, + CallTimeout: slaveOptions.CallTimeout, + PingTimeout: slaveOptions.PingTimeout, + RPCPoolSize: slaveOptions.RPCPoolSize, + } + + r.cfg = &rpcConfig + + var err error + var opts = make([]grpc.DialOption, 0) + if r.Gw.GetConfig().SlaveOptions.GRPCForceJSON { + opts = append(opts, grpc.WithDefaultCallOptions(grpc.ForceCodec(jsonCodec{}))) + } + + if r.Gw.GetConfig().SlaveOptions.UseSSL { + + clientCfg := &tls.Config{ + InsecureSkipVerify: rpcConfig.SSLInsecureSkipVerify, + MinVersion: rpcConfig.SSLMinVersion, + MaxVersion: rpcConfig.SSLMaxVersion, + } + + opts = append(opts, grpc.WithTransportCredentials(credentials.NewTLS(clientCfg))) + } else { + opts = append(opts, grpc.WithInsecure()) + } + + addr := r.Gw.GetConfig().SlaveOptions.ConnectionString + r.conn, err = grpc.Dial(addr, opts...) // Replace with actual server address + if err != nil { + log.Error("Failed to connect to gRPC server:", err) + return false + } + r.client = dispatcher.NewHandlerClient(r.conn) + rpc.SetConnected(true) + + time.Sleep(10 * time.Millisecond) + + return true +} + +// Login handles the login process for a single client +func (r *GPCStorageHandler) Login(clientID, userKey string) bool { + log := mainLog.WithFields(logrus.Fields{ + "func": "Login", + "clientID": clientID, + }) + + log.Debug("Attempting to login") + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + request := &dispatcher.LoginRequest{ + ClientId: clientID, + UserKey: userKey, + } + + response, err := r.client.Login(ctx, request) + if err != nil { + log.WithError(err).Error("Login failed") + return false + } + + if response == nil { + log.Warning("Received nil response from Login") + return false + } + + if response.Success { + log.Info("Login successful") + r.setSessionData(clientID, userKey) + } else { + log.Warning("Login unsuccessful") + } + + return response.Success +} + +// LoginWithGroup handles the login process for a client within a group +func (r *GPCStorageHandler) LoginWithGroup(clientID string, groupData *apidef.GroupLoginRequest) bool { + mainLog.WithFields(logrus.Fields{ + "func": "LoginWithGroup", + "clientID": clientID, + "groupID": groupData.GroupID, + }) + + log.Debug("Attempting to login with group") + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + nodeData := r.buildNodeInfo() + + request := &dispatcher.GroupLoginRequest{ + UserKey: groupData.UserKey, + GroupId: groupData.GroupID, + ForceSync: groupData.ForceSync, + Node: nodeData, + } + + response, err := r.client.LoginWithGroup(ctx, request) + if err != nil { + log.WithError(err).Error("Group login failed") + return false + } + + if response == nil { + log.Warning("Received nil response from LoginWithGroup") + return false + } + + if response.Success { + log.Info("Group login successful") + r.setGroupSessionData(clientID, groupData) + } else { + log.Warning("Group login unsuccessful") + } + + return response.Success +} + +// setSessionData stores session data after a successful login +func (r *GPCStorageHandler) setSessionData(clientID, userKey string) { + // This is a placeholder. Implement according to your session management logic + // For example, you might store this in a local cache or database + log.WithField("clientID", clientID).Debug("Setting session data") +} + +// setGroupSessionData stores session data after a successful group login +func (r *GPCStorageHandler) setGroupSessionData(clientID string, groupData *apidef.GroupLoginRequest) { + // This is a placeholder. Implement according to your session management logic + log.WithFields(logrus.Fields{ + "clientID": clientID, + "groupID": groupData.GroupID, + }).Debug("Setting group session data") +} + +func (r *GPCStorageHandler) buildNodeInfo() []byte { + config := r.Gw.GetConfig() + checkDuration := config.LivenessCheck.CheckDuration + var intCheckDuration int64 = 10 + if checkDuration != 0 { + intCheckDuration = int64(checkDuration / time.Second) + } + + r.Gw.getHostDetails(r.Gw.GetConfig().PIDFileLocation) + node := apidef.NodeData{ + NodeID: r.Gw.GetNodeID(), + GroupID: config.SlaveOptions.GroupID, + APIKey: config.SlaveOptions.APIKey, + NodeVersion: VERSION, + TTL: intCheckDuration, + NodeIsSegmented: config.DBAppConfOptions.NodeIsSegmented, + Tags: config.DBAppConfOptions.Tags, + Health: r.Gw.getHealthCheckInfo(), + Stats: apidef.GWStats{ + APIsCount: r.Gw.apisByIDLen(), + PoliciesCount: r.Gw.PolicyCount(), + }, + HostDetails: model.HostDetails{ + Hostname: r.Gw.hostDetails.Hostname, + PID: r.Gw.hostDetails.PID, + Address: r.Gw.hostDetails.Address, + }, + } + + data, err := json.Marshal(node) + if err != nil { + log.Error("Error marshalling node info", err) + return nil + } + + return data +} + +func (r *GPCStorageHandler) Disconnect() error { + request := &dispatcher.GroupLoginRequest{ + UserKey: r.cfg.APIKey, + GroupId: r.cfg.GroupID, + Node: r.buildNodeInfo(), + } + + _, err := r.client.Disconnect(context.Background(), request) + return err +} + +func (r *GPCStorageHandler) getGroupLoginCallback(synchroniserEnabled bool) func(userKey string, groupID string) interface{} { + groupLoginCallbackFn := func(userKey string, groupID string) interface{} { + return &dispatcher.GroupLoginRequest{ + UserKey: userKey, + GroupId: groupID, + Node: r.buildNodeInfo(), + } + } + // TODO: Implement synchroniser logic if needed + return groupLoginCallbackFn +} + +func (r *GPCStorageHandler) hashKey(in string) string { + if !r.HashKeys { + return in + } + return storage.HashStr(in) +} + +func (r *GPCStorageHandler) fixKey(keyName string) string { + setKeyName := r.KeyPrefix + r.hashKey(keyName) + log.Debug("Input key was: ", r.Gw.obfuscateKey(setKeyName)) + return setKeyName +} + +func (r *GPCStorageHandler) cleanKey(keyName string) string { + return strings.Replace(keyName, r.KeyPrefix, "", 1) +} + +func (r *GPCStorageHandler) GetKey(keyName string) (string, error) { + start := time.Now() + value, err := r.GetRawKey(r.fixKey(keyName)) + elapsed := time.Since(start) + log.Debug("GetKey took ", elapsed) + return value, err +} + +func (r *GPCStorageHandler) GetRawKey(keyName string) (string, error) { + cacheEnabled := r.Gw.GetConfig().SlaveOptions.EnableRPCCache + + var cacheStore cache.Repository + if cacheEnabled { + cacheStore = r.Gw.RPCGlobalCache + if strings.Contains(keyName, "cert-") { + cacheStore = r.Gw.RPCCertCache + } + + if cachedVal, found := cacheStore.Get(keyName); found { + switch typedVal := cachedVal.(type) { + case string: + return typedVal, nil + case error: + return "", typedVal + } + } + } + + request := &dispatcher.KeyRequest{ + ClientId: r.cfg.RPCKey, + KeyName: keyName, + } + + response, err := r.client.GetKey(context.Background(), request) + if err != nil { + if r.IsRetriableError(err) { + // TODO: Implement retry logic + } + if cacheEnabled { + cacheStore.Set(keyName, storage.ErrKeyNotFound, 1) + } + return "", storage.ErrKeyNotFound + } + + if cacheEnabled { + cacheStore.Set(keyName, response.Value, cache.DefaultExpiration) + } + + return response.Value, nil +} + +func (r *GPCStorageHandler) GetMultiKey(keyNames []string) ([]string, error) { + var err error + var value string + + for _, key := range keyNames { + value, err = r.GetKey(key) + if err == nil { + return []string{value}, nil + } + } + + return nil, err +} + +func (r *GPCStorageHandler) GetExp(keyName string) (int64, error) { + log.Debug("GetExp called") + request := &dispatcher.KeyRequest{ + ClientId: r.cfg.RPCKey, + KeyName: r.fixKey(keyName), + } + + response, err := r.client.GetExp(context.Background(), request) + if err != nil { + if r.IsRetriableError(err) { + // TODO: Implement retry logic + } + log.Error("Error trying to get TTL: ", err) + return 0, storage.ErrKeyNotFound + } + return response.Expiration, nil +} + +func (r *GPCStorageHandler) SetExp(keyName string, timeout int64) error { + log.Error("GPCStorageHandler.SetExp - Not Implemented") + return nil +} + +func (r *GPCStorageHandler) SetKey(keyName, session string, timeout int64) error { + start := time.Now() + request := &dispatcher.SetKeyRequest{ + ClientId: r.cfg.RPCKey, + Data: &dispatcher.InboundData{ + KeyName: r.fixKey(keyName), + SessionState: session, + Timeout: timeout, + }, + } + + _, err := r.client.SetKey(context.Background(), request) + if err != nil { + if r.IsRetriableError(err) { + // TODO: Implement retry logic + } + log.Debug("Error trying to set value:", err) + return err + } + + elapsed := time.Since(start) + log.Debug("SetKey took ", elapsed) + return nil +} + +func (r *GPCStorageHandler) SetRawKey(keyName, session string, timeout int64) error { + return nil +} + +func (r *GPCStorageHandler) Decrement(keyName string) { + log.Warning("Decrement called") + request := &dispatcher.KeyRequest{ + ClientId: r.cfg.RPCKey, + KeyName: keyName, + } + + _, err := r.client.Decrement(context.Background(), request) + if err != nil { + if r.IsRetriableError(err) { + // TODO: Implement retry logic + } + } +} + +func (r *GPCStorageHandler) IncrememntWithExpire(keyName string, expire int64) int64 { + request := &dispatcher.IncrementRequest{ + ClientId: r.cfg.RPCKey, + Data: &dispatcher.InboundData{ + KeyName: keyName, + Expire: expire, + }, + } + + response, err := r.client.IncrementWithExpire(context.Background(), request) + if err != nil { + if r.IsRetriableError(err) { + // TODO: Implement retry logic + } + log.Warning("RPC increment returned error, returning 0") + return 0 + } + + return response.Value +} + +func (r *GPCStorageHandler) GetKeys(filter string) []string { + log.Error("GPCStorageHandler.GetKeys - Not Implemented") + return nil +} + +func (r *GPCStorageHandler) GetKeysAndValuesWithFilter(filter string) map[string]string { + searchStr := r.KeyPrefix + r.hashKey(filter) + "*" + log.Debug("[STORE] Getting list by: ", searchStr) + + request := &dispatcher.SearchRequest{ + ClientId: r.cfg.RPCKey, + SearchString: searchStr, + } + + response, err := r.client.GetKeysAndValuesWithFilter(context.Background(), request) + if err != nil { + if r.IsRetriableError(err) { + // TODO: Implement retry logic + } + return nil + } + + returnValues := make(map[string]string) + for i, v := range response.Keys { + returnValues[r.cleanKey(v)] = response.Values[i] + } + + return returnValues +} + +func (r *GPCStorageHandler) GetKeysAndValues() map[string]string { + searchStr := r.KeyPrefix + "*" + + request := &dispatcher.SearchRequest{ + ClientId: r.cfg.RPCKey, + SearchString: searchStr, + } + + response, err := r.client.GetKeysAndValues(context.Background(), request) + if err != nil { + if r.IsRetriableError(err) { + // TODO: Implement retry logic + } + return nil + } + + returnValues := make(map[string]string) + for i, v := range response.Keys { + returnValues[r.cleanKey(v)] = response.Values[i] + } + + return returnValues +} + +func (r *GPCStorageHandler) DeleteKey(keyName string) bool { + log.Debug("DEL Key was: ", r.Gw.obfuscateKey(keyName)) + log.Debug("DEL Key became: ", r.Gw.obfuscateKey(r.fixKey(keyName))) + request := &dispatcher.KeyRequest{ + ClientId: r.cfg.RPCKey, + KeyName: r.fixKey(keyName), + } + + response, err := r.client.DeleteKey(context.Background(), request) + if err != nil { + if r.IsRetriableError(err) { + // TODO: Implement retry logic + } + return false + } + + return response.Success +} + +func (r *GPCStorageHandler) DeleteAllKeys() bool { + log.Warning("GPCStorageHandler.DeleteAllKeys - Not Implemented") + return false +} + +func (r *GPCStorageHandler) DeleteRawKey(keyName string) bool { + request := &dispatcher.KeyRequest{ + ClientId: r.cfg.RPCKey, + KeyName: keyName, + } + + response, err := r.client.DeleteRawKey(context.Background(), request) + if err != nil { + if r.IsRetriableError(err) { + // TODO: Implement retry logic + } + return false + } + + return response.Success +} + +func (r *GPCStorageHandler) DeleteKeys(keys []string) bool { + if len(keys) > 0 { + asInterface := make([]string, len(keys)) + for i, v := range keys { + asInterface[i] = r.fixKey(v) + } + + log.Debug("Deleting: ", asInterface) + request := &dispatcher.DeleteKeysRequest{ + ClientId: r.cfg.RPCKey, + Keys: asInterface, + } + + response, err := r.client.DeleteKeys(context.Background(), request) + if err != nil { + if r.IsRetriableError(err) { + // TODO: Implement retry logic + } + return false + } + + return response.Success + } + log.Debug("GPCStorageHandler called DEL - Nothing to delete") + return true +} + +func (r *GPCStorageHandler) StartPubSubHandler(channel string, callback func(*temporalmodel.Message)) error { + log.Warning("GPCStorageHandler.StartPubSubHandler - NO PUBSUB DEFINED") + return nil +} + +func (r *GPCStorageHandler) Publish(channel, message string) error { + log.Warning("GPCStorageHandler.Publish - NO PUBSUB DEFINED") + return nil +} + +func (r *GPCStorageHandler) GetAndDeleteSet(keyName string) []interface{} { + log.Error("GPCStorageHandler.GetAndDeleteSet - Not implemented, please disable your purger") + return nil +} + +func (r *GPCStorageHandler) AppendToSet(keyName, value string) { + request := &dispatcher.AppendToSetRequest{ + ClientId: r.cfg.RPCKey, + Data: &dispatcher.InboundData{ + KeyName: keyName, + Value: value, + }, + } + + _, err := r.client.AppendToSet(context.Background(), request) + if err != nil { + if r.IsRetriableError(err) { + // TODO: Implement retry logic + } + } +} + +func (r *GPCStorageHandler) SetRollingWindow(keyName string, per int64, val string, pipeline bool) (int, []interface{}) { + start := time.Now() + request := &dispatcher.SetRollingWindowRequest{ + ClientId: r.cfg.RPCKey, + Data: &dispatcher.InboundData{ + KeyName: keyName, + Per: per, + Expire: -1, + }, + } + + response, err := r.client.SetRollingWindow(context.Background(), request) + if err != nil { + if r.IsRetriableError(err) { + // TODO: Implement retry logic + } + log.Warning("RPC Handler: SetRollingWindow() returned error, returning 0") + return 0, nil + } + + elapsed := time.Since(start) + log.Debug("SetRollingWindow took ", elapsed) + + return int(response.Count), nil +} + +// GetApiDefinitions retrieves API definitions for a given organization ID and set of tags +func (r *GPCStorageHandler) GetApiDefinitions(orgId string, tags []string) string { + log.WithFields(logrus.Fields{ + "orgId": orgId, + "tags": tags, + }).Debug("Getting API definitions") + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + request := &dispatcher.DefRequest{ + OrgId: orgId, + Tags: tags, + LoadOas: true, + } + + response, err := r.client.GetApiDefinitions(ctx, request) + if err != nil { + log.WithError(err).Error("Failed to get API definitions") + return "" + } + + if response == nil { + log.Warning("GetApiDefinitions response is nil") + return "" + } + + log.Debug("Successfully retrieved API definitions") + return response.Definitions +} + +// GetPolicies retrieves policies for a given organization ID +func (r *GPCStorageHandler) GetPolicies(orgId string) string { + log.WithField("orgId", orgId).Debug("Getting policies") + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + request := &dispatcher.OrgIdRequest{ + ClientId: r.cfg.RPCKey, // This field is empty in the original implementation + OrgId: orgId, + } + + response, err := r.client.GetPolicies(ctx, request) + if r.IsRetriableError(err) { + fmt.Println("Retriable error in GetPolicies, will retry on next check", err) + if r.Login(r.cfg.RPCKey, r.cfg.APIKey) { + return r.GetPolicies(orgId) + } + } + + if response == nil { + log.Warning("GetPolicies response is nil") + return "" + } + + log.Debug("Successfully retrieved policies") + return response.Policies +} + +// CheckForReload checks if a reload is required for the given organization +func (r *GPCStorageHandler) CheckForReload(orgId string) bool { + log.Debug("Checking for reload") + + select { + case <-r.Gw.ctx.Done(): + log.Debug("Context cancelled, aborting reload check") + return false + default: + } + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + request := &dispatcher.OrgIdRequest{ + ClientId: r.cfg.RPCKey, // This field seems to be empty in the original implementation + OrgId: orgId, + } + + response, err := r.client.CheckReload(ctx, request) + if err != nil { + if st, ok := status.FromError(err); ok { + switch st.Code() { + case codes.Unavailable, codes.DeadlineExceeded: + log.WithError(err).Warning("Temporary error in CheckReload, will retry on next check") + default: + log.WithError(err).Error("Failed to check for reload") + } + } else { + log.WithError(err).Error("Unknown error in CheckReload") + } + return true + } + + if response == nil { + log.Warning("Received nil response from CheckReload") + return true + } + + if response.ReloadRequired { + log.Info("Reload required, triggering reload") + go r.triggerReload() + } else { + log.Debug("No reload required") + } + + return true +} + +// triggerReload initiates the reload process +func (r *GPCStorageHandler) triggerReload() { + log.Info("Triggering reload") + + // Use the existing notification system to trigger a reload + r.Gw.MainNotifier.Notify(Notification{ + Command: NoticeGroupReload, + Gw: r.Gw, + }) + + // If you have a DoReload function set, call it + if r.DoReload != nil { + log.Debug("Calling DoReload function") + r.DoReload() + } +} + +func (r *GPCStorageHandler) StartRPCKeepaliveWatcher() { + //no-op +} +func (r *GPCStorageHandler) StartRPCLoopCheck(orgId string) { + //no-op +} + +func (r *GPCStorageHandler) GetRollingWindow(key string, per int64, pipeline bool) (int, []interface{}) { + // TODO: Implement + return 0, nil +} + +func (r *GPCStorageHandler) GetSet(keyName string) (map[string]string, error) { + // TODO: Implement + return nil, errors.New("GetSet not implemented") +} + +func (r *GPCStorageHandler) AddToSet(keyName string, value string) { + // TODO: Implement +} + +func (r *GPCStorageHandler) RemoveFromSet(keyName string, value string) { + // TODO: Implement +} + +func (r *GPCStorageHandler) DeleteScanMatch(pattern string) bool { + // TODO: Implement + return false +} + +func (r *GPCStorageHandler) GetKeyPrefix() string { + // TODO: Implement + return "" +} + +func (r *GPCStorageHandler) AddToSortedSet(keyName string, value string, score float64) { + // TODO: Implement +} + +func (r *GPCStorageHandler) GetSortedSetRange(keyName, scoreFrom, scoreTo string) ([]string, []float64, error) { + // TODO: Implement + return nil, nil, errors.New("GetSortedSetRange not implemented") +} + +func (r *GPCStorageHandler) RemoveSortedSetRange(keyName, scoreFrom, scoreTo string) error { + // TODO: Implement + return errors.New("RemoveSortedSetRange not implemented") +} + +func (r *GPCStorageHandler) GetListRange(keyName string, from, to int64) ([]string, error) { + // TODO: Implement + return nil, errors.New("GetListRange not implemented") +} + +func (r *GPCStorageHandler) RemoveFromList(keyName string, value string) error { + // TODO: Implement + return errors.New("RemoveFromList not implemented") +} + +func (r *GPCStorageHandler) Exists(keyName string) (bool, error) { + // TODO: Implement + return false, errors.New("Exists not implemented") +} + +const ( + maxRetries = 3 + baseDelay = 100 * time.Millisecond + maxDelay = 2 * time.Second +) + +// IsRetriableError checks if the error is retriable +func (r *GPCStorageHandler) IsRetriableError(err error) bool { + if err == nil { + return false + } + + st, ok := status.FromError(err) + if !ok { + return false + } + + switch st.Code() { + case codes.Unavailable, codes.DeadlineExceeded, codes.Aborted, codes.Internal: + return true + default: + return false + } +} + +// retryOperation executes the operation with retries +func (r *GPCStorageHandler) retryOperation(operation func() error) error { + var err error + for attempt := 0; attempt < maxRetries; attempt++ { + err = operation() + if err == nil { + return nil + } + + if !r.IsRetriableError(err) { + return err + } + + delay := r.calculateBackoff(attempt) + select { + case <-r.Gw.ctx.Done(): + return context.Canceled + case <-time.After(delay): + // Continue with retry + } + } + return err +} + +// calculateBackoff calculates the delay for exponential backoff +func (r *GPCStorageHandler) calculateBackoff(attempt int) time.Duration { + delay := float64(baseDelay) * math.Pow(2, float64(attempt)) + return time.Duration(math.Min(float64(maxDelay), delay)) +} diff --git a/gateway/health_check.go b/gateway/health_check.go index 086071ecd8b..6fc9cd97a2b 100644 --- a/gateway/health_check.go +++ b/gateway/health_check.go @@ -137,9 +137,12 @@ func (gw *Gateway) gatherHealthChecks() { Time: time.Now().Format(time.RFC3339), } - if !rpc.Login() { - checkItem.Output = "Could not connect to RPC" - checkItem.Status = apidef.Fail + if gw.GetConfig().SlaveOptions.RPCType != "grpc" { + // TODO: This needs an answer in GRPC + if !rpc.RPC().Login() { + checkItem.Output = "Could not connect to RPC" + checkItem.Status = apidef.Fail + } } checkItem.ComponentType = apidef.System diff --git a/gateway/rpc_storage_handler.go b/gateway/rpc_storage_handler.go index c53c3177945..6dbe3414ab6 100644 --- a/gateway/rpc_storage_handler.go +++ b/gateway/rpc_storage_handler.go @@ -18,6 +18,48 @@ import ( "github.com/sirupsen/logrus" ) +type rpcInitConfig struct { + KeyPrefix string + HashKeys bool + SuppressRegister bool + DoReload func() + Gw *Gateway `json:"-"` +} + +const ( + GRPCBackend = "grpc" + LegacyRPC = "rpc" +) + +func GetRPCBackendHandler(name string, cfg *rpcInitConfig) storage.Handler { + switch name { + case GRPCBackend: + return &GPCStorageHandler{ + KeyPrefix: cfg.KeyPrefix, + HashKeys: cfg.HashKeys, + SuppressRegister: cfg.SuppressRegister, + DoReload: cfg.DoReload, + Gw: cfg.Gw, + } + case LegacyRPC: + return &RPCStorageHandler{ + KeyPrefix: cfg.KeyPrefix, + HashKeys: cfg.HashKeys, + SuppressRegister: cfg.SuppressRegister, + DoReload: cfg.DoReload, + Gw: cfg.Gw, + } + default: + return &RPCStorageHandler{ + KeyPrefix: cfg.KeyPrefix, + HashKeys: cfg.HashKeys, + SuppressRegister: cfg.SuppressRegister, + DoReload: cfg.DoReload, + Gw: cfg.Gw, + } + } +} + var ( dispatcherFuncs = map[string]interface{}{ "Login": func(clientAddr, userKey string) bool { @@ -138,7 +180,7 @@ func (r *RPCStorageHandler) Connect() bool { RPCPoolSize: slaveOptions.RPCPoolSize, } - return rpc.Connect( + return rpc.RPC().Connect( rpcConfig, r.SuppressRegister, dispatcherFuncs, @@ -196,7 +238,7 @@ func (r *RPCStorageHandler) Disconnect() error { Node: r.buildNodeInfo(), } - _, err := rpc.FuncClientSingleton("Disconnect", request) + _, err := rpc.RPC().FuncClientSingleton("Disconnect", request) return err } @@ -273,15 +315,15 @@ func (r *RPCStorageHandler) GetRawKey(keyName string) (string, error) { return "", storage.ErrMDCBConnectionLost } - value, err := rpc.FuncClientSingleton("GetKey", keyName) + value, err := rpc.RPC().FuncClientSingleton("GetKey", keyName) if err != nil { - rpc.EmitErrorEventKv( + rpc.RPC().EmitErrorEventKv( rpc.FuncClientSingletonCall, "GetKey", err, map[string]string{"keyName": keyName}, ) - if r.IsRetriableError(err) && rpc.Login() { + if r.IsRetriableError(err) && rpc.RPC().Login() { return r.GetRawKey(keyName) } if cacheEnabled { @@ -314,9 +356,9 @@ func (r *RPCStorageHandler) GetMultiKey(keyNames []string) ([]string, error) { func (r *RPCStorageHandler) GetExp(keyName string) (int64, error) { log.Debug("GetExp called") - value, err := rpc.FuncClientSingleton("GetExp", r.fixKey(keyName)) + value, err := rpc.RPC().FuncClientSingleton("GetExp", r.fixKey(keyName)) if err != nil { - rpc.EmitErrorEventKv( + rpc.RPC().EmitErrorEventKv( rpc.FuncClientSingletonCall, "GetExp", err, @@ -326,7 +368,7 @@ func (r *RPCStorageHandler) GetExp(keyName string) (int64, error) { }, ) if r.IsRetriableError(err) { - if rpc.Login() { + if rpc.RPC().Login() { return r.GetExp(keyName) } } @@ -350,9 +392,9 @@ func (r *RPCStorageHandler) SetKey(keyName, session string, timeout int64) error Timeout: timeout, } - _, err := rpc.FuncClientSingleton("SetKey", ibd) + _, err := rpc.RPC().FuncClientSingleton("SetKey", ibd) if err != nil { - rpc.EmitErrorEventKv( + rpc.RPC().EmitErrorEventKv( rpc.FuncClientSingletonCall, "SetKey", err, @@ -363,7 +405,7 @@ func (r *RPCStorageHandler) SetKey(keyName, session string, timeout int64) error ) if r.IsRetriableError(err) { - if rpc.Login() { + if rpc.RPC().Login() { return r.SetKey(keyName, session, timeout) } } @@ -385,9 +427,9 @@ func (r *RPCStorageHandler) SetRawKey(keyName, session string, timeout int64) er // Decrement will decrement a key in redis func (r *RPCStorageHandler) Decrement(keyName string) { log.Warning("Decrement called") - _, err := rpc.FuncClientSingleton("Decrement", keyName) + _, err := rpc.RPC().FuncClientSingleton("Decrement", keyName) if err != nil { - rpc.EmitErrorEventKv( + rpc.RPC().EmitErrorEventKv( rpc.FuncClientSingletonCall, "Decrement", err, @@ -397,7 +439,7 @@ func (r *RPCStorageHandler) Decrement(keyName string) { ) } if r.IsRetriableError(err) { - if rpc.Login() { + if rpc.RPC().Login() { r.Decrement(keyName) return } @@ -412,9 +454,9 @@ func (r *RPCStorageHandler) IncrememntWithExpire(keyName string, expire int64) i Expire: expire, } - val, err := rpc.FuncClientSingleton("IncrememntWithExpire", ibd) + val, err := rpc.RPC().FuncClientSingleton("IncrememntWithExpire", ibd) if err != nil { - rpc.EmitErrorEventKv( + rpc.RPC().EmitErrorEventKv( rpc.FuncClientSingletonCall, "IncrememntWithExpire", err, @@ -424,7 +466,7 @@ func (r *RPCStorageHandler) IncrememntWithExpire(keyName string, expire int64) i ) } if r.IsRetriableError(err) { - if rpc.Login() { + if rpc.RPC().Login() { return r.IncrememntWithExpire(keyName, expire) } } @@ -450,9 +492,9 @@ func (r *RPCStorageHandler) GetKeysAndValuesWithFilter(filter string) map[string searchStr := r.KeyPrefix + r.hashKey(filter) + "*" log.Debug("[STORE] Getting list by: ", searchStr) - kvPair, err := rpc.FuncClientSingleton("GetKeysAndValuesWithFilter", searchStr) + kvPair, err := rpc.RPC().FuncClientSingleton("GetKeysAndValuesWithFilter", searchStr) if err != nil { - rpc.EmitErrorEventKv( + rpc.RPC().EmitErrorEventKv( rpc.FuncClientSingletonCall, "GetKeysAndValuesWithFilter", err, @@ -462,7 +504,7 @@ func (r *RPCStorageHandler) GetKeysAndValuesWithFilter(filter string) map[string ) if r.IsRetriableError(err) { - if rpc.Login() { + if rpc.RPC().Login() { return r.GetKeysAndValuesWithFilter(filter) } } @@ -484,12 +526,12 @@ func (r *RPCStorageHandler) GetKeysAndValues() map[string]string { searchStr := r.KeyPrefix + "*" - kvPair, err := rpc.FuncClientSingleton("GetKeysAndValues", searchStr) + kvPair, err := rpc.RPC().FuncClientSingleton("GetKeysAndValues", searchStr) if err != nil { - rpc.EmitErrorEvent(rpc.FuncClientSingletonCall, "GetKeysAndValues", err) + rpc.RPC().EmitErrorEvent(rpc.FuncClientSingletonCall, "GetKeysAndValues", err) if r.IsRetriableError(err) { - if rpc.Login() { + if rpc.RPC().Login() { return r.GetKeysAndValues() } } @@ -511,9 +553,9 @@ func (r *RPCStorageHandler) DeleteKey(keyName string) bool { log.Debug("DEL Key was: ", r.Gw.obfuscateKey(keyName)) log.Debug("DEL Key became: ", r.Gw.obfuscateKey(r.fixKey(keyName))) - ok, err := rpc.FuncClientSingleton("DeleteKey", r.fixKey(keyName)) + ok, err := rpc.RPC().FuncClientSingleton("DeleteKey", r.fixKey(keyName)) if err != nil { - rpc.EmitErrorEventKv( + rpc.RPC().EmitErrorEventKv( rpc.FuncClientSingletonCall, "DeleteKey", err, @@ -524,7 +566,7 @@ func (r *RPCStorageHandler) DeleteKey(keyName string) bool { ) if r.IsRetriableError(err) { - if rpc.Login() { + if rpc.RPC().Login() { return r.DeleteKey(keyName) } } @@ -540,9 +582,9 @@ func (r *RPCStorageHandler) DeleteAllKeys() bool { // DeleteKey will remove a key from the database without prefixing, assumes user knows what they are doing func (r *RPCStorageHandler) DeleteRawKey(keyName string) bool { - ok, err := rpc.FuncClientSingleton("DeleteRawKey", keyName) + ok, err := rpc.RPC().FuncClientSingleton("DeleteRawKey", keyName) if err != nil { - rpc.EmitErrorEventKv( + rpc.RPC().EmitErrorEventKv( rpc.FuncClientSingletonCall, "DeleteRawKey", err, @@ -552,7 +594,7 @@ func (r *RPCStorageHandler) DeleteRawKey(keyName string) bool { ) if r.IsRetriableError(err) { - if rpc.Login() { + if rpc.RPC().Login() { return r.DeleteRawKey(keyName) } } @@ -570,9 +612,9 @@ func (r *RPCStorageHandler) DeleteKeys(keys []string) bool { } log.Debug("Deleting: ", asInterface) - ok, err := rpc.FuncClientSingleton("DeleteKeys", asInterface) + ok, err := rpc.RPC().FuncClientSingleton("DeleteKeys", asInterface) if err != nil { - rpc.EmitErrorEventKv( + rpc.RPC().EmitErrorEventKv( rpc.FuncClientSingletonCall, "DeleteKeys", err, @@ -583,7 +625,7 @@ func (r *RPCStorageHandler) DeleteKeys(keys []string) bool { ) if r.IsRetriableError(err) { - if rpc.Login() { + if rpc.RPC().Login() { return r.DeleteKeys(keys) } } @@ -617,9 +659,9 @@ func (r *RPCStorageHandler) AppendToSet(keyName, value string) { Value: value, } - _, err := rpc.FuncClientSingleton("AppendToSet", ibd) + _, err := rpc.RPC().FuncClientSingleton("AppendToSet", ibd) if err != nil { - rpc.EmitErrorEventKv( + rpc.RPC().EmitErrorEventKv( rpc.FuncClientSingletonCall, "AppendToSet", err, @@ -629,7 +671,7 @@ func (r *RPCStorageHandler) AppendToSet(keyName, value string) { ) } if r.IsRetriableError(err) { - if rpc.Login() { + if rpc.RPC().Login() { r.AppendToSet(keyName, value) } } @@ -644,9 +686,9 @@ func (r *RPCStorageHandler) SetRollingWindow(keyName string, per int64, val stri Expire: -1, } - intVal, err := rpc.FuncClientSingleton("SetRollingWindow", ibd) + intVal, err := rpc.RPC().FuncClientSingleton("SetRollingWindow", ibd) if err != nil { - rpc.EmitErrorEventKv( + rpc.RPC().EmitErrorEventKv( rpc.FuncClientSingletonCall, "SetRollingWindow", err, @@ -657,7 +699,7 @@ func (r *RPCStorageHandler) SetRollingWindow(keyName string, per int64, val stri ) if r.IsRetriableError(err) { - if rpc.Login() { + if rpc.RPC().Login() { return r.SetRollingWindow(keyName, per, val, false) } } @@ -708,9 +750,9 @@ func (r *RPCStorageHandler) GetApiDefinitions(orgId string, tags []string) strin LoadOAS: true, } - defString, err := rpc.FuncClientSingleton("GetApiDefinitions", dr) + defString, err := rpc.RPC().FuncClientSingleton("GetApiDefinitions", dr) if err != nil { - rpc.EmitErrorEventKv( + rpc.RPC().EmitErrorEventKv( rpc.FuncClientSingletonCall, "GetApiDefinitions", err, @@ -721,7 +763,7 @@ func (r *RPCStorageHandler) GetApiDefinitions(orgId string, tags []string) strin ) if r.IsRetriableError(err) { - if rpc.Login() { + if rpc.RPC().Login() { return r.GetApiDefinitions(orgId, tags) } } @@ -739,9 +781,9 @@ func (r *RPCStorageHandler) GetApiDefinitions(orgId string, tags []string) strin // GetPolicies will pull Policies from the RPC server func (r *RPCStorageHandler) GetPolicies(orgId string) string { - defString, err := rpc.FuncClientSingleton("GetPolicies", orgId) + defString, err := rpc.RPC().FuncClientSingleton("GetPolicies", orgId) if err != nil { - rpc.EmitErrorEventKv( + rpc.RPC().EmitErrorEventKv( rpc.FuncClientSingletonCall, "GetPolicies", err, @@ -751,7 +793,7 @@ func (r *RPCStorageHandler) GetPolicies(orgId string) string { ) if r.IsRetriableError(err) { - if rpc.Login() { + if rpc.RPC().Login() { return r.GetPolicies(orgId) } } @@ -774,9 +816,9 @@ func (r *RPCStorageHandler) CheckForReload(orgId string) bool { } log.Debug("[RPC STORE] Check Reload called...") - reload, err := rpc.FuncClientSingleton("CheckReload", orgId) + reload, err := rpc.RPC().FuncClientSingleton("CheckReload", orgId) if err != nil { - rpc.EmitErrorEventKv( + rpc.RPC().EmitErrorEventKv( rpc.FuncClientSingletonCall, "CheckReload", err, @@ -786,7 +828,7 @@ func (r *RPCStorageHandler) CheckForReload(orgId string) bool { ) if r.IsRetriableError(err) { log.Warning("[RPC STORE] CheckReload: Not logged in") - if rpc.Login() { + if rpc.RPC().Login() { r.CheckForReload(orgId) } } else if !strings.Contains(err.Error(), "Cannot obtain response during") { @@ -836,7 +878,7 @@ func (r *RPCStorageHandler) StartRPCKeepaliveWatcher() { }).Warning("Can't connect to RPC layer") if r.IsRetriableError(err) { - if rpc.Login() { + if rpc.RPC().Login() { continue } } @@ -874,16 +916,16 @@ func (r *RPCStorageHandler) CheckForKeyspaceChanges(orgId string) { reqData["GroupID"] = groupID } - keys, err = rpc.FuncClientSingleton(funcName, req) + keys, err = rpc.RPC().FuncClientSingleton(funcName, req) if err != nil { - rpc.EmitErrorEventKv( + rpc.RPC().EmitErrorEventKv( rpc.FuncClientSingletonCall, funcName, err, reqData, ) if r.IsRetriableError(err) { - if rpc.Login() { + if rpc.RPC().Login() { r.CheckForKeyspaceChanges(orgId) } } diff --git a/gateway/server.go b/gateway/server.go index e853d5824d6..f49d2a1ce9e 100644 --- a/gateway/server.go +++ b/gateway/server.go @@ -115,7 +115,7 @@ type Gateway struct { DefaultQuotaStore DefaultSessionManager GlobalSessionManager SessionHandler MonitoringHandler config.TykEventHandler - RPCListener RPCStorageHandler + RPCListener storage.RPCListener DashService DashboardServiceSender CertificateManager certs.CertificateManager GlobalHostChecker HostCheckerManager @@ -429,11 +429,14 @@ func (gw *Gateway) setupGlobals() { storeCert := &storage.RedisCluster{KeyPrefix: "cert-", HashKeys: false, ConnectionHandler: gw.StorageConnectionHandler} gw.CertificateManager = certs.NewCertificateManager(storeCert, certificateSecret, log, !gw.GetConfig().Cloud) if gw.GetConfig().SlaveOptions.UseRPC { - rpcStore := &RPCStorageHandler{ - KeyPrefix: "cert-", - HashKeys: false, - Gw: gw, - } + rpcStore := GetRPCBackendHandler( + gw.GetConfig().SlaveOptions.RPCType, + &rpcInitConfig{ + KeyPrefix: "cert-", + HashKeys: false, + Gw: gw, + }, + ) gw.CertificateManager = certs.NewSlaveCertManager(storeCert, rpcStore, certificateSecret, log, !gw.GetConfig().Cloud) } @@ -477,10 +480,19 @@ func (gw *Gateway) syncAPISpecs() (int, error) { } else if gw.GetConfig().SlaveOptions.UseRPC { mainLog.Debug("Using RPC Configuration") - dataLoader := &RPCStorageHandler{ + var dataLoader RPCDataLoader + dataLoader = &RPCStorageHandler{ Gw: gw, DoReload: gw.DoReload, } + + if gw.GetConfig().SlaveOptions.RPCType == "grpc" { + dataLoader = &GPCStorageHandler{ + Gw: gw, + DoReload: gw.DoReload, + } + } + var err error s, err = loader.FromRPC(dataLoader, gw.GetConfig().SlaveOptions.RPCKey, gw) if err != nil { @@ -539,10 +551,18 @@ func (gw *Gateway) syncPolicies() (count int, err error) { pols, err = gw.LoadPoliciesFromDashboard(connStr, gw.GetConfig().NodeSecret, gw.GetConfig().Policies.AllowExplicitPolicyID) case "rpc": mainLog.Debug("Using Policies from RPC") - dataLoader := &RPCStorageHandler{ + var dataLoader RPCDataLoader + dataLoader = &RPCStorageHandler{ Gw: gw, DoReload: gw.DoReload, } + + if gw.GetConfig().SlaveOptions.RPCType == "grpc" { + dataLoader = &GPCStorageHandler{ + Gw: gw, + DoReload: gw.DoReload, + } + } pols, err = gw.LoadPoliciesFromRPC(dataLoader, gw.GetConfig().SlaveOptions.RPCKey, gw.GetConfig().Policies.AllowExplicitPolicyID) default: //if policy path defined we want to allow use of the REST API @@ -1568,14 +1588,17 @@ func (gw *Gateway) getGlobalMDCBStorageHandler(keyPrefix string, hashKeys bool) localStorage := &storage.RedisCluster{KeyPrefix: keyPrefix, HashKeys: hashKeys, ConnectionHandler: gw.StorageConnectionHandler} logger := logrus.New().WithFields(logrus.Fields{"prefix": "mdcb-storage-handler"}) + mdcbStore := GetRPCBackendHandler( + gw.GetConfig().SlaveOptions.RPCType, + &rpcInitConfig{ + KeyPrefix: keyPrefix, + HashKeys: hashKeys, + Gw: gw, + }) if gw.GetConfig().SlaveOptions.UseRPC { return storage.NewMdcbStorage( localStorage, - &RPCStorageHandler{ - KeyPrefix: keyPrefix, - HashKeys: hashKeys, - Gw: gw, - }, + mdcbStore, logger, ) } @@ -1584,11 +1607,16 @@ func (gw *Gateway) getGlobalMDCBStorageHandler(keyPrefix string, hashKeys bool) func (gw *Gateway) getGlobalStorageHandler(keyPrefix string, hashKeys bool) storage.Handler { if gw.GetConfig().SlaveOptions.UseRPC { - return &RPCStorageHandler{ - KeyPrefix: keyPrefix, - HashKeys: hashKeys, - Gw: gw, - } + + mdcbStore := GetRPCBackendHandler( + gw.GetConfig().SlaveOptions.RPCType, + &rpcInitConfig{ + KeyPrefix: keyPrefix, + HashKeys: hashKeys, + Gw: gw, + }) + + return mdcbStore } return &storage.RedisCluster{KeyPrefix: keyPrefix, HashKeys: hashKeys, ConnectionHandler: gw.StorageConnectionHandler} } @@ -1633,6 +1661,10 @@ func Start() { gw.setupPortsWhitelist() gw.keyGen = DefaultKeyGenerator{Gw: gw} + if gwConfig.SlaveOptions.UseRPC { + rpc.SetRPCType(gwConfig.SlaveOptions.RPCType) + } + onFork := func() { mainLog.Warning("PREPARING TO FORK") @@ -1816,10 +1848,22 @@ func (gw *Gateway) start() { if slaveOptions := conf.SlaveOptions; slaveOptions.UseRPC { mainLog.Debug("Starting RPC reload listener") - gw.RPCListener = RPCStorageHandler{ - KeyPrefix: "rpc.listener.", - SuppressRegister: true, - Gw: gw, + + switch slaveOptions.RPCType { + case "grpc": + mainLog.Info("grpc server type chosen") + gw.RPCListener = &GPCStorageHandler{ + KeyPrefix: "rpc.listener.", + SuppressRegister: true, + Gw: gw, + } + + default: + gw.RPCListener = &RPCStorageHandler{ + KeyPrefix: "rpc.listener.", + SuppressRegister: true, + Gw: gw, + } } gw.RPCListener.Connect() diff --git a/gateway/testutil.go b/gateway/testutil.go index 9e245f86987..5e0849c25b3 100644 --- a/gateway/testutil.go +++ b/gateway/testutil.go @@ -1219,7 +1219,7 @@ func (s *Test) newGateway(genConf func(globalConf *config.Config)) *Gateway { if slaveOptions := gw.GetConfig().SlaveOptions; slaveOptions.UseRPC { mainLog.Debug("Starting RPC reload listener") - gw.RPCListener = RPCStorageHandler{ + gw.RPCListener = &RPCStorageHandler{ KeyPrefix: "rpc.listener.", SuppressRegister: true, Gw: gw, @@ -1430,7 +1430,7 @@ func (s *Test) GetApiById(apiId string) *APISpec { } func (s *Test) StopRPCClient() { - rpc.Reset() + rpc.RPC().Reset() } func (s *Test) GetPolicyById(policyId string) (user.Policy, bool) { diff --git a/internal/graphql/graphql_request.go b/internal/graphql/graphql_request.go index 10e9000114d..011721ca517 100644 --- a/internal/graphql/graphql_request.go +++ b/internal/graphql/graphql_request.go @@ -88,7 +88,7 @@ func (g *GraphStatsExtractionVisitor) ExtractStats(rawRequest, response, schema if t == string(g.schema.Index.QueryTypeName) || t == string(g.schema.Index.MutationTypeName) || t == string(g.schema.Index.SubscriptionTypeName) { isRootOperationType = true } - for field, _ := range fields { + for field := range fields { if isRootOperationType { rootFields = append(rootFields, field) } else { diff --git a/internal/graphql/graphql_request_test.go b/internal/graphql/graphql_request_test.go index d725086a574..193eb184ec2 100644 --- a/internal/graphql/graphql_request_test.go +++ b/internal/graphql/graphql_request_test.go @@ -194,8 +194,8 @@ func TestGraphStatsExtractionVisitor_ExtractStats(t *testing.T) { name: "should get all types for multiple operations", expected: analytics.GraphQLStats{ Types: map[string][]string{ - "Characters": []string{"info"}, - "Info": []string{"count"}, + "Characters": {"info"}, + "Info": {"count"}, }, RootFields: []string{"characters"}, OperationType: analytics.OperationQuery, diff --git a/rpc/grpcHandler.go b/rpc/grpcHandler.go new file mode 100644 index 00000000000..38beabec3b0 --- /dev/null +++ b/rpc/grpcHandler.go @@ -0,0 +1,42 @@ +package rpc + +type GRPCConnectionHandler struct{} + +func (g *GRPCConnectionHandler) Connect(_ Config, _ bool, _ map[string]interface{}, _ func(string, string) interface{}, _ func(), _ func()) bool { + return true +} + +func (g *GRPCConnectionHandler) Disconnect() bool { + return true +} + +func (g *GRPCConnectionHandler) FuncClientSingleton(_ string, _ interface{}) (interface{}, error) { + return nil, nil +} + +func (g *GRPCConnectionHandler) Login() bool { + return true +} + +func (g *GRPCConnectionHandler) GroupLogin() bool { + return true +} + +func (g *GRPCConnectionHandler) LoadCount() int { + return 0 +} + +func (g *GRPCConnectionHandler) Reset() { +} + +func (g *GRPCConnectionHandler) EmitErrorEvent(_ string, _ string, _ error) { + // no op +} + +func (g *GRPCConnectionHandler) EmitErrorEventKv(_ string, _ string, _ error, _ map[string]string) { + // no op +} + +func (g *GRPCConnectionHandler) CloseConnections() { + // no op +} diff --git a/rpc/rpc_analytics_purger.go b/rpc/rpc_analytics_purger.go index ecb19c2e231..1c76ebd0c4e 100644 --- a/rpc/rpc_analytics_purger.go +++ b/rpc/rpc_analytics_purger.go @@ -66,7 +66,7 @@ func (r *Purger) PurgeCache() { Log.Error("RPC client is not connected, use Connect method 1st") } - if _, err := FuncClientSingleton("Ping", nil); err != nil { + if _, err := RPC().FuncClientSingleton("Ping", nil); err != nil { Log.WithError(err).Error("Can't purge cache, failed to ping RPC") return } @@ -95,8 +95,8 @@ func (r *Purger) PurgeCache() { } // Send keys to RPC - if _, err := FuncClientSingleton("PurgeAnalyticsData", string(data)); err != nil { - EmitErrorEvent(FuncClientSingletonCall, "PurgeAnalyticsData", err) + if _, err := RPC().FuncClientSingleton("PurgeAnalyticsData", string(data)); err != nil { + RPC().EmitErrorEvent(FuncClientSingletonCall, "PurgeAnalyticsData", err) Log.Warn("Failed to call purge, retrying: ", err) } diff --git a/rpc/rpc_client.go b/rpc/rpc_client.go index 862b6fb1c1c..903049b934d 100644 --- a/rpc/rpc_client.go +++ b/rpc/rpc_client.go @@ -46,12 +46,48 @@ var ( rpcConnectMu sync.Mutex + handlerGetterMu sync.Mutex + // UseSyncLoginRPC for tests where we dont need to execute as a goroutine UseSyncLoginRPC bool AnalyticsSerializers []serializer.AnalyticsSerializer + goRPCHandler *gorpcClientManager + grpcHandler *GRPCConnectionHandler ) +type IRPCClient interface { + Connect(Config, bool, map[string]interface{}, func(string, string) interface{}, func(), func()) bool + Disconnect() bool + FuncClientSingleton(string, interface{}) (interface{}, error) + Login() bool + GroupLogin() bool + LoadCount() int + Reset() + EmitErrorEvent(string, string, error) + EmitErrorEventKv(string, string, error, map[string]string) + CloseConnections() +} + +func RPC() IRPCClient { + handlerGetterMu.Lock() + defer handlerGetterMu.Unlock() + + if GetRPCType() == "rpc" || GetRPCType() == "" { + if goRPCHandler == nil { + goRPCHandler = &gorpcClientManager{} + } + return goRPCHandler + } + + if grpcHandler == nil { + grpcHandler = &GRPCConnectionHandler{} + } + return grpcHandler +} + +type gorpcClientManager struct{} + // ErrRPCIsDown this is returned when we can't reach rpc server. var ErrRPCIsDown = errors.New("RPCStorageHandler: rpc is either down or was not configured") @@ -68,6 +104,22 @@ type rpcOpts struct { emergencyModeLoaded atomic.Value config atomic.Value clientIsConnected atomic.Value + rpcType atomic.Value +} + +func SetRPCType(rpcType string) { + values.rpcType.Store(rpcType) +} + +func GetRPCType() string { + if v := values.rpcType.Load(); v != nil { + return v.(string) + } + return "rpc" +} + +func SetConnected(connected bool) { + values.clientIsConnected.Store(connected) } func (r rpcOpts) ClientIsConnected() bool { @@ -156,11 +208,11 @@ func IsEmergencyMode() bool { return values.GetEmergencyMode() } -func LoadCount() int { +func (g *gorpcClientManager) LoadCount() int { return values.GetLoadCounts() } -func Reset() { +func (g *gorpcClientManager) Reset() { clientSingleton.Stop() clientSingleton = nil funcClientSingleton = nil @@ -172,7 +224,7 @@ func ResetEmergencyMode() { values.SetEmergencyModeLoaded(false) } -func EmitErrorEvent(jobName string, funcName string, err error) { +func (g *gorpcClientManager) EmitErrorEvent(jobName string, funcName string, err error) { if Instrument == nil { return } @@ -186,7 +238,7 @@ func EmitErrorEvent(jobName string, funcName string, err error) { } } -func EmitErrorEventKv(jobName string, funcName string, err error, kv map[string]string) { +func (g *gorpcClientManager) EmitErrorEventKv(jobName string, funcName string, err error, kv map[string]string) { if Instrument == nil { return } @@ -202,11 +254,11 @@ func EmitErrorEventKv(jobName string, funcName string, err error, kv map[string] } // Connect will establish a connection to the RPC server specified in connection options -func Connect(connConfig Config, suppressRegister bool, dispatcherFuncs map[string]interface{}, +func (g *gorpcClientManager) Connect(connConfig Config, suppressRegister bool, dispatcherFuncs map[string]interface{}, getGroupLoginFunc func(string, string) interface{}, emergencyModeFunc func(), emergencyModeLoadedFunc func()) bool { - rpcConnectMu.Lock() + defer rpcConnectMu.Unlock() values.config.Store(connConfig) @@ -250,7 +302,7 @@ func Connect(connConfig Config, suppressRegister bool, dispatcherFuncs map[strin clientSingleton.LogError = gorpc.NilErrorLogger } - clientSingleton.OnConnect = onConnectFunc + clientSingleton.OnConnect = g.onConnectFunc clientSingleton.Conns = values.Config().RPCPoolSize if clientSingleton.Conns == 0 { @@ -279,7 +331,7 @@ func Connect(connConfig Config, suppressRegister bool, dispatcherFuncs map[strin } if err != nil { - EmitErrorEventKv( + g.EmitErrorEventKv( ClientSingletonCall, "dial", err, @@ -298,44 +350,44 @@ func Connect(connConfig Config, suppressRegister bool, dispatcherFuncs map[strin } clientSingleton.Start() - loadDispatcher(dispatcherFuncs) + g.loadDispatcher(dispatcherFuncs) if funcClientSingleton == nil { funcClientSingleton = dispatcher.NewFuncClient(clientSingleton) } - handleLogin() + g.handleLogin() if !suppressRegister { - register() - go checkDisconnect() + g.register() + go g.checkDisconnect() } return true } -func handleLogin() { +func (g *gorpcClientManager) handleLogin() { if UseSyncLoginRPC == true { - Login() + g.Login() return } - go Login() + go g.Login() } // Login tries to login to the rpc sever. Returns true if it succeeds and false // if it fails. -func Login() bool { +func (g *gorpcClientManager) Login() bool { // I know this is extreme but rpc.Login() appears about 17 times and the // methods appears to be sometimes called in goroutines. // // Unless someone audits to ensure all of where this appears the parent calls // are not concurrent, this is a much safer solution. v, _, _ := loginFlight.Do("Login", func() (interface{}, error) { - return loginBase(), nil + return g.loginBase(), nil }) return v.(bool) } -func loginBase() bool { - if !doLoginWithRetries(login, groupLogin, hasAPIKey, isGroup) { +func (g *gorpcClientManager) loginBase() bool { + if !g.doLoginWithRetries(g.login, g.groupLogin, g.hasAPIKey, g.isGroup) { rpcLoginMu.Lock() if values.GetLoadCounts() == 0 && !values.GetEmergencyModeLoaded() { Log.Warning("[RPC Store] --> Detected cold start, attempting to load from cache") @@ -351,25 +403,25 @@ func loginBase() bool { return true } -func GroupLogin() bool { - return doGroupLogin(groupLogin) +func (g *gorpcClientManager) GroupLogin() bool { + return g.doGroupLogin(g.groupLogin) } -func doGroupLogin(login func() error) bool { +func (g *gorpcClientManager) doGroupLogin(login func() error) bool { if getGroupLoginCallback == nil { Log.Error("GroupLogin call back is not set") return false } b := backoff.WithMaxRetries(backoff.NewExponentialBackOff(), 3) - return backoff.Retry(recoverOp(login), b) == nil + return backoff.Retry(g.recoverOp(login), b) == nil } -func groupLogin() error { +func (g *gorpcClientManager) groupLogin() error { groupLoginData := getGroupLoginCallback(values.Config().APIKey, values.Config().GroupID) - ok, err := FuncClientSingleton("LoginWithGroup", groupLoginData) + ok, err := g.FuncClientSingleton("LoginWithGroup", groupLoginData) if err != nil { Log.WithError(err).Error("RPC Login failed") - EmitErrorEventKv( + g.EmitErrorEventKv( FuncClientSingletonCall, "LoginWithGroup", err, @@ -390,11 +442,11 @@ func groupLogin() error { var errLogFailed = errors.New("Login incorrect") -func login() error { - k, err := FuncClientSingleton("Login", values.Config().APIKey) +func (g *gorpcClientManager) login() error { + k, err := g.FuncClientSingleton("Login", values.Config().APIKey) if err != nil { Log.WithError(err).Error("RPC Login failed") - EmitErrorEvent(FuncClientSingletonCall, "Login", err) + g.EmitErrorEvent(FuncClientSingletonCall, "Login", err) return err } ok := k.(bool) @@ -407,11 +459,11 @@ func login() error { return nil } -func hasAPIKey() bool { +func (g *gorpcClientManager) hasAPIKey() bool { return len(values.Config().APIKey) != 0 } -func isGroup() bool { +func (g *gorpcClientManager) isGroup() bool { return values.Config().GroupID != "" } @@ -423,7 +475,7 @@ func isGroup() bool { // // isGroup returns true if the config.GroupID is set. If this returns true then // we perform group login. -func doLoginWithRetries(login, group func() error, hasAPIKey, isGroup func() bool) bool { +func (g *gorpcClientManager) doLoginWithRetries(login, group func() error, hasAPIKey, isGroup func() bool) bool { Log.Debug("[RPC Store] Login initiated") if !hasAPIKey() { @@ -431,13 +483,13 @@ func doLoginWithRetries(login, group func() error, hasAPIKey, isGroup func() boo } // If we have a group ID, lets login as a group if isGroup() { - return doGroupLogin(group) + return g.doGroupLogin(group) } b := backoff.WithMaxRetries(backoff.NewExponentialBackOff(), 3) - return backoff.Retry(recoverOp(login), b) == nil + return backoff.Retry(g.recoverOp(login), b) == nil } -func recoverOp(fn func() error) func() error { +func (g *gorpcClientManager) recoverOp(fn func() error) func() error { n := 0 return func() error { err := fn() @@ -464,7 +516,7 @@ func recoverOp(fn func() error) func() error { // established RPC connection, in that case we perform a retry with exponential // backoff ensuring indeed we can't connect to the rpc, this will eventually // fall into emergency mode( That is handled outside of this function call) -func FuncClientSingleton(funcName string, request interface{}) (result interface{}, err error) { +func (g *gorpcClientManager) FuncClientSingleton(funcName string, request interface{}) (result interface{}, err error) { be := backoff.Retry(func() error { if !values.ClientIsConnected() { return ErrRPCIsDown @@ -482,7 +534,7 @@ func FuncClientSingleton(funcName string, request interface{}) (result interface var rpcConnectionsPool []net.Conn -func onConnectFunc(conn net.Conn) (net.Conn, string, error) { +func (g *gorpcClientManager) onConnectFunc(conn net.Conn) (net.Conn, string, error) { values.clientIsConnected.Store(true) remoteAddr := conn.RemoteAddr().String() Log.WithField("remoteAddr", remoteAddr).Debug("connected to RPC server") @@ -490,7 +542,7 @@ func onConnectFunc(conn net.Conn) (net.Conn, string, error) { return conn, remoteAddr, nil } -func CloseConnections() { +func (g *gorpcClientManager) CloseConnections() { for k, v := range rpcConnectionsPool { err := v.Close() if err != nil { @@ -501,24 +553,24 @@ func CloseConnections() { } } -func Disconnect() bool { +func (g *gorpcClientManager) Disconnect() bool { values.clientIsConnected.Store(false) return true } -func register() { +func (g *gorpcClientManager) register() { id = uuid.New() Log.Debug("RPC Client registered") } -func checkDisconnect() { +func (g *gorpcClientManager) checkDisconnect() { res := <-killChan Log.WithField("res", res).Info("RPC Client disconnecting") killed = true - Disconnect() + g.Disconnect() } -func loadDispatcher(dispatcherFuncs map[string]interface{}) { +func (g *gorpcClientManager) loadDispatcher(dispatcherFuncs map[string]interface{}) { for funcName, funcBody := range dispatcherFuncs { if addedFuncs[funcName] { continue diff --git a/rpc/rpc_client_test.go b/rpc/rpc_client_test.go index 1cd00676547..ea1fb9d0ab2 100644 --- a/rpc/rpc_client_test.go +++ b/rpc/rpc_client_test.go @@ -10,7 +10,7 @@ func TestRecoveryFromEmregencyMode(t *testing.T) { // group login has the same recovery api so we don't need to test for it. isGroup := func() bool { return false } - ok := doLoginWithRetries(func() error { + ok := goRPCHandler.doLoginWithRetries(func() error { return errLogFailed }, func() error { return errLogFailed @@ -23,7 +23,7 @@ func TestRecoveryFromEmregencyMode(t *testing.T) { } // Lets succeed after second retry x := 0 - ok = doLoginWithRetries(func() error { + ok = goRPCHandler.doLoginWithRetries(func() error { if x == 0 { x++ return errLogFailed diff --git a/storage/connection_handler.go b/storage/connection_handler.go index 93eaccf6cf3..de22cd7d05b 100644 --- a/storage/connection_handler.go +++ b/storage/connection_handler.go @@ -238,11 +238,6 @@ func NewConnector(connType string, conf config.Config) (model.Connector, error) } log.Debug("Creating new " + connType + " Storage connection") - // we can ignore everything for a local connector - if cfg.Type == "local" { - return connector.NewConnector(model.LocalType) - } - // poolSize applies per cluster node and not for the whole cluster. poolSize := 500 if cfg.MaxActive > 0 { diff --git a/storage/mdcb_storage.go b/storage/mdcb_storage.go index b135bfcdec4..f950da1e356 100644 --- a/storage/mdcb_storage.go +++ b/storage/mdcb_storage.go @@ -37,7 +37,7 @@ func (m MdcbStorage) GetKey(key string) (string, error) { if err != nil { resourceType := getResourceType(key) - m.logger.Errorf("cannot retrieve %v from rpc: %v", resourceType, err.Error()) + m.logger.Errorf("cannot retrieve '%v' from rpc: %v", resourceType, err.Error()) return val, err } diff --git a/storage/storage.go b/storage/storage.go index 4da4d8dec66..828a4825148 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -63,6 +63,13 @@ type Handler interface { Exists(string) (bool, error) } +type RPCListener interface { + Connect() bool + CheckForReload(orgId string) bool + StartRPCKeepaliveWatcher() + StartRPCLoopCheck(orgId string) +} + type AnalyticsHandler interface { Connect() bool AppendToSetPipelined(string, [][]byte)