diff --git a/protocol/data_store.pb.go b/protocol/data_store.pb.go index aa0fba3d4..d048004bc 100644 --- a/protocol/data_store.pb.go +++ b/protocol/data_store.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 -// protoc v5.28.3 +// protoc-gen-go v1.35.2 +// protoc v5.29.0 // source: data_store.proto package protocol @@ -2068,6 +2068,249 @@ func (x *GetFeedbackStreamResponse) GetFeedback() []*Feedback { return nil } +type CountUsersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CountUsersRequest) Reset() { + *x = CountUsersRequest{} + mi := &file_data_store_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CountUsersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountUsersRequest) ProtoMessage() {} + +func (x *CountUsersRequest) ProtoReflect() protoreflect.Message { + mi := &file_data_store_proto_msgTypes[40] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CountUsersRequest.ProtoReflect.Descriptor instead. +func (*CountUsersRequest) Descriptor() ([]byte, []int) { + return file_data_store_proto_rawDescGZIP(), []int{40} +} + +type CountUsersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *CountUsersResponse) Reset() { + *x = CountUsersResponse{} + mi := &file_data_store_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CountUsersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountUsersResponse) ProtoMessage() {} + +func (x *CountUsersResponse) ProtoReflect() protoreflect.Message { + mi := &file_data_store_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CountUsersResponse.ProtoReflect.Descriptor instead. +func (*CountUsersResponse) Descriptor() ([]byte, []int) { + return file_data_store_proto_rawDescGZIP(), []int{41} +} + +func (x *CountUsersResponse) GetCount() int32 { + if x != nil { + return x.Count + } + return 0 +} + +type CountItemsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CountItemsRequest) Reset() { + *x = CountItemsRequest{} + mi := &file_data_store_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CountItemsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountItemsRequest) ProtoMessage() {} + +func (x *CountItemsRequest) ProtoReflect() protoreflect.Message { + mi := &file_data_store_proto_msgTypes[42] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CountItemsRequest.ProtoReflect.Descriptor instead. +func (*CountItemsRequest) Descriptor() ([]byte, []int) { + return file_data_store_proto_rawDescGZIP(), []int{42} +} + +type CountItemsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *CountItemsResponse) Reset() { + *x = CountItemsResponse{} + mi := &file_data_store_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CountItemsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountItemsResponse) ProtoMessage() {} + +func (x *CountItemsResponse) ProtoReflect() protoreflect.Message { + mi := &file_data_store_proto_msgTypes[43] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CountItemsResponse.ProtoReflect.Descriptor instead. +func (*CountItemsResponse) Descriptor() ([]byte, []int) { + return file_data_store_proto_rawDescGZIP(), []int{43} +} + +func (x *CountItemsResponse) GetCount() int32 { + if x != nil { + return x.Count + } + return 0 +} + +type CountFeedbackRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CountFeedbackRequest) Reset() { + *x = CountFeedbackRequest{} + mi := &file_data_store_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CountFeedbackRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountFeedbackRequest) ProtoMessage() {} + +func (x *CountFeedbackRequest) ProtoReflect() protoreflect.Message { + mi := &file_data_store_proto_msgTypes[44] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CountFeedbackRequest.ProtoReflect.Descriptor instead. +func (*CountFeedbackRequest) Descriptor() ([]byte, []int) { + return file_data_store_proto_rawDescGZIP(), []int{44} +} + +type CountFeedbackResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *CountFeedbackResponse) Reset() { + *x = CountFeedbackResponse{} + mi := &file_data_store_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CountFeedbackResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountFeedbackResponse) ProtoMessage() {} + +func (x *CountFeedbackResponse) ProtoReflect() protoreflect.Message { + mi := &file_data_store_proto_msgTypes[45] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CountFeedbackResponse.ProtoReflect.Descriptor instead. +func (*CountFeedbackResponse) Descriptor() ([]byte, []int) { + return file_data_store_proto_rawDescGZIP(), []int{45} +} + +func (x *CountFeedbackResponse) GetCount() int32 { + if x != nil { + return x.Count + } + return 0 +} + var File_data_store_proto protoreflect.FileDescriptor var file_data_store_proto_rawDesc = []byte{ @@ -2299,118 +2542,146 @@ var file_data_store_proto_rawDesc = []byte{ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x08, 0x66, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x08, 0x66, 0x65, 0x65, - 0x64, 0x62, 0x61, 0x63, 0x6b, 0x32, 0xc7, 0x0d, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x53, 0x74, - 0x6f, 0x72, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x15, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x50, 0x69, - 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x10, - 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, - 0x12, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x42, 0x61, 0x74, 0x63, - 0x68, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x42, - 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0d, 0x42, 0x61, 0x74, - 0x63, 0x68, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x49, 0x74, - 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x49, 0x74, - 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, - 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1b, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x74, 0x65, - 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, - 0x74, 0x65, 0x6d, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, - 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x0a, 0x4d, 0x6f, - 0x64, 0x69, 0x66, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, - 0x73, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, - 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0f, 0x47, 0x65, - 0x74, 0x49, 0x74, 0x65, 0x6d, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x20, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, - 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, - 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x5b, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x55, - 0x73, 0x65, 0x72, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, - 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6c, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x55, 0x73, - 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, - 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, - 0x73, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, - 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x0a, 0x4d, 0x6f, - 0x64, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x73, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, - 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0f, 0x47, 0x65, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x20, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, - 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x5c, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x46, - 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x46, 0x65, - 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, 0x65, 0x64, - 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6d, - 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, - 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x74, - 0x65, 0x6d, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x28, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x44, 0x65, 0x6c, + 0x64, 0x62, 0x61, 0x63, 0x6b, 0x22, 0x13, 0x0a, 0x11, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x2a, 0x0a, 0x12, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 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, 0x13, 0x0a, 0x11, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x49, + 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x2a, 0x0a, 0x12, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 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, 0x16, 0x0a, 0x14, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x2d, 0x0a, 0x15, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, + 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, 0x32, 0xb1, + 0x0f, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x37, 0x0a, 0x04, + 0x50, 0x69, 0x6e, 0x67, 0x12, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, + 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, + 0x73, 0x65, 0x72, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, + 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x73, + 0x65, 0x72, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0d, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x49, 0x74, + 0x65, 0x6d, 0x73, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x42, + 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x42, + 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x40, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x18, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x0a, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x49, 0x74, 0x65, + 0x6d, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4d, 0x6f, 0x64, + 0x69, 0x66, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, + 0x0a, 0x08, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x2e, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x46, 0x65, + 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, + 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x10, 0x42, 0x61, 0x74, + 0x63, 0x68, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x21, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, + 0x73, 0x65, 0x72, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x42, 0x61, 0x74, 0x63, + 0x68, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x40, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x0a, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, + 0x72, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4d, 0x6f, 0x64, + 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, + 0x0a, 0x08, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x46, 0x65, + 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, + 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5c, 0x0a, 0x13, 0x47, 0x65, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, + 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6d, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, + 0x6b, 0x12, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x46, 0x65, 0x65, 0x64, 0x62, - 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x64, 0x0a, - 0x13, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x46, 0x65, 0x65, 0x64, - 0x62, 0x61, 0x63, 0x6b, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, - 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, - 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x73, 0x65, 0x72, - 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, - 0x63, 0x6b, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, - 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x46, - 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x54, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x54, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x49, 0x74, - 0x65, 0x6d, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x60, 0x0a, - 0x11, 0x47, 0x65, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x12, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, - 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, - 0x25, 0x5a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x68, - 0x65, 0x6e, 0x67, 0x68, 0x61, 0x6f, 0x7a, 0x2f, 0x67, 0x6f, 0x72, 0x73, 0x65, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x74, 0x65, 0x6d, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x64, 0x0a, 0x13, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, + 0x6e, 0x73, 0x65, 0x72, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x24, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, + 0x73, 0x65, 0x72, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x42, + 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, + 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0b, + 0x47, 0x65, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x1c, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, + 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, 0x47, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x1e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, + 0x12, 0x54, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, + 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, + 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x60, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x46, 0x65, 0x65, + 0x64, 0x62, 0x61, 0x63, 0x6b, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x22, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, + 0x63, 0x6b, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, + 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x49, 0x0a, 0x0a, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x0a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x74, 0x65, 0x6d, + 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x49, + 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x52, + 0x0a, 0x0d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x12, + 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x42, 0x25, 0x5a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x7a, 0x68, 0x65, 0x6e, 0x67, 0x68, 0x61, 0x6f, 0x7a, 0x2f, 0x67, 0x6f, 0x72, 0x73, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -2425,7 +2696,7 @@ func file_data_store_proto_rawDescGZIP() []byte { return file_data_store_proto_rawDescData } -var file_data_store_proto_msgTypes = make([]protoimpl.MessageInfo, 40) +var file_data_store_proto_msgTypes = make([]protoimpl.MessageInfo, 46) var file_data_store_proto_goTypes = []any{ (*UserPatch)(nil), // 0: protocol.UserPatch (*ItemPatch)(nil), // 1: protocol.ItemPatch @@ -2467,38 +2738,44 @@ var file_data_store_proto_goTypes = []any{ (*GetItemStreamResponse)(nil), // 37: protocol.GetItemStreamResponse (*GetFeedbackStreamRequest)(nil), // 38: protocol.GetFeedbackStreamRequest (*GetFeedbackStreamResponse)(nil), // 39: protocol.GetFeedbackStreamResponse - (*timestamppb.Timestamp)(nil), // 40: google.protobuf.Timestamp - (*Item)(nil), // 41: protocol.Item - (*User)(nil), // 42: protocol.User - (*Feedback)(nil), // 43: protocol.Feedback - (*PingRequest)(nil), // 44: protocol.PingRequest - (*PingResponse)(nil), // 45: protocol.PingResponse + (*CountUsersRequest)(nil), // 40: protocol.CountUsersRequest + (*CountUsersResponse)(nil), // 41: protocol.CountUsersResponse + (*CountItemsRequest)(nil), // 42: protocol.CountItemsRequest + (*CountItemsResponse)(nil), // 43: protocol.CountItemsResponse + (*CountFeedbackRequest)(nil), // 44: protocol.CountFeedbackRequest + (*CountFeedbackResponse)(nil), // 45: protocol.CountFeedbackResponse + (*timestamppb.Timestamp)(nil), // 46: google.protobuf.Timestamp + (*Item)(nil), // 47: protocol.Item + (*User)(nil), // 48: protocol.User + (*Feedback)(nil), // 49: protocol.Feedback + (*PingRequest)(nil), // 50: protocol.PingRequest + (*PingResponse)(nil), // 51: protocol.PingResponse } var file_data_store_proto_depIdxs = []int32{ - 40, // 0: protocol.ItemPatch.timestamp:type_name -> google.protobuf.Timestamp - 40, // 1: protocol.ScanOptions.begin_time:type_name -> google.protobuf.Timestamp - 40, // 2: protocol.ScanOptions.end_time:type_name -> google.protobuf.Timestamp - 41, // 3: protocol.BatchInsertItemsRequest.items:type_name -> protocol.Item - 41, // 4: protocol.BatchGetItemsResponse.items:type_name -> protocol.Item - 41, // 5: protocol.GetItemResponse.item:type_name -> protocol.Item + 46, // 0: protocol.ItemPatch.timestamp:type_name -> google.protobuf.Timestamp + 46, // 1: protocol.ScanOptions.begin_time:type_name -> google.protobuf.Timestamp + 46, // 2: protocol.ScanOptions.end_time:type_name -> google.protobuf.Timestamp + 47, // 3: protocol.BatchInsertItemsRequest.items:type_name -> protocol.Item + 47, // 4: protocol.BatchGetItemsResponse.items:type_name -> protocol.Item + 47, // 5: protocol.GetItemResponse.item:type_name -> protocol.Item 1, // 6: protocol.ModifyItemRequest.patch:type_name -> protocol.ItemPatch - 40, // 7: protocol.GetItemsRequest.begin_time:type_name -> google.protobuf.Timestamp - 41, // 8: protocol.GetItemsResponse.items:type_name -> protocol.Item - 42, // 9: protocol.BatchInsertUsersRequest.users:type_name -> protocol.User - 42, // 10: protocol.GetUserResponse.user:type_name -> protocol.User + 46, // 7: protocol.GetItemsRequest.begin_time:type_name -> google.protobuf.Timestamp + 47, // 8: protocol.GetItemsResponse.items:type_name -> protocol.Item + 48, // 9: protocol.BatchInsertUsersRequest.users:type_name -> protocol.User + 48, // 10: protocol.GetUserResponse.user:type_name -> protocol.User 0, // 11: protocol.ModifyUserRequest.patch:type_name -> protocol.UserPatch - 42, // 12: protocol.GetUsersResponse.users:type_name -> protocol.User - 40, // 13: protocol.GetUserFeedbackRequest.end_time:type_name -> google.protobuf.Timestamp - 43, // 14: protocol.BatchInsertFeedbackRequest.feedback:type_name -> protocol.Feedback - 40, // 15: protocol.GetFeedbackRequest.begin_time:type_name -> google.protobuf.Timestamp - 40, // 16: protocol.GetFeedbackRequest.end_time:type_name -> google.protobuf.Timestamp - 43, // 17: protocol.GetFeedbackResponse.feedback:type_name -> protocol.Feedback - 42, // 18: protocol.GetUserStreamResponse.users:type_name -> protocol.User - 40, // 19: protocol.GetItemStreamRequest.time_limit:type_name -> google.protobuf.Timestamp - 41, // 20: protocol.GetItemStreamResponse.items:type_name -> protocol.Item + 48, // 12: protocol.GetUsersResponse.users:type_name -> protocol.User + 46, // 13: protocol.GetUserFeedbackRequest.end_time:type_name -> google.protobuf.Timestamp + 49, // 14: protocol.BatchInsertFeedbackRequest.feedback:type_name -> protocol.Feedback + 46, // 15: protocol.GetFeedbackRequest.begin_time:type_name -> google.protobuf.Timestamp + 46, // 16: protocol.GetFeedbackRequest.end_time:type_name -> google.protobuf.Timestamp + 49, // 17: protocol.GetFeedbackResponse.feedback:type_name -> protocol.Feedback + 48, // 18: protocol.GetUserStreamResponse.users:type_name -> protocol.User + 46, // 19: protocol.GetItemStreamRequest.time_limit:type_name -> google.protobuf.Timestamp + 47, // 20: protocol.GetItemStreamResponse.items:type_name -> protocol.Item 2, // 21: protocol.GetFeedbackStreamRequest.scan_options:type_name -> protocol.ScanOptions - 43, // 22: protocol.GetFeedbackStreamResponse.feedback:type_name -> protocol.Feedback - 44, // 23: protocol.DataStore.Ping:input_type -> protocol.PingRequest + 49, // 22: protocol.GetFeedbackStreamResponse.feedback:type_name -> protocol.Feedback + 50, // 23: protocol.DataStore.Ping:input_type -> protocol.PingRequest 3, // 24: protocol.DataStore.BatchInsertItems:input_type -> protocol.BatchInsertItemsRequest 5, // 25: protocol.DataStore.BatchGetItems:input_type -> protocol.BatchGetItemsRequest 7, // 26: protocol.DataStore.DeleteItem:input_type -> protocol.DeleteItemRequest @@ -2519,29 +2796,35 @@ var file_data_store_proto_depIdxs = []int32{ 34, // 41: protocol.DataStore.GetUserStream:input_type -> protocol.GetUserStreamRequest 36, // 42: protocol.DataStore.GetItemStream:input_type -> protocol.GetItemStreamRequest 38, // 43: protocol.DataStore.GetFeedbackStream:input_type -> protocol.GetFeedbackStreamRequest - 45, // 44: protocol.DataStore.Ping:output_type -> protocol.PingResponse - 4, // 45: protocol.DataStore.BatchInsertItems:output_type -> protocol.BatchInsertItemsResponse - 6, // 46: protocol.DataStore.BatchGetItems:output_type -> protocol.BatchGetItemsResponse - 8, // 47: protocol.DataStore.DeleteItem:output_type -> protocol.DeleteItemResponse - 10, // 48: protocol.DataStore.GetItem:output_type -> protocol.GetItemResponse - 12, // 49: protocol.DataStore.ModifyItem:output_type -> protocol.ModifyItemResponse - 14, // 50: protocol.DataStore.GetItems:output_type -> protocol.GetItemsResponse - 33, // 51: protocol.DataStore.GetItemFeedback:output_type -> protocol.GetFeedbackResponse - 17, // 52: protocol.DataStore.BatchInsertUsers:output_type -> protocol.BatchInsertUsersResponse - 19, // 53: protocol.DataStore.DeleteUser:output_type -> protocol.DeleteUserResponse - 21, // 54: protocol.DataStore.GetUser:output_type -> protocol.GetUserResponse - 23, // 55: protocol.DataStore.ModifyUser:output_type -> protocol.ModifyUserResponse - 25, // 56: protocol.DataStore.GetUsers:output_type -> protocol.GetUsersResponse - 33, // 57: protocol.DataStore.GetUserFeedback:output_type -> protocol.GetFeedbackResponse - 33, // 58: protocol.DataStore.GetUserItemFeedback:output_type -> protocol.GetFeedbackResponse - 29, // 59: protocol.DataStore.DeleteUserItemFeedback:output_type -> protocol.DeleteUserItemFeedbackResponse - 31, // 60: protocol.DataStore.BatchInsertFeedback:output_type -> protocol.BatchInsertFeedbackResponse - 33, // 61: protocol.DataStore.GetFeedback:output_type -> protocol.GetFeedbackResponse - 35, // 62: protocol.DataStore.GetUserStream:output_type -> protocol.GetUserStreamResponse - 37, // 63: protocol.DataStore.GetItemStream:output_type -> protocol.GetItemStreamResponse - 39, // 64: protocol.DataStore.GetFeedbackStream:output_type -> protocol.GetFeedbackStreamResponse - 44, // [44:65] is the sub-list for method output_type - 23, // [23:44] is the sub-list for method input_type + 40, // 44: protocol.DataStore.CountUsers:input_type -> protocol.CountUsersRequest + 42, // 45: protocol.DataStore.CountItems:input_type -> protocol.CountItemsRequest + 44, // 46: protocol.DataStore.CountFeedback:input_type -> protocol.CountFeedbackRequest + 51, // 47: protocol.DataStore.Ping:output_type -> protocol.PingResponse + 4, // 48: protocol.DataStore.BatchInsertItems:output_type -> protocol.BatchInsertItemsResponse + 6, // 49: protocol.DataStore.BatchGetItems:output_type -> protocol.BatchGetItemsResponse + 8, // 50: protocol.DataStore.DeleteItem:output_type -> protocol.DeleteItemResponse + 10, // 51: protocol.DataStore.GetItem:output_type -> protocol.GetItemResponse + 12, // 52: protocol.DataStore.ModifyItem:output_type -> protocol.ModifyItemResponse + 14, // 53: protocol.DataStore.GetItems:output_type -> protocol.GetItemsResponse + 33, // 54: protocol.DataStore.GetItemFeedback:output_type -> protocol.GetFeedbackResponse + 17, // 55: protocol.DataStore.BatchInsertUsers:output_type -> protocol.BatchInsertUsersResponse + 19, // 56: protocol.DataStore.DeleteUser:output_type -> protocol.DeleteUserResponse + 21, // 57: protocol.DataStore.GetUser:output_type -> protocol.GetUserResponse + 23, // 58: protocol.DataStore.ModifyUser:output_type -> protocol.ModifyUserResponse + 25, // 59: protocol.DataStore.GetUsers:output_type -> protocol.GetUsersResponse + 33, // 60: protocol.DataStore.GetUserFeedback:output_type -> protocol.GetFeedbackResponse + 33, // 61: protocol.DataStore.GetUserItemFeedback:output_type -> protocol.GetFeedbackResponse + 29, // 62: protocol.DataStore.DeleteUserItemFeedback:output_type -> protocol.DeleteUserItemFeedbackResponse + 31, // 63: protocol.DataStore.BatchInsertFeedback:output_type -> protocol.BatchInsertFeedbackResponse + 33, // 64: protocol.DataStore.GetFeedback:output_type -> protocol.GetFeedbackResponse + 35, // 65: protocol.DataStore.GetUserStream:output_type -> protocol.GetUserStreamResponse + 37, // 66: protocol.DataStore.GetItemStream:output_type -> protocol.GetItemStreamResponse + 39, // 67: protocol.DataStore.GetFeedbackStream:output_type -> protocol.GetFeedbackStreamResponse + 41, // 68: protocol.DataStore.CountUsers:output_type -> protocol.CountUsersResponse + 43, // 69: protocol.DataStore.CountItems:output_type -> protocol.CountItemsResponse + 45, // 70: protocol.DataStore.CountFeedback:output_type -> protocol.CountFeedbackResponse + 47, // [47:71] is the sub-list for method output_type + 23, // [23:47] is the sub-list for method input_type 23, // [23:23] is the sub-list for extension type_name 23, // [23:23] is the sub-list for extension extendee 0, // [0:23] is the sub-list for field type_name @@ -2564,7 +2847,7 @@ func file_data_store_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_data_store_proto_rawDesc, NumEnums: 0, - NumMessages: 40, + NumMessages: 46, NumExtensions: 0, NumServices: 1, }, diff --git a/protocol/data_store.proto b/protocol/data_store.proto index 87ce3b22f..e75655d08 100644 --- a/protocol/data_store.proto +++ b/protocol/data_store.proto @@ -204,6 +204,24 @@ message GetFeedbackStreamResponse { repeated Feedback feedback = 1; } +message CountUsersRequest {} + +message CountUsersResponse { + int32 count = 1; +} + +message CountItemsRequest {} + +message CountItemsResponse { + int32 count = 1; +} + +message CountFeedbackRequest {} + +message CountFeedbackResponse { + int32 count = 1; +} + service DataStore { rpc Ping(PingRequest) returns (PingResponse) {} rpc BatchInsertItems(BatchInsertItemsRequest) returns (BatchInsertItemsResponse) {} @@ -226,4 +244,7 @@ service DataStore { rpc GetUserStream(GetUserStreamRequest) returns (stream GetUserStreamResponse) {} rpc GetItemStream(GetItemStreamRequest) returns (stream GetItemStreamResponse) {} rpc GetFeedbackStream(GetFeedbackStreamRequest) returns (stream GetFeedbackStreamResponse) {} + rpc CountUsers(CountUsersRequest) returns (CountUsersResponse) {} + rpc CountItems(CountItemsRequest) returns (CountItemsResponse) {} + rpc CountFeedback(CountFeedbackRequest) returns (CountFeedbackResponse) {} } diff --git a/protocol/data_store_grpc.pb.go b/protocol/data_store_grpc.pb.go index 23ea72086..b60e89990 100644 --- a/protocol/data_store_grpc.pb.go +++ b/protocol/data_store_grpc.pb.go @@ -54,6 +54,9 @@ const ( DataStore_GetUserStream_FullMethodName = "/protocol.DataStore/GetUserStream" DataStore_GetItemStream_FullMethodName = "/protocol.DataStore/GetItemStream" DataStore_GetFeedbackStream_FullMethodName = "/protocol.DataStore/GetFeedbackStream" + DataStore_CountUsers_FullMethodName = "/protocol.DataStore/CountUsers" + DataStore_CountItems_FullMethodName = "/protocol.DataStore/CountItems" + DataStore_CountFeedback_FullMethodName = "/protocol.DataStore/CountFeedback" ) // DataStoreClient is the client API for DataStore service. @@ -81,6 +84,9 @@ type DataStoreClient interface { GetUserStream(ctx context.Context, in *GetUserStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetUserStreamResponse], error) GetItemStream(ctx context.Context, in *GetItemStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetItemStreamResponse], error) GetFeedbackStream(ctx context.Context, in *GetFeedbackStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetFeedbackStreamResponse], error) + CountUsers(ctx context.Context, in *CountUsersRequest, opts ...grpc.CallOption) (*CountUsersResponse, error) + CountItems(ctx context.Context, in *CountItemsRequest, opts ...grpc.CallOption) (*CountItemsResponse, error) + CountFeedback(ctx context.Context, in *CountFeedbackRequest, opts ...grpc.CallOption) (*CountFeedbackResponse, error) } type dataStoreClient struct { @@ -328,6 +334,36 @@ func (c *dataStoreClient) GetFeedbackStream(ctx context.Context, in *GetFeedback // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. type DataStore_GetFeedbackStreamClient = grpc.ServerStreamingClient[GetFeedbackStreamResponse] +func (c *dataStoreClient) CountUsers(ctx context.Context, in *CountUsersRequest, opts ...grpc.CallOption) (*CountUsersResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CountUsersResponse) + err := c.cc.Invoke(ctx, DataStore_CountUsers_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dataStoreClient) CountItems(ctx context.Context, in *CountItemsRequest, opts ...grpc.CallOption) (*CountItemsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CountItemsResponse) + err := c.cc.Invoke(ctx, DataStore_CountItems_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dataStoreClient) CountFeedback(ctx context.Context, in *CountFeedbackRequest, opts ...grpc.CallOption) (*CountFeedbackResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CountFeedbackResponse) + err := c.cc.Invoke(ctx, DataStore_CountFeedback_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // DataStoreServer is the server API for DataStore service. // All implementations must embed UnimplementedDataStoreServer // for forward compatibility. @@ -353,6 +389,9 @@ type DataStoreServer interface { GetUserStream(*GetUserStreamRequest, grpc.ServerStreamingServer[GetUserStreamResponse]) error GetItemStream(*GetItemStreamRequest, grpc.ServerStreamingServer[GetItemStreamResponse]) error GetFeedbackStream(*GetFeedbackStreamRequest, grpc.ServerStreamingServer[GetFeedbackStreamResponse]) error + CountUsers(context.Context, *CountUsersRequest) (*CountUsersResponse, error) + CountItems(context.Context, *CountItemsRequest) (*CountItemsResponse, error) + CountFeedback(context.Context, *CountFeedbackRequest) (*CountFeedbackResponse, error) mustEmbedUnimplementedDataStoreServer() } @@ -426,6 +465,15 @@ func (UnimplementedDataStoreServer) GetItemStream(*GetItemStreamRequest, grpc.Se func (UnimplementedDataStoreServer) GetFeedbackStream(*GetFeedbackStreamRequest, grpc.ServerStreamingServer[GetFeedbackStreamResponse]) error { return status.Errorf(codes.Unimplemented, "method GetFeedbackStream not implemented") } +func (UnimplementedDataStoreServer) CountUsers(context.Context, *CountUsersRequest) (*CountUsersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CountUsers not implemented") +} +func (UnimplementedDataStoreServer) CountItems(context.Context, *CountItemsRequest) (*CountItemsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CountItems not implemented") +} +func (UnimplementedDataStoreServer) CountFeedback(context.Context, *CountFeedbackRequest) (*CountFeedbackResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CountFeedback not implemented") +} func (UnimplementedDataStoreServer) mustEmbedUnimplementedDataStoreServer() {} func (UnimplementedDataStoreServer) testEmbeddedByValue() {} @@ -804,6 +852,60 @@ func _DataStore_GetFeedbackStream_Handler(srv interface{}, stream grpc.ServerStr // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. type DataStore_GetFeedbackStreamServer = grpc.ServerStreamingServer[GetFeedbackStreamResponse] +func _DataStore_CountUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CountUsersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataStoreServer).CountUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DataStore_CountUsers_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataStoreServer).CountUsers(ctx, req.(*CountUsersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DataStore_CountItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CountItemsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataStoreServer).CountItems(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DataStore_CountItems_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataStoreServer).CountItems(ctx, req.(*CountItemsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DataStore_CountFeedback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CountFeedbackRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataStoreServer).CountFeedback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DataStore_CountFeedback_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataStoreServer).CountFeedback(ctx, req.(*CountFeedbackRequest)) + } + return interceptor(ctx, in, info, handler) +} + // DataStore_ServiceDesc is the grpc.ServiceDesc for DataStore service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -883,6 +985,18 @@ var DataStore_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetFeedback", Handler: _DataStore_GetFeedback_Handler, }, + { + MethodName: "CountUsers", + Handler: _DataStore_CountUsers_Handler, + }, + { + MethodName: "CountItems", + Handler: _DataStore_CountItems_Handler, + }, + { + MethodName: "CountFeedback", + Handler: _DataStore_CountFeedback_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/storage/data/database.go b/storage/data/database.go index e4bf66b34..48debb398 100644 --- a/storage/data/database.go +++ b/storage/data/database.go @@ -276,6 +276,9 @@ type Database interface { GetUserStream(ctx context.Context, batchSize int) (chan []User, chan error) GetItemStream(ctx context.Context, batchSize int, timeLimit *time.Time) (chan []Item, chan error) GetFeedbackStream(ctx context.Context, batchSize int, options ...ScanOption) (chan []Feedback, chan error) + CountUsers(ctx context.Context) (int, error) + CountItems(ctx context.Context) (int, error) + CountFeedback(ctx context.Context) (int, error) } // Open a connection to a database. diff --git a/storage/data/database_test.go b/storage/data/database_test.go index 24b127f1f..d17f1ff0f 100644 --- a/storage/data/database_test.go +++ b/storage/data/database_test.go @@ -27,6 +27,7 @@ import ( "github.com/juju/errors" "github.com/samber/lo" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "google.golang.org/protobuf/proto" ) @@ -135,6 +136,19 @@ func (suite *baseTestSuite) isClickHouse() bool { } } +func (suite *baseTestSuite) analyzeTables() { + sqlDatabase, ok := suite.Database.(*SQLDatabase) + if ok && sqlDatabase.driver == Postgres { + sqlDatabase := suite.Database.(*SQLDatabase) + err := sqlDatabase.gormDB.Exec(fmt.Sprintf("ANALYZE %s", sqlDatabase.ItemsTable())).Error + suite.NoError(err) + err = sqlDatabase.gormDB.Exec(fmt.Sprintf("ANALYZE %s", sqlDatabase.UsersTable())).Error + suite.NoError(err) + err = sqlDatabase.gormDB.Exec(fmt.Sprintf("ANALYZE %s", sqlDatabase.FeedbackTable())).Error + suite.NoError(err) + } +} + func (suite *baseTestSuite) TearDownSuite() { err := suite.Database.Close() suite.NoError(err) @@ -171,6 +185,11 @@ func (suite *baseTestSuite) TestUsers() { } err := suite.Database.BatchInsertUsers(ctx, insertedUsers) suite.NoError(err) + // Count users + suite.analyzeTables() + count, err := suite.Database.CountUsers(ctx) + suite.NoError(err) + suite.Equal(10, count) // Get users users := suite.getUsers(ctx, 3) suite.Equal(10, len(users)) @@ -255,6 +274,11 @@ func (suite *baseTestSuite) TestFeedback() { } err = suite.Database.BatchInsertFeedback(ctx, futureFeedback, true, true, true) suite.NoError(err) + // Count feedback + suite.analyzeTables() + count, err := suite.Database.CountFeedback(ctx) + suite.NoError(err) + suite.Equal(12, count) // Get feedback ret := suite.getFeedback(ctx, 3, nil, lo.ToPtr(time.Now()), positiveFeedbackType) suite.Equal(feedback, ret) @@ -438,6 +462,11 @@ func (suite *baseTestSuite) TestItems() { // Insert item err := suite.Database.BatchInsertItems(ctx, items) suite.NoError(err) + // Count items + suite.analyzeTables() + count, err := suite.Database.CountItems(ctx) + suite.NoError(err) + suite.Equal(5, count) // Get items totalItems := suite.getItems(ctx, 3) suite.Equal(items, totalItems) @@ -808,3 +837,21 @@ func TestValidateLabels(t *testing.T) { assert.Error(t, ValidateLabels(map[string]any{"city": "wenzhou", "tags": []any{"1", json.Number("2"), "3"}})) assert.Error(t, ValidateLabels(map[string]any{"city": "wenzhou", "tags": []any{"1", "2", json.Number("3")}})) } + +func benchmarkCountItems(b *testing.B, db Database) { + ctx := context.Background() + // Insert 10,000 items + items := make([]Item, 100000) + for i := range items { + items[i] = Item{ItemId: strconv.Itoa(i)} + } + err := db.BatchInsertItems(ctx, items) + require.NoError(b, err) + // Benchmark count items + b.ResetTimer() + for i := 0; i < b.N; i++ { + n, err := db.CountItems(ctx) + require.NoError(b, err) + require.Equal(b, 100000, n) + } +} diff --git a/storage/data/mongodb.go b/storage/data/mongodb.go index e658fd381..e69644d5b 100644 --- a/storage/data/mongodb.go +++ b/storage/data/mongodb.go @@ -809,3 +809,18 @@ func (db *MongoDB) DeleteUserItemFeedback(ctx context.Context, userId, itemId st } return int(r.DeletedCount), nil } + +func (db *MongoDB) CountUsers(ctx context.Context) (int, error) { + n, err := db.client.Database(db.dbName).Collection(db.UsersTable()).EstimatedDocumentCount(ctx) + return int(n), err +} + +func (db *MongoDB) CountItems(ctx context.Context) (int, error) { + n, err := db.client.Database(db.dbName).Collection(db.ItemsTable()).EstimatedDocumentCount(ctx) + return int(n), err +} + +func (db *MongoDB) CountFeedback(ctx context.Context) (int, error) { + n, err := db.client.Database(db.dbName).Collection(db.FeedbackTable()).EstimatedDocumentCount(ctx) + return int(n), err +} diff --git a/storage/data/mongodb_test.go b/storage/data/mongodb_test.go index c4a54cc9a..04c47dee8 100644 --- a/storage/data/mongodb_test.go +++ b/storage/data/mongodb_test.go @@ -18,6 +18,7 @@ import ( "os" "testing" + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) @@ -72,3 +73,27 @@ func (suite *MongoTestSuite) getMongoDB() *MongoDB { func TestMongo(t *testing.T) { suite.Run(t, new(MongoTestSuite)) } + +func BenchmarkMongo_CountItems(b *testing.B) { + ctx := context.Background() + var err error + + // create database + database, err := Open(mongoUri, "gorse_") + require.NoError(b, err) + dbName := "gorse_data_test" + databaseComm := database.(*MongoDB) + err = databaseComm.client.Database(dbName).Drop(ctx) + require.NoError(b, err) + database, err = Open(mongoUri+dbName+"?authSource=admin&connect=direct", "gorse_") + require.NoError(b, err) + err = database.Init() + require.NoError(b, err) + + // benchmark + benchmarkCountItems(b, database) + + // close database + err = database.Close() + require.NoError(b, err) +} diff --git a/storage/data/no_database.go b/storage/data/no_database.go index f936e84fe..87c8dacf2 100644 --- a/storage/data/no_database.go +++ b/storage/data/no_database.go @@ -163,3 +163,15 @@ func (d NoDatabase) ModifyItem(_ context.Context, _ string, _ ItemPatch) error { func (d NoDatabase) ModifyUser(_ context.Context, _ string, _ UserPatch) error { return ErrNoDatabase } + +func (d NoDatabase) CountUsers(_ context.Context) (int, error) { + return 0, ErrNoDatabase +} + +func (d NoDatabase) CountItems(_ context.Context) (int, error) { + return 0, ErrNoDatabase +} + +func (d NoDatabase) CountFeedback(_ context.Context) (int, error) { + return 0, ErrNoDatabase +} diff --git a/storage/data/no_database_test.go b/storage/data/no_database_test.go index 776e7edb6..4d27c86a4 100644 --- a/storage/data/no_database_test.go +++ b/storage/data/no_database_test.go @@ -16,10 +16,11 @@ package data import ( "context" - "github.com/samber/lo" - "github.com/stretchr/testify/assert" "testing" "time" + + "github.com/samber/lo" + "github.com/stretchr/testify/assert" ) func TestNoDatabase(t *testing.T) { @@ -81,4 +82,11 @@ func TestNoDatabase(t *testing.T) { assert.ErrorIs(t, err, ErrNoDatabase) _, c = database.GetFeedbackStream(ctx, 0) assert.ErrorIs(t, <-c, ErrNoDatabase) + + _, err = database.CountUsers(ctx) + assert.ErrorIs(t, err, ErrNoDatabase) + _, err = database.CountItems(ctx) + assert.ErrorIs(t, err, ErrNoDatabase) + _, err = database.CountFeedback(ctx) + assert.ErrorIs(t, err, ErrNoDatabase) } diff --git a/storage/data/proxy.go b/storage/data/proxy.go index d651076b5..84843a8a0 100644 --- a/storage/data/proxy.go +++ b/storage/data/proxy.go @@ -462,6 +462,21 @@ func (p *ProxyServer) GetFeedbackStream(in *protocol.GetFeedbackStreamRequest, s return <-errChan } +func (p *ProxyServer) CountUsers(ctx context.Context, in *protocol.CountUsersRequest) (*protocol.CountUsersResponse, error) { + count, err := p.database.CountUsers(ctx) + return &protocol.CountUsersResponse{Count: int32(count)}, err +} + +func (p *ProxyServer) CountItems(ctx context.Context, in *protocol.CountItemsRequest) (*protocol.CountItemsResponse, error) { + count, err := p.database.CountItems(ctx) + return &protocol.CountItemsResponse{Count: int32(count)}, err +} + +func (p *ProxyServer) CountFeedback(ctx context.Context, in *protocol.CountFeedbackRequest) (*protocol.CountFeedbackResponse, error) { + count, err := p.database.CountFeedback(ctx) + return &protocol.CountFeedbackResponse{Count: int32(count)}, err +} + type ProxyClient struct { protocol.DataStoreClient } @@ -935,7 +950,7 @@ func (p ProxyClient) GetFeedbackStream(ctx context.Context, batchSize int, optio BeginItemId: o.BeginItemId, EndItemId: o.EndItemId, FeedbackTypes: o.FeedbackTypes, - OrderByItemId: o.OrderByItemId, + OrderByItemId: o.OrderByItemId, } if o.BeginTime != nil { pbOptions.BeginTime = timestamppb.New(*o.BeginTime) @@ -985,3 +1000,27 @@ func (p ProxyClient) GetFeedbackStream(ctx context.Context, batchSize int, optio }() return feedbackChan, errChan } + +func (p ProxyClient) CountUsers(ctx context.Context) (int, error) { + resp, err := p.DataStoreClient.CountUsers(ctx, &protocol.CountUsersRequest{}) + if err != nil { + return 0, err + } + return int(resp.Count), nil +} + +func (p ProxyClient) CountItems(ctx context.Context) (int, error) { + resp, err := p.DataStoreClient.CountItems(ctx, &protocol.CountItemsRequest{}) + if err != nil { + return 0, err + } + return int(resp.Count), nil +} + +func (p ProxyClient) CountFeedback(ctx context.Context) (int, error) { + resp, err := p.DataStoreClient.CountFeedback(ctx, &protocol.CountFeedbackRequest{}) + if err != nil { + return 0, err + } + return int(resp.Count), nil +} diff --git a/storage/data/sql.go b/storage/data/sql.go index 5d5d8ddca..b98c797d1 100644 --- a/storage/data/sql.go +++ b/storage/data/sql.go @@ -1093,3 +1093,75 @@ func (d *SQLDatabase) convertTimeZone(timestamp *time.Time) time.Time { return *timestamp } } + +func (d *SQLDatabase) CountUsers(ctx context.Context) (int, error) { + var ( + count int64 + err error + ) + switch d.driver { + case MySQL: + var tableStatus struct { + Rows int64 + } + err = d.gormDB.WithContext(ctx). + Raw(fmt.Sprintf("show table status like '%s'", d.UsersTable())). + Scan(&tableStatus).Error + count = tableStatus.Rows + case Postgres: + err = d.gormDB.WithContext(ctx). + Raw(fmt.Sprintf("SELECT reltuples AS estimate FROM pg_class where relname = '%s'", d.UsersTable())). + Scan(&count).Error + default: + err = d.gormDB.WithContext(ctx).Table(d.UsersTable()).Count(&count).Error + } + return int(count), errors.Trace(err) +} + +func (d *SQLDatabase) CountItems(ctx context.Context) (int, error) { + var ( + count int64 + err error + ) + switch d.driver { + case MySQL: + var tableStatus struct { + Rows int64 + } + err = d.gormDB.WithContext(ctx). + Raw(fmt.Sprintf("show table status like '%s'", d.ItemsTable())). + Scan(&tableStatus).Error + count = tableStatus.Rows + case Postgres: + err = d.gormDB.WithContext(ctx). + Raw(fmt.Sprintf("SELECT reltuples AS estimate FROM pg_class where relname = '%s'", d.ItemsTable())). + Scan(&count).Error + default: + err = d.gormDB.WithContext(ctx).Table(d.ItemsTable()).Count(&count).Error + } + return int(count), errors.Trace(err) +} + +func (d *SQLDatabase) CountFeedback(ctx context.Context) (int, error) { + var ( + count int64 + err error + ) + switch d.driver { + case MySQL: + var tableStatus struct { + Rows int64 + } + err = d.gormDB.WithContext(ctx). + Raw(fmt.Sprintf("show table status like '%s'", d.FeedbackTable())). + Scan(&tableStatus).Error + count = tableStatus.Rows + case Postgres: + err = d.gormDB.WithContext(ctx). + Raw(fmt.Sprintf("SELECT reltuples AS estimate FROM pg_class where relname = '%s'", d.FeedbackTable())). + Scan(&count).Error + default: + err = d.gormDB.WithContext(ctx).Table(d.FeedbackTable()).Count(&count).Error + } + return int(count), errors.Trace(err) +} diff --git a/storage/data/sql_test.go b/storage/data/sql_test.go index fd9938db0..59fcbe1f9 100644 --- a/storage/data/sql_test.go +++ b/storage/data/sql_test.go @@ -22,6 +22,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "github.com/zhenghaoz/gorse/storage" ) @@ -168,3 +169,72 @@ func assertQuery(t *testing.T, connection *sql.DB, sql string, expected string) assert.NoError(t, err) assert.Equal(t, expected, result) } + +func BenchmarkMySQL_CountItems(b *testing.B) { + // create database + database, err := Open(mySqlDSN, "gorse_") + require.NoError(b, err) + dbName := "gorse_data_test" + databaseComm := database.(*SQLDatabase) + _, err = databaseComm.client.Exec("DROP DATABASE IF EXISTS " + dbName) + require.NoError(b, err) + _, err = databaseComm.client.Exec("CREATE DATABASE " + dbName) + require.NoError(b, err) + database, err = Open(mySqlDSN+dbName, "gorse_") + require.NoError(b, err) + err = database.Init() + require.NoError(b, err) + // benchmark + benchmarkCountItems(b, database) + // close database + err = database.Close() + require.NoError(b, err) +} + +func BenchmarkPostgres_CountItems(b *testing.B) { + // create database + database, err := Open(postgresDSN+"gorse_data_test?sslmode=disable", "gorse_") + require.NoError(b, err) + err = database.Init() + require.NoError(b, err) + // benchmark + benchmarkCountItems(b, database) + // close database + err = database.Close() + require.NoError(b, err) +} + +func BenchmarkClickHouse_CountItems(b *testing.B) { + // create database + databaseComm, err := sql.Open("chhttp", "http://"+clickhouseDSN[len(storage.ClickhousePrefix):]) + require.NoError(b, err) + const dbName = "gorse_data_test" + _, err = databaseComm.Exec("DROP DATABASE IF EXISTS " + dbName) + require.NoError(b, err) + _, err = databaseComm.Exec("CREATE DATABASE " + dbName) + require.NoError(b, err) + err = databaseComm.Close() + require.NoError(b, err) + database, err := Open(clickhouseDSN+"gorse_data_test?mutations_sync=2", "gorse_") + require.NoError(b, err) + err = database.Init() + require.NoError(b, err) + // benchmark + benchmarkCountItems(b, database) + // close database + err = database.Close() + require.NoError(b, err) +} + +func BenchmarkSQLite_CountItems(b *testing.B) { + // create database + database, err := Open("sqlite://"+os.TempDir()+"/sqlite.db", "gorse_") + require.NoError(b, err) + err = database.Init() + require.NoError(b, err) + // benchmark + benchmarkCountItems(b, database) + // close database + err = database.Close() + require.NoError(b, err) +}