From b096a3f8e24dda513f79cfa87916b2061a0cb89f Mon Sep 17 00:00:00 2001 From: j-rafique Date: Thu, 13 Mar 2025 13:09:20 +0500 Subject: [PATCH] implement dd & rq client to resolve imports --- Makefile | 7 + gen/dupedetection/dd-server.pb.go | 1263 +++++++++++++++++ gen/dupedetection/dd-server_grpc.pb.go | 150 ++ gen/raptorq/raptorq.pb.go | 476 +++++++ gen/raptorq/raptorq_grpc.pb.go | 187 +++ go.mod | 2 - go.sum | 4 - pkg/dd/client.go | 53 +- pkg/dd/config.go | 50 + pkg/dd/connection.go | 23 + pkg/dd/dd_mock.go | 125 +- pkg/dd/dd_server_client.go | 24 + pkg/dd/image_rareness.go | 4 +- pkg/dd/interfaces.go | 30 + pkg/dd/status.go | 4 +- {lumera => pkg/lumera}/Readme.md | 0 {lumera => pkg/lumera}/client.go | 0 {lumera => pkg/lumera}/config.go | 0 {lumera => pkg/lumera}/connection.go | 0 {lumera => pkg/lumera}/interface.go | 0 {lumera => pkg/lumera}/modules/action/impl.go | 22 +- .../lumera}/modules/action/interface.go | 2 +- {lumera => pkg/lumera}/modules/node/impl.go | 0 .../lumera}/modules/node/interface.go | 0 .../lumera/modules/supernode/impl.go | 0 .../lumera}/modules/supernode/interface.go | 0 .../lumera/modules/tx/impl.go | 0 .../lumera}/modules/tx/interface.go | 0 {lumera => pkg/lumera}/options.go | 0 pkg/net/grpc/client/client_mock.go | 2 +- pkg/raptorq/client.go | 54 +- pkg/raptorq/config.go | 38 + pkg/raptorq/connection.go | 23 + pkg/raptorq/decode.go | 4 +- pkg/raptorq/encode.go | 4 +- pkg/raptorq/encode_metadata.go | 4 +- pkg/raptorq/interfaces.go | 36 + pkg/raptorq/raptorq.go | 139 ++ pkg/raptorq/rq_mock.go | 131 +- pkg/raptorq/rq_server_client.go | 32 + proto/dupedetection/dd-server.proto | 108 ++ proto/raptorq/raptorq.proto | 46 + 42 files changed, 2934 insertions(+), 113 deletions(-) create mode 100644 gen/dupedetection/dd-server.pb.go create mode 100644 gen/dupedetection/dd-server_grpc.pb.go create mode 100644 gen/raptorq/raptorq.pb.go create mode 100644 gen/raptorq/raptorq_grpc.pb.go create mode 100644 pkg/dd/config.go create mode 100644 pkg/dd/connection.go create mode 100644 pkg/dd/dd_server_client.go create mode 100644 pkg/dd/interfaces.go rename {lumera => pkg/lumera}/Readme.md (100%) rename {lumera => pkg/lumera}/client.go (100%) rename {lumera => pkg/lumera}/config.go (100%) rename {lumera => pkg/lumera}/connection.go (100%) rename {lumera => pkg/lumera}/interface.go (100%) rename {lumera => pkg/lumera}/modules/action/impl.go (66%) rename {lumera => pkg/lumera}/modules/action/interface.go (81%) rename {lumera => pkg/lumera}/modules/node/impl.go (100%) rename {lumera => pkg/lumera}/modules/node/interface.go (100%) rename lumera/modules/supernode/impl.go.go => pkg/lumera/modules/supernode/impl.go (100%) rename {lumera => pkg/lumera}/modules/supernode/interface.go (100%) rename lumera/modules/tx/impl.go.go => pkg/lumera/modules/tx/impl.go (100%) rename {lumera => pkg/lumera}/modules/tx/interface.go (100%) rename {lumera => pkg/lumera}/options.go (100%) create mode 100644 pkg/raptorq/config.go create mode 100644 pkg/raptorq/connection.go create mode 100644 pkg/raptorq/interfaces.go create mode 100644 pkg/raptorq/raptorq.go create mode 100644 pkg/raptorq/rq_server_client.go create mode 100644 proto/dupedetection/dd-server.proto create mode 100644 proto/raptorq/raptorq.proto diff --git a/Makefile b/Makefile index 865fc306..2cab3ea4 100644 --- a/Makefile +++ b/Makefile @@ -20,3 +20,10 @@ gen-lumera-proto: cd ./proto/lumera/action && protoc --go_out=../../../gen/lumera/action --go-grpc_out=../../../gen/lumera/action --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative action_service.proto && cd ../../../ cd ./proto/lumera/supernode && protoc --go_out=../../../gen/lumera/supernode --go-grpc_out=../../../gen/lumera/supernode --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative supernode.proto && cd ../../../ cd ./proto/lumera/supernode && protoc --go_out=../../../gen/lumera/supernode --go-grpc_out=../../../gen/lumera/supernode --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative supernode_service.proto && cd ../../../ + +gen-dupe-detection-proto: + cd ./proto/dupedetection && protoc --go_out=../../gen/dupedetection --go-grpc_out=../../gen/dupedetection --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative dd-server.proto && cd ../../ + +gen-raptor-q-proto: + cd ./proto/raptorq && protoc --go_out=../../gen/raptorq --go-grpc_out=../../gen/raptorq --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative raptorq.proto && cd ../../ + diff --git a/gen/dupedetection/dd-server.pb.go b/gen/dupedetection/dd-server.pb.go new file mode 100644 index 00000000..69e63a6d --- /dev/null +++ b/gen/dupedetection/dd-server.pb.go @@ -0,0 +1,1263 @@ +// Copyright (c) 2021-2021 The Pastel Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.12.4 +// source: dd-server.proto + +package dupedetection + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + 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 RarenessScoreRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ImageFilepath string `protobuf:"bytes,1,opt,name=image_filepath,json=imageFilepath,proto3" json:"image_filepath,omitempty"` + PastelBlockHashWhenRequestSubmitted string `protobuf:"bytes,2,opt,name=pastel_block_hash_when_request_submitted,json=pastelBlockHashWhenRequestSubmitted,proto3" json:"pastel_block_hash_when_request_submitted,omitempty"` + PastelBlockHeightWhenRequestSubmitted string `protobuf:"bytes,3,opt,name=pastel_block_height_when_request_submitted,json=pastelBlockHeightWhenRequestSubmitted,proto3" json:"pastel_block_height_when_request_submitted,omitempty"` + UtcTimestampWhenRequestSubmitted string `protobuf:"bytes,4,opt,name=utc_timestamp_when_request_submitted,json=utcTimestampWhenRequestSubmitted,proto3" json:"utc_timestamp_when_request_submitted,omitempty"` + PastelIdOfSubmitter string `protobuf:"bytes,5,opt,name=pastel_id_of_submitter,json=pastelIdOfSubmitter,proto3" json:"pastel_id_of_submitter,omitempty"` + PastelIdOfRegisteringSupernode_1 string `protobuf:"bytes,6,opt,name=pastel_id_of_registering_supernode_1,json=pastelIdOfRegisteringSupernode1,proto3" json:"pastel_id_of_registering_supernode_1,omitempty"` + PastelIdOfRegisteringSupernode_2 string `protobuf:"bytes,7,opt,name=pastel_id_of_registering_supernode_2,json=pastelIdOfRegisteringSupernode2,proto3" json:"pastel_id_of_registering_supernode_2,omitempty"` + PastelIdOfRegisteringSupernode_3 string `protobuf:"bytes,8,opt,name=pastel_id_of_registering_supernode_3,json=pastelIdOfRegisteringSupernode3,proto3" json:"pastel_id_of_registering_supernode_3,omitempty"` + IsPastelOpenapiRequest bool `protobuf:"varint,9,opt,name=is_pastel_openapi_request,json=isPastelOpenapiRequest,proto3" json:"is_pastel_openapi_request,omitempty"` + OpenApiGroupIdString string `protobuf:"bytes,10,opt,name=open_api_group_id_string,json=openApiGroupIdString,proto3" json:"open_api_group_id_string,omitempty"` + CollectionNameString string `protobuf:"bytes,11,opt,name=collection_name_string,json=collectionNameString,proto3" json:"collection_name_string,omitempty"` +} + +func (x *RarenessScoreRequest) Reset() { + *x = RarenessScoreRequest{} + mi := &file_dd_server_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RarenessScoreRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RarenessScoreRequest) ProtoMessage() {} + +func (x *RarenessScoreRequest) ProtoReflect() protoreflect.Message { + mi := &file_dd_server_proto_msgTypes[0] + 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 RarenessScoreRequest.ProtoReflect.Descriptor instead. +func (*RarenessScoreRequest) Descriptor() ([]byte, []int) { + return file_dd_server_proto_rawDescGZIP(), []int{0} +} + +func (x *RarenessScoreRequest) GetImageFilepath() string { + if x != nil { + return x.ImageFilepath + } + return "" +} + +func (x *RarenessScoreRequest) GetPastelBlockHashWhenRequestSubmitted() string { + if x != nil { + return x.PastelBlockHashWhenRequestSubmitted + } + return "" +} + +func (x *RarenessScoreRequest) GetPastelBlockHeightWhenRequestSubmitted() string { + if x != nil { + return x.PastelBlockHeightWhenRequestSubmitted + } + return "" +} + +func (x *RarenessScoreRequest) GetUtcTimestampWhenRequestSubmitted() string { + if x != nil { + return x.UtcTimestampWhenRequestSubmitted + } + return "" +} + +func (x *RarenessScoreRequest) GetPastelIdOfSubmitter() string { + if x != nil { + return x.PastelIdOfSubmitter + } + return "" +} + +func (x *RarenessScoreRequest) GetPastelIdOfRegisteringSupernode_1() string { + if x != nil { + return x.PastelIdOfRegisteringSupernode_1 + } + return "" +} + +func (x *RarenessScoreRequest) GetPastelIdOfRegisteringSupernode_2() string { + if x != nil { + return x.PastelIdOfRegisteringSupernode_2 + } + return "" +} + +func (x *RarenessScoreRequest) GetPastelIdOfRegisteringSupernode_3() string { + if x != nil { + return x.PastelIdOfRegisteringSupernode_3 + } + return "" +} + +func (x *RarenessScoreRequest) GetIsPastelOpenapiRequest() bool { + if x != nil { + return x.IsPastelOpenapiRequest + } + return false +} + +func (x *RarenessScoreRequest) GetOpenApiGroupIdString() string { + if x != nil { + return x.OpenApiGroupIdString + } + return "" +} + +func (x *RarenessScoreRequest) GetCollectionNameString() string { + if x != nil { + return x.CollectionNameString + } + return "" +} + +type ImageRarenessScoreReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PastelBlockHashWhenRequestSubmitted string `protobuf:"bytes,1,opt,name=pastel_block_hash_when_request_submitted,json=pastelBlockHashWhenRequestSubmitted,proto3" json:"pastel_block_hash_when_request_submitted,omitempty"` + PastelBlockHeightWhenRequestSubmitted string `protobuf:"bytes,2,opt,name=pastel_block_height_when_request_submitted,json=pastelBlockHeightWhenRequestSubmitted,proto3" json:"pastel_block_height_when_request_submitted,omitempty"` + UtcTimestampWhenRequestSubmitted string `protobuf:"bytes,3,opt,name=utc_timestamp_when_request_submitted,json=utcTimestampWhenRequestSubmitted,proto3" json:"utc_timestamp_when_request_submitted,omitempty"` + PastelIdOfSubmitter string `protobuf:"bytes,4,opt,name=pastel_id_of_submitter,json=pastelIdOfSubmitter,proto3" json:"pastel_id_of_submitter,omitempty"` + PastelIdOfRegisteringSupernode_1 string `protobuf:"bytes,5,opt,name=pastel_id_of_registering_supernode_1,json=pastelIdOfRegisteringSupernode1,proto3" json:"pastel_id_of_registering_supernode_1,omitempty"` + PastelIdOfRegisteringSupernode_2 string `protobuf:"bytes,6,opt,name=pastel_id_of_registering_supernode_2,json=pastelIdOfRegisteringSupernode2,proto3" json:"pastel_id_of_registering_supernode_2,omitempty"` + PastelIdOfRegisteringSupernode_3 string `protobuf:"bytes,7,opt,name=pastel_id_of_registering_supernode_3,json=pastelIdOfRegisteringSupernode3,proto3" json:"pastel_id_of_registering_supernode_3,omitempty"` + IsPastelOpenapiRequest bool `protobuf:"varint,8,opt,name=is_pastel_openapi_request,json=isPastelOpenapiRequest,proto3" json:"is_pastel_openapi_request,omitempty"` + ImageFilePath string `protobuf:"bytes,9,opt,name=image_file_path,json=imageFilePath,proto3" json:"image_file_path,omitempty"` + DupeDetectionSystemVersion string `protobuf:"bytes,10,opt,name=dupe_detection_system_version,json=dupeDetectionSystemVersion,proto3" json:"dupe_detection_system_version,omitempty"` + IsLikelyDupe bool `protobuf:"varint,11,opt,name=is_likely_dupe,json=isLikelyDupe,proto3" json:"is_likely_dupe,omitempty"` + IsRareOnInternet bool `protobuf:"varint,12,opt,name=is_rare_on_internet,json=isRareOnInternet,proto3" json:"is_rare_on_internet,omitempty"` + OverallRarenessScore float32 `protobuf:"fixed32,13,opt,name=overall_rareness_score,json=overallRarenessScore,proto3" json:"overall_rareness_score,omitempty"` + PctOfTop_10MostSimilarWithDupeProbAbove_25Pct float32 `protobuf:"fixed32,14,opt,name=pct_of_top_10_most_similar_with_dupe_prob_above_25pct,json=pctOfTop10MostSimilarWithDupeProbAbove25pct,proto3" json:"pct_of_top_10_most_similar_with_dupe_prob_above_25pct,omitempty"` + PctOfTop_10MostSimilarWithDupeProbAbove_33Pct float32 `protobuf:"fixed32,15,opt,name=pct_of_top_10_most_similar_with_dupe_prob_above_33pct,json=pctOfTop10MostSimilarWithDupeProbAbove33pct,proto3" json:"pct_of_top_10_most_similar_with_dupe_prob_above_33pct,omitempty"` + PctOfTop_10MostSimilarWithDupeProbAbove_50Pct float32 `protobuf:"fixed32,16,opt,name=pct_of_top_10_most_similar_with_dupe_prob_above_50pct,json=pctOfTop10MostSimilarWithDupeProbAbove50pct,proto3" json:"pct_of_top_10_most_similar_with_dupe_prob_above_50pct,omitempty"` + RarenessScoresTableJsonCompressedB64 string `protobuf:"bytes,17,opt,name=rareness_scores_table_json_compressed_b64,json=rarenessScoresTableJsonCompressedB64,proto3" json:"rareness_scores_table_json_compressed_b64,omitempty"` + InternetRareness *InternetRareness `protobuf:"bytes,18,opt,name=internet_rareness,json=internetRareness,proto3" json:"internet_rareness,omitempty"` + OpenNsfwScore float32 `protobuf:"fixed32,19,opt,name=open_nsfw_score,json=openNsfwScore,proto3" json:"open_nsfw_score,omitempty"` + AlternativeNsfwScores *AltNsfwScores `protobuf:"bytes,20,opt,name=alternative_nsfw_scores,json=alternativeNsfwScores,proto3" json:"alternative_nsfw_scores,omitempty"` + ImageFingerprintOfCandidateImageFile []float64 `protobuf:"fixed64,21,rep,packed,name=image_fingerprint_of_candidate_image_file,json=imageFingerprintOfCandidateImageFile,proto3" json:"image_fingerprint_of_candidate_image_file,omitempty"` + CollectionNameString string `protobuf:"bytes,22,opt,name=collection_name_string,json=collectionNameString,proto3" json:"collection_name_string,omitempty"` + HashOfCandidateImageFile string `protobuf:"bytes,23,opt,name=hash_of_candidate_image_file,json=hashOfCandidateImageFile,proto3" json:"hash_of_candidate_image_file,omitempty"` + OpenApiGroupIdString string `protobuf:"bytes,24,opt,name=open_api_group_id_string,json=openApiGroupIdString,proto3" json:"open_api_group_id_string,omitempty"` + GroupRarenessScore float32 `protobuf:"fixed32,25,opt,name=group_rareness_score,json=groupRarenessScore,proto3" json:"group_rareness_score,omitempty"` + CandidateImageThumbnailWebpAsBase64String string `protobuf:"bytes,26,opt,name=candidate_image_thumbnail_webp_as_base64_string,json=candidateImageThumbnailWebpAsBase64String,proto3" json:"candidate_image_thumbnail_webp_as_base64_string,omitempty"` + DoesNotImpactTheFollowingCollectionStrings string `protobuf:"bytes,27,opt,name=does_not_impact_the_following_collection_strings,json=doesNotImpactTheFollowingCollectionStrings,proto3" json:"does_not_impact_the_following_collection_strings,omitempty"` + IsInvalidSenseRequest bool `protobuf:"varint,28,opt,name=is_invalid_sense_request,json=isInvalidSenseRequest,proto3" json:"is_invalid_sense_request,omitempty"` + InvalidSenseRequestReason string `protobuf:"bytes,29,opt,name=invalid_sense_request_reason,json=invalidSenseRequestReason,proto3" json:"invalid_sense_request_reason,omitempty"` + SimilarityScoreToFirstEntryInCollection float32 `protobuf:"fixed32,30,opt,name=similarity_score_to_first_entry_in_collection,json=similarityScoreToFirstEntryInCollection,proto3" json:"similarity_score_to_first_entry_in_collection,omitempty"` + CpProbability float32 `protobuf:"fixed32,31,opt,name=cp_probability,json=cpProbability,proto3" json:"cp_probability,omitempty"` + ChildProbability float32 `protobuf:"fixed32,32,opt,name=child_probability,json=childProbability,proto3" json:"child_probability,omitempty"` + ImageFingerprintSetChecksum string `protobuf:"bytes,33,opt,name=image_fingerprint_set_checksum,json=imageFingerprintSetChecksum,proto3" json:"image_fingerprint_set_checksum,omitempty"` +} + +func (x *ImageRarenessScoreReply) Reset() { + *x = ImageRarenessScoreReply{} + mi := &file_dd_server_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ImageRarenessScoreReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImageRarenessScoreReply) ProtoMessage() {} + +func (x *ImageRarenessScoreReply) ProtoReflect() protoreflect.Message { + mi := &file_dd_server_proto_msgTypes[1] + 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 ImageRarenessScoreReply.ProtoReflect.Descriptor instead. +func (*ImageRarenessScoreReply) Descriptor() ([]byte, []int) { + return file_dd_server_proto_rawDescGZIP(), []int{1} +} + +func (x *ImageRarenessScoreReply) GetPastelBlockHashWhenRequestSubmitted() string { + if x != nil { + return x.PastelBlockHashWhenRequestSubmitted + } + return "" +} + +func (x *ImageRarenessScoreReply) GetPastelBlockHeightWhenRequestSubmitted() string { + if x != nil { + return x.PastelBlockHeightWhenRequestSubmitted + } + return "" +} + +func (x *ImageRarenessScoreReply) GetUtcTimestampWhenRequestSubmitted() string { + if x != nil { + return x.UtcTimestampWhenRequestSubmitted + } + return "" +} + +func (x *ImageRarenessScoreReply) GetPastelIdOfSubmitter() string { + if x != nil { + return x.PastelIdOfSubmitter + } + return "" +} + +func (x *ImageRarenessScoreReply) GetPastelIdOfRegisteringSupernode_1() string { + if x != nil { + return x.PastelIdOfRegisteringSupernode_1 + } + return "" +} + +func (x *ImageRarenessScoreReply) GetPastelIdOfRegisteringSupernode_2() string { + if x != nil { + return x.PastelIdOfRegisteringSupernode_2 + } + return "" +} + +func (x *ImageRarenessScoreReply) GetPastelIdOfRegisteringSupernode_3() string { + if x != nil { + return x.PastelIdOfRegisteringSupernode_3 + } + return "" +} + +func (x *ImageRarenessScoreReply) GetIsPastelOpenapiRequest() bool { + if x != nil { + return x.IsPastelOpenapiRequest + } + return false +} + +func (x *ImageRarenessScoreReply) GetImageFilePath() string { + if x != nil { + return x.ImageFilePath + } + return "" +} + +func (x *ImageRarenessScoreReply) GetDupeDetectionSystemVersion() string { + if x != nil { + return x.DupeDetectionSystemVersion + } + return "" +} + +func (x *ImageRarenessScoreReply) GetIsLikelyDupe() bool { + if x != nil { + return x.IsLikelyDupe + } + return false +} + +func (x *ImageRarenessScoreReply) GetIsRareOnInternet() bool { + if x != nil { + return x.IsRareOnInternet + } + return false +} + +func (x *ImageRarenessScoreReply) GetOverallRarenessScore() float32 { + if x != nil { + return x.OverallRarenessScore + } + return 0 +} + +func (x *ImageRarenessScoreReply) GetPctOfTop_10MostSimilarWithDupeProbAbove_25Pct() float32 { + if x != nil { + return x.PctOfTop_10MostSimilarWithDupeProbAbove_25Pct + } + return 0 +} + +func (x *ImageRarenessScoreReply) GetPctOfTop_10MostSimilarWithDupeProbAbove_33Pct() float32 { + if x != nil { + return x.PctOfTop_10MostSimilarWithDupeProbAbove_33Pct + } + return 0 +} + +func (x *ImageRarenessScoreReply) GetPctOfTop_10MostSimilarWithDupeProbAbove_50Pct() float32 { + if x != nil { + return x.PctOfTop_10MostSimilarWithDupeProbAbove_50Pct + } + return 0 +} + +func (x *ImageRarenessScoreReply) GetRarenessScoresTableJsonCompressedB64() string { + if x != nil { + return x.RarenessScoresTableJsonCompressedB64 + } + return "" +} + +func (x *ImageRarenessScoreReply) GetInternetRareness() *InternetRareness { + if x != nil { + return x.InternetRareness + } + return nil +} + +func (x *ImageRarenessScoreReply) GetOpenNsfwScore() float32 { + if x != nil { + return x.OpenNsfwScore + } + return 0 +} + +func (x *ImageRarenessScoreReply) GetAlternativeNsfwScores() *AltNsfwScores { + if x != nil { + return x.AlternativeNsfwScores + } + return nil +} + +func (x *ImageRarenessScoreReply) GetImageFingerprintOfCandidateImageFile() []float64 { + if x != nil { + return x.ImageFingerprintOfCandidateImageFile + } + return nil +} + +func (x *ImageRarenessScoreReply) GetCollectionNameString() string { + if x != nil { + return x.CollectionNameString + } + return "" +} + +func (x *ImageRarenessScoreReply) GetHashOfCandidateImageFile() string { + if x != nil { + return x.HashOfCandidateImageFile + } + return "" +} + +func (x *ImageRarenessScoreReply) GetOpenApiGroupIdString() string { + if x != nil { + return x.OpenApiGroupIdString + } + return "" +} + +func (x *ImageRarenessScoreReply) GetGroupRarenessScore() float32 { + if x != nil { + return x.GroupRarenessScore + } + return 0 +} + +func (x *ImageRarenessScoreReply) GetCandidateImageThumbnailWebpAsBase64String() string { + if x != nil { + return x.CandidateImageThumbnailWebpAsBase64String + } + return "" +} + +func (x *ImageRarenessScoreReply) GetDoesNotImpactTheFollowingCollectionStrings() string { + if x != nil { + return x.DoesNotImpactTheFollowingCollectionStrings + } + return "" +} + +func (x *ImageRarenessScoreReply) GetIsInvalidSenseRequest() bool { + if x != nil { + return x.IsInvalidSenseRequest + } + return false +} + +func (x *ImageRarenessScoreReply) GetInvalidSenseRequestReason() string { + if x != nil { + return x.InvalidSenseRequestReason + } + return "" +} + +func (x *ImageRarenessScoreReply) GetSimilarityScoreToFirstEntryInCollection() float32 { + if x != nil { + return x.SimilarityScoreToFirstEntryInCollection + } + return 0 +} + +func (x *ImageRarenessScoreReply) GetCpProbability() float32 { + if x != nil { + return x.CpProbability + } + return 0 +} + +func (x *ImageRarenessScoreReply) GetChildProbability() float32 { + if x != nil { + return x.ChildProbability + } + return 0 +} + +func (x *ImageRarenessScoreReply) GetImageFingerprintSetChecksum() string { + if x != nil { + return x.ImageFingerprintSetChecksum + } + return "" +} + +type InternetRareness struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RareOnInternetSummaryTableAsJsonCompressedB64 string `protobuf:"bytes,1,opt,name=rare_on_internet_summary_table_as_json_compressed_b64,json=rareOnInternetSummaryTableAsJsonCompressedB64,proto3" json:"rare_on_internet_summary_table_as_json_compressed_b64,omitempty"` + RareOnInternetGraphJsonCompressedB64 string `protobuf:"bytes,2,opt,name=rare_on_internet_graph_json_compressed_b64,json=rareOnInternetGraphJsonCompressedB64,proto3" json:"rare_on_internet_graph_json_compressed_b64,omitempty"` + AlternativeRareOnInternetDictAsJsonCompressedB64 string `protobuf:"bytes,3,opt,name=alternative_rare_on_internet_dict_as_json_compressed_b64,json=alternativeRareOnInternetDictAsJsonCompressedB64,proto3" json:"alternative_rare_on_internet_dict_as_json_compressed_b64,omitempty"` + MinNumberOfExactMatchesInPage uint32 `protobuf:"varint,4,opt,name=min_number_of_exact_matches_in_page,json=minNumberOfExactMatchesInPage,proto3" json:"min_number_of_exact_matches_in_page,omitempty"` + EarliestAvailableDateOfInternetResults string `protobuf:"bytes,5,opt,name=earliest_available_date_of_internet_results,json=earliestAvailableDateOfInternetResults,proto3" json:"earliest_available_date_of_internet_results,omitempty"` +} + +func (x *InternetRareness) Reset() { + *x = InternetRareness{} + mi := &file_dd_server_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InternetRareness) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InternetRareness) ProtoMessage() {} + +func (x *InternetRareness) ProtoReflect() protoreflect.Message { + mi := &file_dd_server_proto_msgTypes[2] + 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 InternetRareness.ProtoReflect.Descriptor instead. +func (*InternetRareness) Descriptor() ([]byte, []int) { + return file_dd_server_proto_rawDescGZIP(), []int{2} +} + +func (x *InternetRareness) GetRareOnInternetSummaryTableAsJsonCompressedB64() string { + if x != nil { + return x.RareOnInternetSummaryTableAsJsonCompressedB64 + } + return "" +} + +func (x *InternetRareness) GetRareOnInternetGraphJsonCompressedB64() string { + if x != nil { + return x.RareOnInternetGraphJsonCompressedB64 + } + return "" +} + +func (x *InternetRareness) GetAlternativeRareOnInternetDictAsJsonCompressedB64() string { + if x != nil { + return x.AlternativeRareOnInternetDictAsJsonCompressedB64 + } + return "" +} + +func (x *InternetRareness) GetMinNumberOfExactMatchesInPage() uint32 { + if x != nil { + return x.MinNumberOfExactMatchesInPage + } + return 0 +} + +func (x *InternetRareness) GetEarliestAvailableDateOfInternetResults() string { + if x != nil { + return x.EarliestAvailableDateOfInternetResults + } + return "" +} + +type AltNsfwScores struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Drawings float32 `protobuf:"fixed32,1,opt,name=drawings,proto3" json:"drawings,omitempty"` + Hentai float32 `protobuf:"fixed32,2,opt,name=hentai,proto3" json:"hentai,omitempty"` + Neutral float32 `protobuf:"fixed32,3,opt,name=neutral,proto3" json:"neutral,omitempty"` + Porn float32 `protobuf:"fixed32,4,opt,name=porn,proto3" json:"porn,omitempty"` + Sexy float32 `protobuf:"fixed32,5,opt,name=sexy,proto3" json:"sexy,omitempty"` +} + +func (x *AltNsfwScores) Reset() { + *x = AltNsfwScores{} + mi := &file_dd_server_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AltNsfwScores) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AltNsfwScores) ProtoMessage() {} + +func (x *AltNsfwScores) ProtoReflect() protoreflect.Message { + mi := &file_dd_server_proto_msgTypes[3] + 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 AltNsfwScores.ProtoReflect.Descriptor instead. +func (*AltNsfwScores) Descriptor() ([]byte, []int) { + return file_dd_server_proto_rawDescGZIP(), []int{3} +} + +func (x *AltNsfwScores) GetDrawings() float32 { + if x != nil { + return x.Drawings + } + return 0 +} + +func (x *AltNsfwScores) GetHentai() float32 { + if x != nil { + return x.Hentai + } + return 0 +} + +func (x *AltNsfwScores) GetNeutral() float32 { + if x != nil { + return x.Neutral + } + return 0 +} + +func (x *AltNsfwScores) GetPorn() float32 { + if x != nil { + return x.Porn + } + return 0 +} + +func (x *AltNsfwScores) GetSexy() float32 { + if x != nil { + return x.Sexy + } + return 0 +} + +type GetStatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetStatusRequest) Reset() { + *x = GetStatusRequest{} + mi := &file_dd_server_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetStatusRequest) ProtoMessage() {} + +func (x *GetStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_dd_server_proto_msgTypes[4] + 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 GetStatusRequest.ProtoReflect.Descriptor instead. +func (*GetStatusRequest) Descriptor() ([]byte, []int) { + return file_dd_server_proto_rawDescGZIP(), []int{4} +} + +type TaskCount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MaxConcurrent int32 `protobuf:"varint,1,opt,name=max_concurrent,json=maxConcurrent,proto3" json:"max_concurrent,omitempty"` + Executing int32 `protobuf:"varint,2,opt,name=executing,proto3" json:"executing,omitempty"` + WaitingInQueue int32 `protobuf:"varint,3,opt,name=waiting_in_queue,json=waitingInQueue,proto3" json:"waiting_in_queue,omitempty"` + Succeeded int32 `protobuf:"varint,4,opt,name=succeeded,proto3" json:"succeeded,omitempty"` + Failed int32 `protobuf:"varint,5,opt,name=failed,proto3" json:"failed,omitempty"` + Cancelled int32 `protobuf:"varint,6,opt,name=cancelled,proto3" json:"cancelled,omitempty"` +} + +func (x *TaskCount) Reset() { + *x = TaskCount{} + mi := &file_dd_server_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TaskCount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskCount) ProtoMessage() {} + +func (x *TaskCount) ProtoReflect() protoreflect.Message { + mi := &file_dd_server_proto_msgTypes[5] + 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 TaskCount.ProtoReflect.Descriptor instead. +func (*TaskCount) Descriptor() ([]byte, []int) { + return file_dd_server_proto_rawDescGZIP(), []int{5} +} + +func (x *TaskCount) GetMaxConcurrent() int32 { + if x != nil { + return x.MaxConcurrent + } + return 0 +} + +func (x *TaskCount) GetExecuting() int32 { + if x != nil { + return x.Executing + } + return 0 +} + +func (x *TaskCount) GetWaitingInQueue() int32 { + if x != nil { + return x.WaitingInQueue + } + return 0 +} + +func (x *TaskCount) GetSucceeded() int32 { + if x != nil { + return x.Succeeded + } + return 0 +} + +func (x *TaskCount) GetFailed() int32 { + if x != nil { + return x.Failed + } + return 0 +} + +func (x *TaskCount) GetCancelled() int32 { + if x != nil { + return x.Cancelled + } + return 0 +} + +type TaskMetrics struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AverageTaskWaitTimeSecs float32 `protobuf:"fixed32,1,opt,name=average_task_wait_time_secs,json=averageTaskWaitTimeSecs,proto3" json:"average_task_wait_time_secs,omitempty"` + MaxTaskWaitTimeSecs float32 `protobuf:"fixed32,2,opt,name=max_task_wait_time_secs,json=maxTaskWaitTimeSecs,proto3" json:"max_task_wait_time_secs,omitempty"` + AverageTaskExecutionTimeSecs float32 `protobuf:"fixed32,3,opt,name=average_task_execution_time_secs,json=averageTaskExecutionTimeSecs,proto3" json:"average_task_execution_time_secs,omitempty"` + AverageTaskVirtualMemoryUsageBytes int64 `protobuf:"varint,4,opt,name=average_task_virtual_memory_usage_bytes,json=averageTaskVirtualMemoryUsageBytes,proto3" json:"average_task_virtual_memory_usage_bytes,omitempty"` + AverageTaskRssMemoryUsageBytes int64 `protobuf:"varint,5,opt,name=average_task_rss_memory_usage_bytes,json=averageTaskRssMemoryUsageBytes,proto3" json:"average_task_rss_memory_usage_bytes,omitempty"` + PeakTaskRssMemoryUsageBytes int64 `protobuf:"varint,6,opt,name=peak_task_rss_memory_usage_bytes,json=peakTaskRssMemoryUsageBytes,proto3" json:"peak_task_rss_memory_usage_bytes,omitempty"` + PeakTaskVmsMemoryUsageBytes int64 `protobuf:"varint,7,opt,name=peak_task_vms_memory_usage_bytes,json=peakTaskVmsMemoryUsageBytes,proto3" json:"peak_task_vms_memory_usage_bytes,omitempty"` +} + +func (x *TaskMetrics) Reset() { + *x = TaskMetrics{} + mi := &file_dd_server_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TaskMetrics) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskMetrics) ProtoMessage() {} + +func (x *TaskMetrics) ProtoReflect() protoreflect.Message { + mi := &file_dd_server_proto_msgTypes[6] + 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 TaskMetrics.ProtoReflect.Descriptor instead. +func (*TaskMetrics) Descriptor() ([]byte, []int) { + return file_dd_server_proto_rawDescGZIP(), []int{6} +} + +func (x *TaskMetrics) GetAverageTaskWaitTimeSecs() float32 { + if x != nil { + return x.AverageTaskWaitTimeSecs + } + return 0 +} + +func (x *TaskMetrics) GetMaxTaskWaitTimeSecs() float32 { + if x != nil { + return x.MaxTaskWaitTimeSecs + } + return 0 +} + +func (x *TaskMetrics) GetAverageTaskExecutionTimeSecs() float32 { + if x != nil { + return x.AverageTaskExecutionTimeSecs + } + return 0 +} + +func (x *TaskMetrics) GetAverageTaskVirtualMemoryUsageBytes() int64 { + if x != nil { + return x.AverageTaskVirtualMemoryUsageBytes + } + return 0 +} + +func (x *TaskMetrics) GetAverageTaskRssMemoryUsageBytes() int64 { + if x != nil { + return x.AverageTaskRssMemoryUsageBytes + } + return 0 +} + +func (x *TaskMetrics) GetPeakTaskRssMemoryUsageBytes() int64 { + if x != nil { + return x.PeakTaskRssMemoryUsageBytes + } + return 0 +} + +func (x *TaskMetrics) GetPeakTaskVmsMemoryUsageBytes() int64 { + if x != nil { + return x.PeakTaskVmsMemoryUsageBytes + } + return 0 +} + +type GetStatusResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + TaskCount *TaskCount `protobuf:"bytes,2,opt,name=task_count,json=taskCount,proto3" json:"task_count,omitempty"` + TaskMetrics *TaskMetrics `protobuf:"bytes,3,opt,name=task_metrics,json=taskMetrics,proto3" json:"task_metrics,omitempty"` +} + +func (x *GetStatusResponse) Reset() { + *x = GetStatusResponse{} + mi := &file_dd_server_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetStatusResponse) ProtoMessage() {} + +func (x *GetStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_dd_server_proto_msgTypes[7] + 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 GetStatusResponse.ProtoReflect.Descriptor instead. +func (*GetStatusResponse) Descriptor() ([]byte, []int) { + return file_dd_server_proto_rawDescGZIP(), []int{7} +} + +func (x *GetStatusResponse) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *GetStatusResponse) GetTaskCount() *TaskCount { + if x != nil { + return x.TaskCount + } + return nil +} + +func (x *GetStatusResponse) GetTaskMetrics() *TaskMetrics { + if x != nil { + return x.TaskMetrics + } + return nil +} + +var File_dd_server_proto protoreflect.FileDescriptor + +var file_dd_server_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x64, 0x64, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0d, 0x64, 0x75, 0x70, 0x65, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0x8a, 0x06, 0x0a, 0x14, 0x52, 0x61, 0x72, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x53, 0x63, 0x6f, + 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x70, 0x61, 0x74, 0x68, + 0x12, 0x55, 0x0a, 0x28, 0x70, 0x61, 0x73, 0x74, 0x65, 0x6c, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x77, 0x68, 0x65, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x5f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x23, 0x70, 0x61, 0x73, 0x74, 0x65, 0x6c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, + 0x61, 0x73, 0x68, 0x57, 0x68, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x75, + 0x62, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x12, 0x59, 0x0a, 0x2a, 0x70, 0x61, 0x73, 0x74, 0x65, + 0x6c, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x77, + 0x68, 0x65, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x25, 0x70, 0x61, 0x73, + 0x74, 0x65, 0x6c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x57, 0x68, + 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x64, 0x12, 0x4e, 0x0a, 0x24, 0x75, 0x74, 0x63, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x5f, 0x77, 0x68, 0x65, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x5f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x20, 0x75, 0x74, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x57, 0x68, + 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x64, 0x12, 0x33, 0x0a, 0x16, 0x70, 0x61, 0x73, 0x74, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x5f, + 0x6f, 0x66, 0x5f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x13, 0x70, 0x61, 0x73, 0x74, 0x65, 0x6c, 0x49, 0x64, 0x4f, 0x66, 0x53, 0x75, + 0x62, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x12, 0x4d, 0x0a, 0x24, 0x70, 0x61, 0x73, 0x74, 0x65, + 0x6c, 0x5f, 0x69, 0x64, 0x5f, 0x6f, 0x66, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x31, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1f, 0x70, 0x61, 0x73, 0x74, 0x65, 0x6c, 0x49, 0x64, 0x4f, + 0x66, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x75, 0x70, 0x65, + 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x31, 0x12, 0x4d, 0x0a, 0x24, 0x70, 0x61, 0x73, 0x74, 0x65, 0x6c, + 0x5f, 0x69, 0x64, 0x5f, 0x6f, 0x66, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x69, + 0x6e, 0x67, 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x32, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x1f, 0x70, 0x61, 0x73, 0x74, 0x65, 0x6c, 0x49, 0x64, 0x4f, 0x66, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x75, 0x70, 0x65, 0x72, + 0x6e, 0x6f, 0x64, 0x65, 0x32, 0x12, 0x4d, 0x0a, 0x24, 0x70, 0x61, 0x73, 0x74, 0x65, 0x6c, 0x5f, + 0x69, 0x64, 0x5f, 0x6f, 0x66, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x33, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x1f, 0x70, 0x61, 0x73, 0x74, 0x65, 0x6c, 0x49, 0x64, 0x4f, 0x66, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x75, 0x70, 0x65, 0x72, 0x6e, + 0x6f, 0x64, 0x65, 0x33, 0x12, 0x39, 0x0a, 0x19, 0x69, 0x73, 0x5f, 0x70, 0x61, 0x73, 0x74, 0x65, + 0x6c, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x69, 0x73, 0x50, 0x61, 0x73, 0x74, 0x65, + 0x6c, 0x4f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x36, 0x0a, 0x18, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x5f, 0x69, 0x64, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x14, 0x6f, 0x70, 0x65, 0x6e, 0x41, 0x70, 0x69, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, + 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x34, 0x0a, 0x16, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0xcd, 0x12, + 0x0a, 0x17, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x61, 0x72, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x53, + 0x63, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x55, 0x0a, 0x28, 0x70, 0x61, 0x73, + 0x74, 0x65, 0x6c, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x77, + 0x68, 0x65, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x23, 0x70, 0x61, 0x73, + 0x74, 0x65, 0x6c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x57, 0x68, 0x65, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, + 0x12, 0x59, 0x0a, 0x2a, 0x70, 0x61, 0x73, 0x74, 0x65, 0x6c, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x77, 0x68, 0x65, 0x6e, 0x5f, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x25, 0x70, 0x61, 0x73, 0x74, 0x65, 0x6c, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x57, 0x68, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x12, 0x4e, 0x0a, 0x24, 0x75, + 0x74, 0x63, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x77, 0x68, 0x65, + 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, + 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x20, 0x75, 0x74, 0x63, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x57, 0x68, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x12, 0x33, 0x0a, 0x16, 0x70, + 0x61, 0x73, 0x74, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x5f, 0x6f, 0x66, 0x5f, 0x73, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x70, 0x61, 0x73, + 0x74, 0x65, 0x6c, 0x49, 0x64, 0x4f, 0x66, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, + 0x12, 0x4d, 0x0a, 0x24, 0x70, 0x61, 0x73, 0x74, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x5f, 0x6f, 0x66, + 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x75, 0x70, + 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x31, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1f, + 0x70, 0x61, 0x73, 0x74, 0x65, 0x6c, 0x49, 0x64, 0x4f, 0x66, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x31, 0x12, + 0x4d, 0x0a, 0x24, 0x70, 0x61, 0x73, 0x74, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x5f, 0x6f, 0x66, 0x5f, + 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x75, 0x70, 0x65, + 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x32, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1f, 0x70, + 0x61, 0x73, 0x74, 0x65, 0x6c, 0x49, 0x64, 0x4f, 0x66, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x69, 0x6e, 0x67, 0x53, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x32, 0x12, 0x4d, + 0x0a, 0x24, 0x70, 0x61, 0x73, 0x74, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x5f, 0x6f, 0x66, 0x5f, 0x72, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, + 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x33, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1f, 0x70, 0x61, + 0x73, 0x74, 0x65, 0x6c, 0x49, 0x64, 0x4f, 0x66, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x69, 0x6e, 0x67, 0x53, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x33, 0x12, 0x39, 0x0a, + 0x19, 0x69, 0x73, 0x5f, 0x70, 0x61, 0x73, 0x74, 0x65, 0x6c, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x16, 0x69, 0x73, 0x50, 0x61, 0x73, 0x74, 0x65, 0x6c, 0x4f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x69, 0x6d, 0x61, 0x67, + 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, + 0x12, 0x41, 0x0a, 0x1d, 0x64, 0x75, 0x70, 0x65, 0x5f, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1a, 0x64, 0x75, 0x70, 0x65, 0x44, 0x65, 0x74, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x73, 0x5f, 0x6c, 0x69, 0x6b, 0x65, 0x6c, 0x79, + 0x5f, 0x64, 0x75, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x73, 0x4c, + 0x69, 0x6b, 0x65, 0x6c, 0x79, 0x44, 0x75, 0x70, 0x65, 0x12, 0x2d, 0x0a, 0x13, 0x69, 0x73, 0x5f, + 0x72, 0x61, 0x72, 0x65, 0x5f, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x69, 0x73, 0x52, 0x61, 0x72, 0x65, 0x4f, 0x6e, + 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x12, 0x34, 0x0a, 0x16, 0x6f, 0x76, 0x65, 0x72, + 0x61, 0x6c, 0x6c, 0x5f, 0x72, 0x61, 0x72, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x63, 0x6f, + 0x72, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x02, 0x52, 0x14, 0x6f, 0x76, 0x65, 0x72, 0x61, 0x6c, + 0x6c, 0x52, 0x61, 0x72, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x6a, + 0x0a, 0x35, 0x70, 0x63, 0x74, 0x5f, 0x6f, 0x66, 0x5f, 0x74, 0x6f, 0x70, 0x5f, 0x31, 0x30, 0x5f, + 0x6d, 0x6f, 0x73, 0x74, 0x5f, 0x73, 0x69, 0x6d, 0x69, 0x6c, 0x61, 0x72, 0x5f, 0x77, 0x69, 0x74, + 0x68, 0x5f, 0x64, 0x75, 0x70, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x62, 0x5f, 0x61, 0x62, 0x6f, 0x76, + 0x65, 0x5f, 0x32, 0x35, 0x70, 0x63, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x02, 0x52, 0x2b, 0x70, + 0x63, 0x74, 0x4f, 0x66, 0x54, 0x6f, 0x70, 0x31, 0x30, 0x4d, 0x6f, 0x73, 0x74, 0x53, 0x69, 0x6d, + 0x69, 0x6c, 0x61, 0x72, 0x57, 0x69, 0x74, 0x68, 0x44, 0x75, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x62, + 0x41, 0x62, 0x6f, 0x76, 0x65, 0x32, 0x35, 0x70, 0x63, 0x74, 0x12, 0x6a, 0x0a, 0x35, 0x70, 0x63, + 0x74, 0x5f, 0x6f, 0x66, 0x5f, 0x74, 0x6f, 0x70, 0x5f, 0x31, 0x30, 0x5f, 0x6d, 0x6f, 0x73, 0x74, + 0x5f, 0x73, 0x69, 0x6d, 0x69, 0x6c, 0x61, 0x72, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x64, 0x75, + 0x70, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x62, 0x5f, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x5f, 0x33, 0x33, + 0x70, 0x63, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x02, 0x52, 0x2b, 0x70, 0x63, 0x74, 0x4f, 0x66, + 0x54, 0x6f, 0x70, 0x31, 0x30, 0x4d, 0x6f, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x69, 0x6c, 0x61, 0x72, + 0x57, 0x69, 0x74, 0x68, 0x44, 0x75, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x62, 0x41, 0x62, 0x6f, 0x76, + 0x65, 0x33, 0x33, 0x70, 0x63, 0x74, 0x12, 0x6a, 0x0a, 0x35, 0x70, 0x63, 0x74, 0x5f, 0x6f, 0x66, + 0x5f, 0x74, 0x6f, 0x70, 0x5f, 0x31, 0x30, 0x5f, 0x6d, 0x6f, 0x73, 0x74, 0x5f, 0x73, 0x69, 0x6d, + 0x69, 0x6c, 0x61, 0x72, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x64, 0x75, 0x70, 0x65, 0x5f, 0x70, + 0x72, 0x6f, 0x62, 0x5f, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x5f, 0x35, 0x30, 0x70, 0x63, 0x74, 0x18, + 0x10, 0x20, 0x01, 0x28, 0x02, 0x52, 0x2b, 0x70, 0x63, 0x74, 0x4f, 0x66, 0x54, 0x6f, 0x70, 0x31, + 0x30, 0x4d, 0x6f, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x69, 0x6c, 0x61, 0x72, 0x57, 0x69, 0x74, 0x68, + 0x44, 0x75, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x62, 0x41, 0x62, 0x6f, 0x76, 0x65, 0x35, 0x30, 0x70, + 0x63, 0x74, 0x12, 0x57, 0x0a, 0x29, 0x72, 0x61, 0x72, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x5f, 0x73, + 0x63, 0x6f, 0x72, 0x65, 0x73, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, + 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x5f, 0x62, 0x36, 0x34, 0x18, + 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x24, 0x72, 0x61, 0x72, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x53, + 0x63, 0x6f, 0x72, 0x65, 0x73, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4a, 0x73, 0x6f, 0x6e, 0x43, 0x6f, + 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x42, 0x36, 0x34, 0x12, 0x4c, 0x0a, 0x11, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x5f, 0x72, 0x61, 0x72, 0x65, 0x6e, 0x65, 0x73, 0x73, + 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x64, 0x75, 0x70, 0x65, 0x64, 0x65, 0x74, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x52, + 0x61, 0x72, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x52, 0x10, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, + 0x74, 0x52, 0x61, 0x72, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6f, 0x70, 0x65, + 0x6e, 0x5f, 0x6e, 0x73, 0x66, 0x77, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x13, 0x20, 0x01, + 0x28, 0x02, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x6e, 0x4e, 0x73, 0x66, 0x77, 0x53, 0x63, 0x6f, 0x72, + 0x65, 0x12, 0x54, 0x0a, 0x17, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, + 0x5f, 0x6e, 0x73, 0x66, 0x77, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x14, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x64, 0x75, 0x70, 0x65, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x41, 0x6c, 0x74, 0x4e, 0x73, 0x66, 0x77, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x73, + 0x52, 0x15, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x73, 0x66, + 0x77, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x57, 0x0a, 0x29, 0x69, 0x6d, 0x61, 0x67, 0x65, + 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x5f, 0x6f, 0x66, 0x5f, + 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, + 0x66, 0x69, 0x6c, 0x65, 0x18, 0x15, 0x20, 0x03, 0x28, 0x01, 0x52, 0x24, 0x69, 0x6d, 0x61, 0x67, + 0x65, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x4f, 0x66, 0x43, 0x61, + 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x46, 0x69, 0x6c, 0x65, + 0x12, 0x34, 0x0a, 0x16, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x14, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x3e, 0x0a, 0x1c, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x6f, + 0x66, 0x5f, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6d, 0x61, 0x67, + 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x18, 0x68, 0x61, + 0x73, 0x68, 0x4f, 0x66, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6d, 0x61, + 0x67, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x18, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x61, + 0x70, 0x69, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x5f, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x6f, 0x70, 0x65, 0x6e, 0x41, 0x70, + 0x69, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x30, + 0x0a, 0x14, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x72, 0x61, 0x72, 0x65, 0x6e, 0x65, 0x73, 0x73, + 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x19, 0x20, 0x01, 0x28, 0x02, 0x52, 0x12, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x52, 0x61, 0x72, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x53, 0x63, 0x6f, 0x72, 0x65, + 0x12, 0x62, 0x0a, 0x2f, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6d, + 0x61, 0x67, 0x65, 0x5f, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x5f, 0x77, 0x65, + 0x62, 0x70, 0x5f, 0x61, 0x73, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x36, 0x34, 0x5f, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x29, 0x63, 0x61, 0x6e, 0x64, 0x69, + 0x64, 0x61, 0x74, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, + 0x69, 0x6c, 0x57, 0x65, 0x62, 0x70, 0x41, 0x73, 0x42, 0x61, 0x73, 0x65, 0x36, 0x34, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x12, 0x64, 0x0a, 0x30, 0x64, 0x6f, 0x65, 0x73, 0x5f, 0x6e, 0x6f, 0x74, + 0x5f, 0x69, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x5f, 0x74, 0x68, 0x65, 0x5f, 0x66, 0x6f, 0x6c, 0x6c, + 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x2a, + 0x64, 0x6f, 0x65, 0x73, 0x4e, 0x6f, 0x74, 0x49, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x54, 0x68, 0x65, + 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x37, 0x0a, 0x18, 0x69, 0x73, + 0x5f, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x73, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x69, 0x73, + 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x53, 0x65, 0x6e, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x1c, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x73, + 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x19, 0x69, 0x6e, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x53, 0x65, 0x6e, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, + 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x5e, 0x0a, 0x2d, 0x73, 0x69, 0x6d, 0x69, 0x6c, 0x61, 0x72, 0x69, + 0x74, 0x79, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x66, 0x69, 0x72, 0x73, + 0x74, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x02, 0x52, 0x27, 0x73, 0x69, 0x6d, + 0x69, 0x6c, 0x61, 0x72, 0x69, 0x74, 0x79, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x54, 0x6f, 0x46, 0x69, + 0x72, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x49, 0x6e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x70, 0x5f, 0x70, 0x72, 0x6f, 0x62, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0d, 0x63, 0x70, + 0x50, 0x72, 0x6f, 0x62, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x2b, 0x0a, 0x11, 0x63, + 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x62, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, + 0x18, 0x20, 0x20, 0x01, 0x28, 0x02, 0x52, 0x10, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x50, 0x72, 0x6f, + 0x62, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x43, 0x0a, 0x1e, 0x69, 0x6d, 0x61, 0x67, + 0x65, 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x65, + 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x21, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x1b, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x53, 0x65, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x22, 0xf7, 0x03, + 0x0a, 0x10, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x52, 0x61, 0x72, 0x65, 0x6e, 0x65, + 0x73, 0x73, 0x12, 0x6c, 0x0a, 0x35, 0x72, 0x61, 0x72, 0x65, 0x5f, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x73, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, + 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x5f, 0x62, 0x36, 0x34, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x2d, 0x72, 0x61, 0x72, 0x65, 0x4f, 0x6e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, + 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x73, 0x4a, + 0x73, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x42, 0x36, 0x34, + 0x12, 0x58, 0x0a, 0x2a, 0x72, 0x61, 0x72, 0x65, 0x5f, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x65, 0x74, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, + 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x5f, 0x62, 0x36, 0x34, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x24, 0x72, 0x61, 0x72, 0x65, 0x4f, 0x6e, 0x49, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x65, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x4a, 0x73, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, + 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x42, 0x36, 0x34, 0x12, 0x72, 0x0a, 0x38, 0x61, 0x6c, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x72, 0x61, 0x72, 0x65, 0x5f, 0x6f, + 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x5f, 0x64, 0x69, 0x63, 0x74, 0x5f, + 0x61, 0x73, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, + 0x65, 0x64, 0x5f, 0x62, 0x36, 0x34, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x30, 0x61, 0x6c, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x52, 0x61, 0x72, 0x65, 0x4f, 0x6e, 0x49, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x44, 0x69, 0x63, 0x74, 0x41, 0x73, 0x4a, 0x73, 0x6f, + 0x6e, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x42, 0x36, 0x34, 0x12, 0x4a, + 0x0a, 0x23, 0x6d, 0x69, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x6f, 0x66, 0x5f, + 0x65, 0x78, 0x61, 0x63, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x5f, 0x69, 0x6e, + 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x1d, 0x6d, 0x69, 0x6e, + 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x45, 0x78, 0x61, 0x63, 0x74, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x65, 0x73, 0x49, 0x6e, 0x50, 0x61, 0x67, 0x65, 0x12, 0x5b, 0x0a, 0x2b, 0x65, 0x61, + 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, + 0x5f, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6f, 0x66, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, + 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x26, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, + 0x6c, 0x65, 0x44, 0x61, 0x74, 0x65, 0x4f, 0x66, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x0d, 0x41, 0x6c, 0x74, 0x4e, + 0x73, 0x66, 0x77, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x72, 0x61, + 0x77, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x64, 0x72, 0x61, + 0x77, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x6e, 0x74, 0x61, 0x69, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x68, 0x65, 0x6e, 0x74, 0x61, 0x69, 0x12, 0x18, 0x0a, + 0x07, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x07, + 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x6e, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x65, 0x78, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52, 0x04, 0x73, 0x65, 0x78, 0x79, 0x22, + 0x12, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0xce, 0x01, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x43, 0x6f, + 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x28, 0x0a, 0x10, 0x77, 0x61, 0x69, 0x74, 0x69, 0x6e, + 0x67, 0x5f, 0x69, 0x6e, 0x5f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0e, 0x77, 0x61, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x51, 0x75, 0x65, 0x75, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x12, 0x16, + 0x0a, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x6c, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x6c, 0x65, 0x64, 0x22, 0xf9, 0x03, 0x0a, 0x0b, 0x54, 0x61, 0x73, 0x6b, 0x4d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x73, 0x12, 0x3c, 0x0a, 0x1b, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x5f, + 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x77, 0x61, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, + 0x65, 0x63, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x17, 0x61, 0x76, 0x65, 0x72, 0x61, + 0x67, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x57, 0x61, 0x69, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, + 0x63, 0x73, 0x12, 0x34, 0x0a, 0x17, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x77, + 0x61, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x02, 0x52, 0x13, 0x6d, 0x61, 0x78, 0x54, 0x61, 0x73, 0x6b, 0x57, 0x61, 0x69, 0x74, + 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x63, 0x73, 0x12, 0x46, 0x0a, 0x20, 0x61, 0x76, 0x65, 0x72, + 0x61, 0x67, 0x65, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x02, 0x52, 0x1c, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x63, 0x73, + 0x12, 0x53, 0x0a, 0x27, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x61, 0x73, 0x6b, + 0x5f, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, + 0x75, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x22, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x56, 0x69, + 0x72, 0x74, 0x75, 0x61, 0x6c, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x55, 0x73, 0x61, 0x67, 0x65, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x4b, 0x0a, 0x23, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, + 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x72, 0x73, 0x73, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, + 0x5f, 0x75, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x1e, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, + 0x73, 0x73, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x55, 0x73, 0x61, 0x67, 0x65, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x12, 0x45, 0x0a, 0x20, 0x70, 0x65, 0x61, 0x6b, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x5f, + 0x72, 0x73, 0x73, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x75, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1b, 0x70, 0x65, + 0x61, 0x6b, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x73, 0x73, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x55, + 0x73, 0x61, 0x67, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x45, 0x0a, 0x20, 0x70, 0x65, 0x61, + 0x6b, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x76, 0x6d, 0x73, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, + 0x79, 0x5f, 0x75, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x1b, 0x70, 0x65, 0x61, 0x6b, 0x54, 0x61, 0x73, 0x6b, 0x56, 0x6d, 0x73, + 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x55, 0x73, 0x61, 0x67, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x22, 0xa5, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x37, 0x0a, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x64, 0x75, 0x70, 0x65, 0x64, 0x65, 0x74, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x09, + 0x74, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x0c, 0x74, 0x61, 0x73, + 0x6b, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x64, 0x75, 0x70, 0x65, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x54, 0x61, 0x73, 0x6b, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x0b, 0x74, 0x61, 0x73, + 0x6b, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x32, 0xc8, 0x01, 0x0a, 0x13, 0x44, 0x75, 0x70, + 0x65, 0x44, 0x65, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x12, 0x61, 0x0a, 0x12, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x61, 0x72, 0x65, 0x6e, 0x65, 0x73, + 0x73, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x23, 0x2e, 0x64, 0x75, 0x70, 0x65, 0x64, 0x65, 0x74, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x61, 0x72, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x53, + 0x63, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x64, 0x75, + 0x70, 0x65, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x52, 0x61, 0x72, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x12, 0x4e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x1f, 0x2e, 0x64, 0x75, 0x70, 0x65, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x20, 0x2e, 0x64, 0x75, 0x70, 0x65, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x4c, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x2f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x64, + 0x75, 0x70, 0x65, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_dd_server_proto_rawDescOnce sync.Once + file_dd_server_proto_rawDescData = file_dd_server_proto_rawDesc +) + +func file_dd_server_proto_rawDescGZIP() []byte { + file_dd_server_proto_rawDescOnce.Do(func() { + file_dd_server_proto_rawDescData = protoimpl.X.CompressGZIP(file_dd_server_proto_rawDescData) + }) + return file_dd_server_proto_rawDescData +} + +var file_dd_server_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_dd_server_proto_goTypes = []any{ + (*RarenessScoreRequest)(nil), // 0: dupedetection.RarenessScoreRequest + (*ImageRarenessScoreReply)(nil), // 1: dupedetection.ImageRarenessScoreReply + (*InternetRareness)(nil), // 2: dupedetection.InternetRareness + (*AltNsfwScores)(nil), // 3: dupedetection.AltNsfwScores + (*GetStatusRequest)(nil), // 4: dupedetection.GetStatusRequest + (*TaskCount)(nil), // 5: dupedetection.TaskCount + (*TaskMetrics)(nil), // 6: dupedetection.TaskMetrics + (*GetStatusResponse)(nil), // 7: dupedetection.GetStatusResponse +} +var file_dd_server_proto_depIdxs = []int32{ + 2, // 0: dupedetection.ImageRarenessScoreReply.internet_rareness:type_name -> dupedetection.InternetRareness + 3, // 1: dupedetection.ImageRarenessScoreReply.alternative_nsfw_scores:type_name -> dupedetection.AltNsfwScores + 5, // 2: dupedetection.GetStatusResponse.task_count:type_name -> dupedetection.TaskCount + 6, // 3: dupedetection.GetStatusResponse.task_metrics:type_name -> dupedetection.TaskMetrics + 0, // 4: dupedetection.DupeDetectionServer.ImageRarenessScore:input_type -> dupedetection.RarenessScoreRequest + 4, // 5: dupedetection.DupeDetectionServer.GetStatus:input_type -> dupedetection.GetStatusRequest + 1, // 6: dupedetection.DupeDetectionServer.ImageRarenessScore:output_type -> dupedetection.ImageRarenessScoreReply + 7, // 7: dupedetection.DupeDetectionServer.GetStatus:output_type -> dupedetection.GetStatusResponse + 6, // [6:8] is the sub-list for method output_type + 4, // [4:6] 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_dd_server_proto_init() } +func file_dd_server_proto_init() { + if File_dd_server_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_dd_server_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_dd_server_proto_goTypes, + DependencyIndexes: file_dd_server_proto_depIdxs, + MessageInfos: file_dd_server_proto_msgTypes, + }.Build() + File_dd_server_proto = out.File + file_dd_server_proto_rawDesc = nil + file_dd_server_proto_goTypes = nil + file_dd_server_proto_depIdxs = nil +} diff --git a/gen/dupedetection/dd-server_grpc.pb.go b/gen/dupedetection/dd-server_grpc.pb.go new file mode 100644 index 00000000..27ee79bf --- /dev/null +++ b/gen/dupedetection/dd-server_grpc.pb.go @@ -0,0 +1,150 @@ +// Copyright (c) 2021-2021 The Pastel Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v3.12.4 +// source: dd-server.proto + +package dupedetection + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// 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.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + DupeDetectionServer_ImageRarenessScore_FullMethodName = "/dupedetection.DupeDetectionServer/ImageRarenessScore" + DupeDetectionServer_GetStatus_FullMethodName = "/dupedetection.DupeDetectionServer/GetStatus" +) + +// DupeDetectionServerClient is the client API for DupeDetectionServer 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 DupeDetectionServerClient interface { + ImageRarenessScore(ctx context.Context, in *RarenessScoreRequest, opts ...grpc.CallOption) (*ImageRarenessScoreReply, error) + GetStatus(ctx context.Context, in *GetStatusRequest, opts ...grpc.CallOption) (*GetStatusResponse, error) +} + +type dupeDetectionServerClient struct { + cc grpc.ClientConnInterface +} + +func NewDupeDetectionServerClient(cc grpc.ClientConnInterface) DupeDetectionServerClient { + return &dupeDetectionServerClient{cc} +} + +func (c *dupeDetectionServerClient) ImageRarenessScore(ctx context.Context, in *RarenessScoreRequest, opts ...grpc.CallOption) (*ImageRarenessScoreReply, error) { + out := new(ImageRarenessScoreReply) + err := c.cc.Invoke(ctx, DupeDetectionServer_ImageRarenessScore_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dupeDetectionServerClient) GetStatus(ctx context.Context, in *GetStatusRequest, opts ...grpc.CallOption) (*GetStatusResponse, error) { + out := new(GetStatusResponse) + err := c.cc.Invoke(ctx, DupeDetectionServer_GetStatus_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DupeDetectionServerServer is the server API for DupeDetectionServer service. +// All implementations must embed UnimplementedDupeDetectionServerServer +// for forward compatibility +type DupeDetectionServerServer interface { + ImageRarenessScore(context.Context, *RarenessScoreRequest) (*ImageRarenessScoreReply, error) + GetStatus(context.Context, *GetStatusRequest) (*GetStatusResponse, error) + mustEmbedUnimplementedDupeDetectionServerServer() +} + +// UnimplementedDupeDetectionServerServer must be embedded to have forward compatible implementations. +type UnimplementedDupeDetectionServerServer struct { +} + +func (UnimplementedDupeDetectionServerServer) ImageRarenessScore(context.Context, *RarenessScoreRequest) (*ImageRarenessScoreReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ImageRarenessScore not implemented") +} +func (UnimplementedDupeDetectionServerServer) GetStatus(context.Context, *GetStatusRequest) (*GetStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetStatus not implemented") +} +func (UnimplementedDupeDetectionServerServer) mustEmbedUnimplementedDupeDetectionServerServer() {} + +// UnsafeDupeDetectionServerServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DupeDetectionServerServer will +// result in compilation errors. +type UnsafeDupeDetectionServerServer interface { + mustEmbedUnimplementedDupeDetectionServerServer() +} + +func RegisterDupeDetectionServerServer(s grpc.ServiceRegistrar, srv DupeDetectionServerServer) { + s.RegisterService(&DupeDetectionServer_ServiceDesc, srv) +} + +func _DupeDetectionServer_ImageRarenessScore_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RarenessScoreRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DupeDetectionServerServer).ImageRarenessScore(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DupeDetectionServer_ImageRarenessScore_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DupeDetectionServerServer).ImageRarenessScore(ctx, req.(*RarenessScoreRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DupeDetectionServer_GetStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DupeDetectionServerServer).GetStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DupeDetectionServer_GetStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DupeDetectionServerServer).GetStatus(ctx, req.(*GetStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// DupeDetectionServer_ServiceDesc is the grpc.ServiceDesc for DupeDetectionServer service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var DupeDetectionServer_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "dupedetection.DupeDetectionServer", + HandlerType: (*DupeDetectionServerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ImageRarenessScore", + Handler: _DupeDetectionServer_ImageRarenessScore_Handler, + }, + { + MethodName: "GetStatus", + Handler: _DupeDetectionServer_GetStatus_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "dd-server.proto", +} diff --git a/gen/raptorq/raptorq.pb.go b/gen/raptorq/raptorq.pb.go new file mode 100644 index 00000000..8c9ba9d0 --- /dev/null +++ b/gen/raptorq/raptorq.pb.go @@ -0,0 +1,476 @@ +// Copyright (c) 2021-2021 The Pastel Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.12.4 +// source: raptorq.proto + +package raptorq + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + 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 EncodeMetaDataRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + FilesNumber uint32 `protobuf:"varint,2,opt,name=files_number,json=filesNumber,proto3" json:"files_number,omitempty"` + BlockHash string `protobuf:"bytes,3,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + PastelId string `protobuf:"bytes,4,opt,name=pastel_id,json=pastelId,proto3" json:"pastel_id,omitempty"` +} + +func (x *EncodeMetaDataRequest) Reset() { + *x = EncodeMetaDataRequest{} + mi := &file_raptorq_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EncodeMetaDataRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EncodeMetaDataRequest) ProtoMessage() {} + +func (x *EncodeMetaDataRequest) ProtoReflect() protoreflect.Message { + mi := &file_raptorq_proto_msgTypes[0] + 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 EncodeMetaDataRequest.ProtoReflect.Descriptor instead. +func (*EncodeMetaDataRequest) Descriptor() ([]byte, []int) { + return file_raptorq_proto_rawDescGZIP(), []int{0} +} + +func (x *EncodeMetaDataRequest) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *EncodeMetaDataRequest) GetFilesNumber() uint32 { + if x != nil { + return x.FilesNumber + } + return 0 +} + +func (x *EncodeMetaDataRequest) GetBlockHash() string { + if x != nil { + return x.BlockHash + } + return "" +} + +func (x *EncodeMetaDataRequest) GetPastelId() string { + if x != nil { + return x.PastelId + } + return "" +} + +type EncodeMetaDataReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EncoderParameters []byte `protobuf:"bytes,1,opt,name=encoder_parameters,json=encoderParameters,proto3" json:"encoder_parameters,omitempty"` + SymbolsCount uint32 `protobuf:"varint,2,opt,name=symbols_count,json=symbolsCount,proto3" json:"symbols_count,omitempty"` + Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *EncodeMetaDataReply) Reset() { + *x = EncodeMetaDataReply{} + mi := &file_raptorq_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EncodeMetaDataReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EncodeMetaDataReply) ProtoMessage() {} + +func (x *EncodeMetaDataReply) ProtoReflect() protoreflect.Message { + mi := &file_raptorq_proto_msgTypes[1] + 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 EncodeMetaDataReply.ProtoReflect.Descriptor instead. +func (*EncodeMetaDataReply) Descriptor() ([]byte, []int) { + return file_raptorq_proto_rawDescGZIP(), []int{1} +} + +func (x *EncodeMetaDataReply) GetEncoderParameters() []byte { + if x != nil { + return x.EncoderParameters + } + return nil +} + +func (x *EncodeMetaDataReply) GetSymbolsCount() uint32 { + if x != nil { + return x.SymbolsCount + } + return 0 +} + +func (x *EncodeMetaDataReply) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +type EncodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *EncodeRequest) Reset() { + *x = EncodeRequest{} + mi := &file_raptorq_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EncodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EncodeRequest) ProtoMessage() {} + +func (x *EncodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_raptorq_proto_msgTypes[2] + 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 EncodeRequest.ProtoReflect.Descriptor instead. +func (*EncodeRequest) Descriptor() ([]byte, []int) { + return file_raptorq_proto_rawDescGZIP(), []int{2} +} + +func (x *EncodeRequest) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +type EncodeReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EncoderParameters []byte `protobuf:"bytes,1,opt,name=encoder_parameters,json=encoderParameters,proto3" json:"encoder_parameters,omitempty"` + SymbolsCount uint32 `protobuf:"varint,2,opt,name=symbols_count,json=symbolsCount,proto3" json:"symbols_count,omitempty"` + Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *EncodeReply) Reset() { + *x = EncodeReply{} + mi := &file_raptorq_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EncodeReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EncodeReply) ProtoMessage() {} + +func (x *EncodeReply) ProtoReflect() protoreflect.Message { + mi := &file_raptorq_proto_msgTypes[3] + 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 EncodeReply.ProtoReflect.Descriptor instead. +func (*EncodeReply) Descriptor() ([]byte, []int) { + return file_raptorq_proto_rawDescGZIP(), []int{3} +} + +func (x *EncodeReply) GetEncoderParameters() []byte { + if x != nil { + return x.EncoderParameters + } + return nil +} + +func (x *EncodeReply) GetSymbolsCount() uint32 { + if x != nil { + return x.SymbolsCount + } + return 0 +} + +func (x *EncodeReply) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +type DecodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EncoderParameters []byte `protobuf:"bytes,1,opt,name=encoder_parameters,json=encoderParameters,proto3" json:"encoder_parameters,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *DecodeRequest) Reset() { + *x = DecodeRequest{} + mi := &file_raptorq_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DecodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecodeRequest) ProtoMessage() {} + +func (x *DecodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_raptorq_proto_msgTypes[4] + 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 DecodeRequest.ProtoReflect.Descriptor instead. +func (*DecodeRequest) Descriptor() ([]byte, []int) { + return file_raptorq_proto_rawDescGZIP(), []int{4} +} + +func (x *DecodeRequest) GetEncoderParameters() []byte { + if x != nil { + return x.EncoderParameters + } + return nil +} + +func (x *DecodeRequest) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +type DecodeReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *DecodeReply) Reset() { + *x = DecodeReply{} + mi := &file_raptorq_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DecodeReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecodeReply) ProtoMessage() {} + +func (x *DecodeReply) ProtoReflect() protoreflect.Message { + mi := &file_raptorq_proto_msgTypes[5] + 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 DecodeReply.ProtoReflect.Descriptor instead. +func (*DecodeReply) Descriptor() ([]byte, []int) { + return file_raptorq_proto_rawDescGZIP(), []int{5} +} + +func (x *DecodeReply) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +var File_raptorq_proto protoreflect.FileDescriptor + +var file_raptorq_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x72, 0x61, 0x70, 0x74, 0x6f, 0x72, 0x71, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x07, 0x72, 0x61, 0x70, 0x74, 0x6f, 0x72, 0x71, 0x22, 0x8a, 0x01, 0x0a, 0x15, 0x45, 0x6e, 0x63, + 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x5f, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x66, 0x69, + 0x6c, 0x65, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x73, 0x74, + 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, + 0x74, 0x65, 0x6c, 0x49, 0x64, 0x22, 0x7d, 0x0a, 0x13, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x4d, + 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2d, 0x0a, 0x12, + 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, + 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x73, + 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x0c, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x22, 0x23, 0x0a, 0x0d, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x75, 0x0a, 0x0b, 0x45, 0x6e, 0x63, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2d, 0x0a, 0x12, 0x65, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x79, 0x6d, 0x62, 0x6f, + 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, + 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x22, 0x52, 0x0a, 0x0d, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x65, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, + 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x22, 0x21, 0x0a, 0x0b, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x32, 0xc9, 0x01, 0x0a, 0x07, 0x52, 0x61, 0x70, 0x74, + 0x6f, 0x72, 0x51, 0x12, 0x4e, 0x0a, 0x0e, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x74, + 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x2e, 0x72, 0x61, 0x70, 0x74, 0x6f, 0x72, 0x71, 0x2e, + 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x72, 0x61, 0x70, 0x74, 0x6f, 0x72, 0x71, 0x2e, + 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x12, 0x36, 0x0a, 0x06, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x2e, + 0x72, 0x61, 0x70, 0x74, 0x6f, 0x72, 0x71, 0x2e, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72, 0x61, 0x70, 0x74, 0x6f, 0x72, 0x71, 0x2e, + 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x36, 0x0a, 0x06, 0x44, + 0x65, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x2e, 0x72, 0x61, 0x70, 0x74, 0x6f, 0x72, 0x71, 0x2e, + 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, + 0x72, 0x61, 0x70, 0x74, 0x6f, 0x72, 0x71, 0x2e, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x4c, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x2f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x72, + 0x61, 0x70, 0x74, 0x6f, 0x72, 0x71, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_raptorq_proto_rawDescOnce sync.Once + file_raptorq_proto_rawDescData = file_raptorq_proto_rawDesc +) + +func file_raptorq_proto_rawDescGZIP() []byte { + file_raptorq_proto_rawDescOnce.Do(func() { + file_raptorq_proto_rawDescData = protoimpl.X.CompressGZIP(file_raptorq_proto_rawDescData) + }) + return file_raptorq_proto_rawDescData +} + +var file_raptorq_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_raptorq_proto_goTypes = []any{ + (*EncodeMetaDataRequest)(nil), // 0: raptorq.EncodeMetaDataRequest + (*EncodeMetaDataReply)(nil), // 1: raptorq.EncodeMetaDataReply + (*EncodeRequest)(nil), // 2: raptorq.EncodeRequest + (*EncodeReply)(nil), // 3: raptorq.EncodeReply + (*DecodeRequest)(nil), // 4: raptorq.DecodeRequest + (*DecodeReply)(nil), // 5: raptorq.DecodeReply +} +var file_raptorq_proto_depIdxs = []int32{ + 0, // 0: raptorq.RaptorQ.EncodeMetaData:input_type -> raptorq.EncodeMetaDataRequest + 2, // 1: raptorq.RaptorQ.Encode:input_type -> raptorq.EncodeRequest + 4, // 2: raptorq.RaptorQ.Decode:input_type -> raptorq.DecodeRequest + 1, // 3: raptorq.RaptorQ.EncodeMetaData:output_type -> raptorq.EncodeMetaDataReply + 3, // 4: raptorq.RaptorQ.Encode:output_type -> raptorq.EncodeReply + 5, // 5: raptorq.RaptorQ.Decode:output_type -> raptorq.DecodeReply + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_raptorq_proto_init() } +func file_raptorq_proto_init() { + if File_raptorq_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_raptorq_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_raptorq_proto_goTypes, + DependencyIndexes: file_raptorq_proto_depIdxs, + MessageInfos: file_raptorq_proto_msgTypes, + }.Build() + File_raptorq_proto = out.File + file_raptorq_proto_rawDesc = nil + file_raptorq_proto_goTypes = nil + file_raptorq_proto_depIdxs = nil +} diff --git a/gen/raptorq/raptorq_grpc.pb.go b/gen/raptorq/raptorq_grpc.pb.go new file mode 100644 index 00000000..01c17ae8 --- /dev/null +++ b/gen/raptorq/raptorq_grpc.pb.go @@ -0,0 +1,187 @@ +// Copyright (c) 2021-2021 The Pastel Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v3.12.4 +// source: raptorq.proto + +package raptorq + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// 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.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + RaptorQ_EncodeMetaData_FullMethodName = "/raptorq.RaptorQ/EncodeMetaData" + RaptorQ_Encode_FullMethodName = "/raptorq.RaptorQ/Encode" + RaptorQ_Decode_FullMethodName = "/raptorq.RaptorQ/Decode" +) + +// RaptorQClient is the client API for RaptorQ 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 RaptorQClient interface { + EncodeMetaData(ctx context.Context, in *EncodeMetaDataRequest, opts ...grpc.CallOption) (*EncodeMetaDataReply, error) + Encode(ctx context.Context, in *EncodeRequest, opts ...grpc.CallOption) (*EncodeReply, error) + Decode(ctx context.Context, in *DecodeRequest, opts ...grpc.CallOption) (*DecodeReply, error) +} + +type raptorQClient struct { + cc grpc.ClientConnInterface +} + +func NewRaptorQClient(cc grpc.ClientConnInterface) RaptorQClient { + return &raptorQClient{cc} +} + +func (c *raptorQClient) EncodeMetaData(ctx context.Context, in *EncodeMetaDataRequest, opts ...grpc.CallOption) (*EncodeMetaDataReply, error) { + out := new(EncodeMetaDataReply) + err := c.cc.Invoke(ctx, RaptorQ_EncodeMetaData_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *raptorQClient) Encode(ctx context.Context, in *EncodeRequest, opts ...grpc.CallOption) (*EncodeReply, error) { + out := new(EncodeReply) + err := c.cc.Invoke(ctx, RaptorQ_Encode_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *raptorQClient) Decode(ctx context.Context, in *DecodeRequest, opts ...grpc.CallOption) (*DecodeReply, error) { + out := new(DecodeReply) + err := c.cc.Invoke(ctx, RaptorQ_Decode_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RaptorQServer is the server API for RaptorQ service. +// All implementations must embed UnimplementedRaptorQServer +// for forward compatibility +type RaptorQServer interface { + EncodeMetaData(context.Context, *EncodeMetaDataRequest) (*EncodeMetaDataReply, error) + Encode(context.Context, *EncodeRequest) (*EncodeReply, error) + Decode(context.Context, *DecodeRequest) (*DecodeReply, error) + mustEmbedUnimplementedRaptorQServer() +} + +// UnimplementedRaptorQServer must be embedded to have forward compatible implementations. +type UnimplementedRaptorQServer struct { +} + +func (UnimplementedRaptorQServer) EncodeMetaData(context.Context, *EncodeMetaDataRequest) (*EncodeMetaDataReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method EncodeMetaData not implemented") +} +func (UnimplementedRaptorQServer) Encode(context.Context, *EncodeRequest) (*EncodeReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Encode not implemented") +} +func (UnimplementedRaptorQServer) Decode(context.Context, *DecodeRequest) (*DecodeReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Decode not implemented") +} +func (UnimplementedRaptorQServer) mustEmbedUnimplementedRaptorQServer() {} + +// UnsafeRaptorQServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RaptorQServer will +// result in compilation errors. +type UnsafeRaptorQServer interface { + mustEmbedUnimplementedRaptorQServer() +} + +func RegisterRaptorQServer(s grpc.ServiceRegistrar, srv RaptorQServer) { + s.RegisterService(&RaptorQ_ServiceDesc, srv) +} + +func _RaptorQ_EncodeMetaData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EncodeMetaDataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RaptorQServer).EncodeMetaData(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RaptorQ_EncodeMetaData_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RaptorQServer).EncodeMetaData(ctx, req.(*EncodeMetaDataRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RaptorQ_Encode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EncodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RaptorQServer).Encode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RaptorQ_Encode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RaptorQServer).Encode(ctx, req.(*EncodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RaptorQ_Decode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DecodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RaptorQServer).Decode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RaptorQ_Decode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RaptorQServer).Decode(ctx, req.(*DecodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// RaptorQ_ServiceDesc is the grpc.ServiceDesc for RaptorQ service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RaptorQ_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "raptorq.RaptorQ", + HandlerType: (*RaptorQServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "EncodeMetaData", + Handler: _RaptorQ_EncodeMetaData_Handler, + }, + { + MethodName: "Encode", + Handler: _RaptorQ_Encode_Handler, + }, + { + MethodName: "Decode", + Handler: _RaptorQ_Decode_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "raptorq.proto", +} diff --git a/go.mod b/go.mod index 3b733edd..f4047d77 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,7 @@ go 1.24.0 require ( cosmossdk.io/api v0.7.6 - github.com/LumeraProtocol/dd-service/gen v0.0.0-20250305185425-22977769a449 github.com/LumeraProtocol/lumera v0.4.2 - github.com/LumeraProtocol/rq-service/gen v0.0.0-20250305185258-cf252902b897 github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce github.com/cenkalti/backoff/v4 v4.3.0 github.com/cosmos/btcutil v1.0.5 diff --git a/go.sum b/go.sum index 1998b239..7b8e02be 100644 --- a/go.sum +++ b/go.sum @@ -61,12 +61,8 @@ github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3 github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/LumeraProtocol/dd-service/gen v0.0.0-20250305185425-22977769a449 h1:VwXwh/bNCNmj8OgIyM+LfqMCqqSGjRtQv983HiYCKcE= -github.com/LumeraProtocol/dd-service/gen v0.0.0-20250305185425-22977769a449/go.mod h1:/ieXOhfSDyTbcyB1GFmKr4t2b0YGYn0O8ikMNBMnOMA= github.com/LumeraProtocol/lumera v0.4.2 h1:yW7mwoYiBCcFLFNs9AgmaLc0DVkir95NGFtR2j/VYsw= github.com/LumeraProtocol/lumera v0.4.2/go.mod h1:MRqVY+f8edEBkDvpr4z2nJpglp3Qj1OUvjeWvrvIUSM= -github.com/LumeraProtocol/rq-service/gen v0.0.0-20250305185258-cf252902b897 h1:sxqhMpcQm8KjDFvhs6yg3Vyv9gt9uxBnfpZRewxAFos= -github.com/LumeraProtocol/rq-service/gen v0.0.0-20250305185258-cf252902b897/go.mod h1:+b6pn5XADYaATzzaKRZtCeIyYW2845v34gZ8NaPtPgI= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= diff --git a/pkg/dd/client.go b/pkg/dd/client.go index 0358b5d0..542d1a11 100644 --- a/pkg/dd/client.go +++ b/pkg/dd/client.go @@ -1,37 +1,46 @@ -//go:generate mockgen -destination=dd_mock.go -package=dd -source=client.go - package dd import ( "context" - "fmt" + "time" - ddService "github.com/LumeraProtocol/dd-service/gen" + "github.com/LumeraProtocol/supernode/pkg/errors" + "github.com/LumeraProtocol/supernode/pkg/log" + "github.com/LumeraProtocol/supernode/pkg/random" "google.golang.org/grpc" + "google.golang.org/grpc/encoding/gzip" ) -type Client struct { - conn *grpc.ClientConn - ddService ddService.DupeDetectionServerClient -} +const ( + defaultConnectTimeout = 60 * time.Second +) -type Service interface { - ImageRarenessScore(ctx context.Context, req RarenessScoreRequest) (ImageRarenessScoreResponse, error) - GetStatus(ctx context.Context, req GetStatusRequest) (GetStatusResponse, error) -} +type client struct{} -func NewClient(serverAddr string) (Service, error) { - conn, err := grpc.Dial(serverAddr, grpc.WithInsecure(), grpc.WithBlock()) +// Connect implements node.Client.Connect() +func (cl *client) Connect(ctx context.Context, address string) (Connection, error) { + // Limits the dial timeout, prevent got stuck too long + dialCtx, cancel := context.WithTimeout(ctx, defaultConnectTimeout) + defer cancel() + + id, _ := random.String(8, random.Base62Chars) + + grpcConn, err := grpc.DialContext(dialCtx, address, + //lint:ignore SA1019 we want to ignore this for now + grpc.WithInsecure(), + grpc.WithBlock(), + grpc.WithDefaultCallOptions(grpc.UseCompressor(gzip.Name), grpc.MaxCallRecvMsgSize(35000000)), + ) if err != nil { - return nil, fmt.Errorf("failed to connect to gRPC server: %w", err) + return nil, errors.Errorf("fail to dial: %w", err).WithField("address", address) } - return &Client{ - conn: conn, - ddService: ddService.NewDupeDetectionServerClient(conn), - }, nil -} + log.DD().WithContext(ctx).Debugf("Connected to %s with max recv size 35 MB", address) -func (c *Client) Close() { - c.conn.Close() + conn := newClientConn(id, grpcConn) + go func() { + //<-conn.Done() // FIXME: to be implemented by new gRPC package + log.DD().WithContext(ctx).Debugf("Disconnected %s", grpcConn.Target()) + }() + return conn, nil } diff --git a/pkg/dd/config.go b/pkg/dd/config.go new file mode 100644 index 00000000..c0ca0607 --- /dev/null +++ b/pkg/dd/config.go @@ -0,0 +1,50 @@ +package dd + +import ( + "fmt" + "path/filepath" +) + +const ( + errValidationStr = "ddserver client validation failed - missing val" +) + +// Config contains settings of the dd-server +type Config struct { + // Host the queries IPv4 or IPv6 address + Host string `mapstructure:"host" json:"host,omitempty"` + + // Port the queries port to listen for connections on + Port int `mapstructure:"port" json:"port,omitempty"` + + // DDFilesDir - the location of temporary folder to transfer image data to ddserver + DDFilesDir string `mapstructure:"dd-temp-file-dir" json:"dd-temp-file-dir,omitempty"` +} + +// NewConfig returns a new Config instance. +func NewConfig() *Config { + return &Config{} +} + +// SetWorkDir update working dir +func (config *Config) SetWorkDir(workDir string) { + if !filepath.IsAbs(config.DDFilesDir) { + config.DDFilesDir = filepath.Join(workDir, config.DDFilesDir) + } +} + +// Validate raptorq configs +func (config *Config) Validate() error { + if config.Host == "" { + return fmt.Errorf("%s: %s", errValidationStr, "host") + } + if config.Port == 0 { + return fmt.Errorf("%s: %s", errValidationStr, "port") + } + + if config.DDFilesDir == "" { + return fmt.Errorf("%s: %s", errValidationStr, "dd-temp-file-dir") + } + + return nil +} diff --git a/pkg/dd/connection.go b/pkg/dd/connection.go new file mode 100644 index 00000000..34f3b20e --- /dev/null +++ b/pkg/dd/connection.go @@ -0,0 +1,23 @@ +package dd + +import ( + "google.golang.org/grpc" +) + +// clientConn represents grpc client conneciton. +type clientConn struct { + *grpc.ClientConn + + id string +} + +func (conn *clientConn) DDService(config *Config) DDService { + return newDDServerClient(conn, config) +} + +func newClientConn(id string, conn *grpc.ClientConn) *clientConn { + return &clientConn{ + ClientConn: conn, + id: id, + } +} diff --git a/pkg/dd/dd_mock.go b/pkg/dd/dd_mock.go index feb255da..454443a0 100644 --- a/pkg/dd/dd_mock.go +++ b/pkg/dd/dd_mock.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: client.go +// Source: interfaces.go // Package dd is a generated GoMock package. package dd @@ -11,31 +11,120 @@ import ( gomock "github.com/golang/mock/gomock" ) -// MockService is a mock of Service interface. -type MockService struct { +// MockClientInterface is a mock of ClientInterface interface. +type MockClientInterface struct { ctrl *gomock.Controller - recorder *MockServiceMockRecorder + recorder *MockClientInterfaceMockRecorder } -// MockServiceMockRecorder is the mock recorder for MockService. -type MockServiceMockRecorder struct { - mock *MockService +// MockClientInterfaceMockRecorder is the mock recorder for MockClientInterface. +type MockClientInterfaceMockRecorder struct { + mock *MockClientInterface } -// NewMockService creates a new mock instance. -func NewMockService(ctrl *gomock.Controller) *MockService { - mock := &MockService{ctrl: ctrl} - mock.recorder = &MockServiceMockRecorder{mock} +// NewMockClientInterface creates a new mock instance. +func NewMockClientInterface(ctrl *gomock.Controller) *MockClientInterface { + mock := &MockClientInterface{ctrl: ctrl} + mock.recorder = &MockClientInterfaceMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockService) EXPECT() *MockServiceMockRecorder { +func (m *MockClientInterface) EXPECT() *MockClientInterfaceMockRecorder { + return m.recorder +} + +// Connect mocks base method. +func (m *MockClientInterface) Connect(ctx context.Context, address string) (Connection, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Connect", ctx, address) + ret0, _ := ret[0].(Connection) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Connect indicates an expected call of Connect. +func (mr *MockClientInterfaceMockRecorder) Connect(ctx, address interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Connect", reflect.TypeOf((*MockClientInterface)(nil).Connect), ctx, address) +} + +// MockConnection is a mock of Connection interface. +type MockConnection struct { + ctrl *gomock.Controller + recorder *MockConnectionMockRecorder +} + +// MockConnectionMockRecorder is the mock recorder for MockConnection. +type MockConnectionMockRecorder struct { + mock *MockConnection +} + +// NewMockConnection creates a new mock instance. +func NewMockConnection(ctrl *gomock.Controller) *MockConnection { + mock := &MockConnection{ctrl: ctrl} + mock.recorder = &MockConnectionMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockConnection) EXPECT() *MockConnectionMockRecorder { + return m.recorder +} + +// Close mocks base method. +func (m *MockConnection) Close() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Close") + ret0, _ := ret[0].(error) + return ret0 +} + +// Close indicates an expected call of Close. +func (mr *MockConnectionMockRecorder) Close() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockConnection)(nil).Close)) +} + +// DDService mocks base method. +func (m *MockConnection) DDService(config *Config) DDService { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DDService", config) + ret0, _ := ret[0].(DDService) + return ret0 +} + +// DDService indicates an expected call of DDService. +func (mr *MockConnectionMockRecorder) DDService(config interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DDService", reflect.TypeOf((*MockConnection)(nil).DDService), config) +} + +// MockDDService is a mock of DDService interface. +type MockDDService struct { + ctrl *gomock.Controller + recorder *MockDDServiceMockRecorder +} + +// MockDDServiceMockRecorder is the mock recorder for MockDDService. +type MockDDServiceMockRecorder struct { + mock *MockDDService +} + +// NewMockDDService creates a new mock instance. +func NewMockDDService(ctrl *gomock.Controller) *MockDDService { + mock := &MockDDService{ctrl: ctrl} + mock.recorder = &MockDDServiceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockDDService) EXPECT() *MockDDServiceMockRecorder { return m.recorder } // GetStatus mocks base method. -func (m *MockService) GetStatus(ctx context.Context, req GetStatusRequest) (GetStatusResponse, error) { +func (m *MockDDService) GetStatus(ctx context.Context, req GetStatusRequest) (GetStatusResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetStatus", ctx, req) ret0, _ := ret[0].(GetStatusResponse) @@ -44,13 +133,13 @@ func (m *MockService) GetStatus(ctx context.Context, req GetStatusRequest) (GetS } // GetStatus indicates an expected call of GetStatus. -func (mr *MockServiceMockRecorder) GetStatus(ctx, req interface{}) *gomock.Call { +func (mr *MockDDServiceMockRecorder) GetStatus(ctx, req interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStatus", reflect.TypeOf((*MockService)(nil).GetStatus), ctx, req) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStatus", reflect.TypeOf((*MockDDService)(nil).GetStatus), ctx, req) } // ImageRarenessScore mocks base method. -func (m *MockService) ImageRarenessScore(ctx context.Context, req RarenessScoreRequest) (ImageRarenessScoreResponse, error) { +func (m *MockDDService) ImageRarenessScore(ctx context.Context, req RarenessScoreRequest) (ImageRarenessScoreResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ImageRarenessScore", ctx, req) ret0, _ := ret[0].(ImageRarenessScoreResponse) @@ -59,7 +148,7 @@ func (m *MockService) ImageRarenessScore(ctx context.Context, req RarenessScoreR } // ImageRarenessScore indicates an expected call of ImageRarenessScore. -func (mr *MockServiceMockRecorder) ImageRarenessScore(ctx, req interface{}) *gomock.Call { +func (mr *MockDDServiceMockRecorder) ImageRarenessScore(ctx, req interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageRarenessScore", reflect.TypeOf((*MockService)(nil).ImageRarenessScore), ctx, req) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageRarenessScore", reflect.TypeOf((*MockDDService)(nil).ImageRarenessScore), ctx, req) } diff --git a/pkg/dd/dd_server_client.go b/pkg/dd/dd_server_client.go new file mode 100644 index 00000000..83098153 --- /dev/null +++ b/pkg/dd/dd_server_client.go @@ -0,0 +1,24 @@ +package dd + +import ( + dd "github.com/LumeraProtocol/supernode/gen/dupedetection" +) + +type ddServerClientImpl struct { + config *Config + conn *clientConn + ddService dd.DupeDetectionServerClient +} + +// NewDDServerClient returns a new dd-server-client instance. +func newDDServerClient(conn *clientConn, c *Config) DDService { + return &ddServerClientImpl{ + config: c, + conn: conn, + ddService: dd.NewDupeDetectionServerClient(conn), + } +} + +func (c *ddServerClientImpl) Close() { + c.conn.Close() +} diff --git a/pkg/dd/image_rareness.go b/pkg/dd/image_rareness.go index 43a9a716..3399f9a9 100644 --- a/pkg/dd/image_rareness.go +++ b/pkg/dd/image_rareness.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - ddService "github.com/LumeraProtocol/dd-service/gen" + ddService "github.com/LumeraProtocol/supernode/gen/dupedetection" "github.com/LumeraProtocol/supernode/pkg/logtrace" "github.com/LumeraProtocol/supernode/pkg/net" ) @@ -50,7 +50,7 @@ type ImageRarenessScoreResponse struct { } // ImageRarenessScore gets the image rareness score -func (c *Client) ImageRarenessScore(ctx context.Context, req RarenessScoreRequest) (ImageRarenessScoreResponse, error) { +func (c *ddServerClientImpl) ImageRarenessScore(ctx context.Context, req RarenessScoreRequest) (ImageRarenessScoreResponse, error) { ctx = net.AddCorrelationID(ctx) fields := logtrace.Fields{ logtrace.FieldMethod: "ImageRarenessScore", diff --git a/pkg/dd/interfaces.go b/pkg/dd/interfaces.go new file mode 100644 index 00000000..45b196d3 --- /dev/null +++ b/pkg/dd/interfaces.go @@ -0,0 +1,30 @@ +//go:generate mockgen -destination=dd_mock.go -package=dd -source=interfaces.go + +package dd + +import "context" + +// ClientInterface represents a base connection interface. +type ClientInterface interface { + // Connect connects to the server at the given address. + Connect(ctx context.Context, address string) (Connection, error) +} + +// Connection represents a client connection +type Connection interface { + // Close closes connection. + Close() error + + // DDService returns a new dd-service stream. + DDService(config *Config) DDService + + // FIXME: + // Done returns a channel that's closed when connection is shutdown. + //Done() <-chan struct{} +} + +// DDService contains methods for request services from dd-service. +type DDService interface { + ImageRarenessScore(ctx context.Context, req RarenessScoreRequest) (ImageRarenessScoreResponse, error) + GetStatus(ctx context.Context, req GetStatusRequest) (GetStatusResponse, error) +} diff --git a/pkg/dd/status.go b/pkg/dd/status.go index 610dac6e..1457bc20 100644 --- a/pkg/dd/status.go +++ b/pkg/dd/status.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - ddService "github.com/LumeraProtocol/dd-service/gen" + ddService "github.com/LumeraProtocol/supernode/gen/dupedetection" "github.com/LumeraProtocol/supernode/pkg/logtrace" "github.com/LumeraProtocol/supernode/pkg/net" ) @@ -19,7 +19,7 @@ type GetStatusResponse struct { } // GetStatus retrieves the status. -func (c *Client) GetStatus(ctx context.Context, req GetStatusRequest) (GetStatusResponse, error) { +func (c *ddServerClientImpl) GetStatus(ctx context.Context, req GetStatusRequest) (GetStatusResponse, error) { ctx = net.AddCorrelationID(ctx) fields := logtrace.Fields{ diff --git a/lumera/Readme.md b/pkg/lumera/Readme.md similarity index 100% rename from lumera/Readme.md rename to pkg/lumera/Readme.md diff --git a/lumera/client.go b/pkg/lumera/client.go similarity index 100% rename from lumera/client.go rename to pkg/lumera/client.go diff --git a/lumera/config.go b/pkg/lumera/config.go similarity index 100% rename from lumera/config.go rename to pkg/lumera/config.go diff --git a/lumera/connection.go b/pkg/lumera/connection.go similarity index 100% rename from lumera/connection.go rename to pkg/lumera/connection.go diff --git a/lumera/interface.go b/pkg/lumera/interface.go similarity index 100% rename from lumera/interface.go rename to pkg/lumera/interface.go diff --git a/lumera/modules/action/impl.go b/pkg/lumera/modules/action/impl.go similarity index 66% rename from lumera/modules/action/impl.go rename to pkg/lumera/modules/action/impl.go index 016dbd7d..507028d9 100644 --- a/lumera/modules/action/impl.go +++ b/pkg/lumera/modules/action/impl.go @@ -36,14 +36,14 @@ func (m *module) GetAction(ctx context.Context, actionID string) (*types.QueryGe return resp, nil } -// GetActionFee calculates fee for processing data with given size -func (m *module) GetActionFee(ctx context.Context, dataSize string) (*types.QueryGetActionFeeResponse, error) { - resp, err := m.client.GetActionFee(ctx, &types.QueryGetActionFeeRequest{ - DataSize: dataSize, - }) - if err != nil { - return nil, fmt.Errorf("failed to get action fee: %w", err) - } - - return resp, nil -} +//// GetActionFee calculates fee for processing data with given size +//func (m *module) GetActionFee(ctx context.Context, dataSize string) (*types.QueryGetActionFeeResponse, error) { +// resp, err := m.client.GetActionFee(ctx, &types.QueryGetActionFeeRequest{ +// DataSize: dataSize, +// }) +// if err != nil { +// return nil, fmt.Errorf("failed to get action fee: %w", err) +// } +// +// return resp, nil +//} diff --git a/lumera/modules/action/interface.go b/pkg/lumera/modules/action/interface.go similarity index 81% rename from lumera/modules/action/interface.go rename to pkg/lumera/modules/action/interface.go index 844d80c3..2aa2c7d7 100644 --- a/lumera/modules/action/interface.go +++ b/pkg/lumera/modules/action/interface.go @@ -10,7 +10,7 @@ import ( // Module defines the interface for interacting with the action module type Module interface { GetAction(ctx context.Context, actionID string) (*types.QueryGetActionResponse, error) - GetActionFee(ctx context.Context, dataSize string) (*types.QueryGetActionFeeResponse, error) + //GetActionFee(ctx context.Context, dataSize string) (*types.QueryGetActionFeeResponse, error) } // NewModule creates a new Action module client diff --git a/lumera/modules/node/impl.go b/pkg/lumera/modules/node/impl.go similarity index 100% rename from lumera/modules/node/impl.go rename to pkg/lumera/modules/node/impl.go diff --git a/lumera/modules/node/interface.go b/pkg/lumera/modules/node/interface.go similarity index 100% rename from lumera/modules/node/interface.go rename to pkg/lumera/modules/node/interface.go diff --git a/lumera/modules/supernode/impl.go.go b/pkg/lumera/modules/supernode/impl.go similarity index 100% rename from lumera/modules/supernode/impl.go.go rename to pkg/lumera/modules/supernode/impl.go diff --git a/lumera/modules/supernode/interface.go b/pkg/lumera/modules/supernode/interface.go similarity index 100% rename from lumera/modules/supernode/interface.go rename to pkg/lumera/modules/supernode/interface.go diff --git a/lumera/modules/tx/impl.go.go b/pkg/lumera/modules/tx/impl.go similarity index 100% rename from lumera/modules/tx/impl.go.go rename to pkg/lumera/modules/tx/impl.go diff --git a/lumera/modules/tx/interface.go b/pkg/lumera/modules/tx/interface.go similarity index 100% rename from lumera/modules/tx/interface.go rename to pkg/lumera/modules/tx/interface.go diff --git a/lumera/options.go b/pkg/lumera/options.go similarity index 100% rename from lumera/options.go rename to pkg/lumera/options.go diff --git a/pkg/net/grpc/client/client_mock.go b/pkg/net/grpc/client/client_mock.go index ec1c02f0..ccc51b35 100644 --- a/pkg/net/grpc/client/client_mock.go +++ b/pkg/net/grpc/client/client_mock.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: client.go +// Source: rq_server_client.go // Package client is a generated GoMock package. package client diff --git a/pkg/raptorq/client.go b/pkg/raptorq/client.go index ddd5cb07..ec1e4f5e 100644 --- a/pkg/raptorq/client.go +++ b/pkg/raptorq/client.go @@ -1,38 +1,46 @@ -//go:generate mockgen -destination=rq_mock.go -package=raptorq -source=client.go - package raptorq import ( "context" "fmt" - "google.golang.org/grpc" - rq "github.com/LumeraProtocol/rq-service/gen" + "github.com/LumeraProtocol/supernode/pkg/errors" + "github.com/LumeraProtocol/supernode/pkg/log" + "github.com/LumeraProtocol/supernode/pkg/random" + + "google.golang.org/grpc" ) -type Client struct { - conn *grpc.ClientConn - rqService rq.RaptorQClient -} +type client struct{} -type Service interface { - Encode(ctx context.Context, req EncodeRequest) (EncodeResponse, error) - Decode(ctx context.Context, req DecodeRequest) (DecodeResponse, error) - EncodeMetaData(ctx context.Context, req EncodeMetadataRequest) (EncodeResponse, error) -} +// Connect implements node.Client.Connect() +func (client *client) Connect(ctx context.Context, address string) (Connection, error) { + // Limits the dial timeout, prevent got stuck too long + dialCtx, cancel := context.WithTimeout(ctx, defaultConnectTimeout) + defer cancel() -func NewClient(serverAddr string) (Service, error) { - conn, err := grpc.Dial(serverAddr, grpc.WithInsecure(), grpc.WithBlock()) + id, _ := random.String(8, random.Base62Chars) + ctx = log.ContextWithPrefix(ctx, fmt.Sprintf("%s-%s", logPrefix, id)) + + grpcConn, err := grpc.DialContext(dialCtx, address, + //lint:ignore SA1019 we want to ignore this for now + grpc.WithInsecure(), + grpc.WithBlock(), + ) if err != nil { - return nil, fmt.Errorf("failed to connect to gRPC server: %w", err) + return nil, errors.Errorf("fail to dial: %w", err).WithField("address", address) } - - return &Client{ - conn: conn, - rqService: rq.NewRaptorQClient(conn), - }, nil + log.WithContext(ctx).Debugf("Connected to RQ %s", address) + + conn := newClientConn(id, grpcConn) + go func() { + //<-conn.Done() // FIXME: to be implemented by new gRPC package + log.WithContext(ctx).Debugf("Disconnected RQ %s", grpcConn.Target()) + }() + return conn, nil } -func (c *Client) Close() { - c.conn.Close() +// NewClient returns a new client instance. +func NewClient() ClientInterface { + return &client{} } diff --git a/pkg/raptorq/config.go b/pkg/raptorq/config.go new file mode 100644 index 00000000..92203643 --- /dev/null +++ b/pkg/raptorq/config.go @@ -0,0 +1,38 @@ +package raptorq + +import "fmt" + +const ( + errValidationStr = "raptorq validation failed - missing val" + defaultHost = "localhost" + defaultPort = 50051 +) + +// Config contains settings of the p2p service +type Config struct { + // the queries IPv4 or IPv6 address + Host string `mapstructure:"host" json:"host,omitempty"` + + // the queries port to listen for connections on + Port int `mapstructure:"port" json:"port,omitempty"` +} + +// NewConfig returns a new Config instance. +func NewConfig() *Config { + return &Config{ + Host: defaultHost, + Port: defaultPort, + } +} + +// Validate raptorq configs +func (config *Config) Validate() error { + if config.Host == "" { + return fmt.Errorf("%s: %s", errValidationStr, "host") + } + if config.Port == 0 { + return fmt.Errorf("%s: %s", errValidationStr, "port") + } + + return nil +} diff --git a/pkg/raptorq/connection.go b/pkg/raptorq/connection.go new file mode 100644 index 00000000..dabcdb1f --- /dev/null +++ b/pkg/raptorq/connection.go @@ -0,0 +1,23 @@ +package raptorq + +import ( + "google.golang.org/grpc" +) + +// clientConn represents grpc client conneciton. +type clientConn struct { + *grpc.ClientConn + + id string +} + +func (conn *clientConn) RaptorQ(config *Config) RaptorQ { + return newRaptorQServerClient(conn, config) +} + +func newClientConn(id string, conn *grpc.ClientConn) Connection { + return &clientConn{ + ClientConn: conn, + id: id, + } +} diff --git a/pkg/raptorq/decode.go b/pkg/raptorq/decode.go index 9202cdd0..041cef4a 100644 --- a/pkg/raptorq/decode.go +++ b/pkg/raptorq/decode.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - rq "github.com/LumeraProtocol/rq-service/gen" + rq "github.com/LumeraProtocol/supernode/gen/raptorq" "github.com/LumeraProtocol/supernode/pkg/logtrace" "github.com/LumeraProtocol/supernode/pkg/net" ) @@ -20,7 +20,7 @@ type DecodeResponse struct { } // Decode handles data decoding -func (c *Client) Decode(ctx context.Context, req DecodeRequest) (DecodeResponse, error) { +func (c *raptorQServerClient) Decode(ctx context.Context, req DecodeRequest) (DecodeResponse, error) { ctx = net.AddCorrelationID(ctx) fields := logtrace.Fields{ logtrace.FieldMethod: "Decode", diff --git a/pkg/raptorq/encode.go b/pkg/raptorq/encode.go index d2e3308f..a802c84c 100644 --- a/pkg/raptorq/encode.go +++ b/pkg/raptorq/encode.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - rq "github.com/LumeraProtocol/rq-service/gen" + rq "github.com/LumeraProtocol/supernode/gen/raptorq" "github.com/LumeraProtocol/supernode/pkg/logtrace" "github.com/LumeraProtocol/supernode/pkg/net" ) @@ -20,7 +20,7 @@ type EncodeResponse struct { } // Encode handles data encoding -func (c *Client) Encode(ctx context.Context, req EncodeRequest) (EncodeResponse, error) { +func (c *raptorQServerClient) Encode(ctx context.Context, req EncodeRequest) (EncodeResponse, error) { ctx = net.AddCorrelationID(ctx) fields := logtrace.Fields{ logtrace.FieldMethod: "Encode", diff --git a/pkg/raptorq/encode_metadata.go b/pkg/raptorq/encode_metadata.go index 2cb72bd9..40238d65 100644 --- a/pkg/raptorq/encode_metadata.go +++ b/pkg/raptorq/encode_metadata.go @@ -3,7 +3,7 @@ package raptorq import ( "context" - rq "github.com/LumeraProtocol/rq-service/gen" + rq "github.com/LumeraProtocol/supernode/gen/raptorq" "github.com/LumeraProtocol/supernode/pkg/logtrace" "github.com/LumeraProtocol/supernode/pkg/net" ) @@ -16,7 +16,7 @@ type EncodeMetadataRequest struct { } // EncodeMetaData handles encoding metadata -func (c *Client) EncodeMetaData(ctx context.Context, req EncodeMetadataRequest) (EncodeResponse, error) { +func (c *raptorQServerClient) EncodeMetaData(ctx context.Context, req EncodeMetadataRequest) (EncodeResponse, error) { ctx = net.AddCorrelationID(ctx) fields := logtrace.Fields{ logtrace.FieldMethod: "EncodeMetaData", diff --git a/pkg/raptorq/interfaces.go b/pkg/raptorq/interfaces.go new file mode 100644 index 00000000..4993d2e5 --- /dev/null +++ b/pkg/raptorq/interfaces.go @@ -0,0 +1,36 @@ +//go:generate mockgen -destination=rq_mock.go -package=raptorq -source=interface.go + +package raptorq + +import ( + "context" +) + +// ClientInterface represents a base connection interface. +type ClientInterface interface { + // Connect connects to the server at the given address. + Connect(ctx context.Context, address string) (Connection, error) +} + +// Connection represents a client connection +type Connection interface { + // Close closes connection. + Close() error + + // RaptorQ returns a new RaptorQ stream. + RaptorQ(config *Config) RaptorQ + + // FIXME: + // Done returns a channel that's closed when connection is shutdown. + //Done() <-chan struct{} +} + +// RaptorQ contains methods for request services from RaptorQ service. +type RaptorQ interface { + // Encode Get map of symbols + Encode(ctx context.Context, req EncodeRequest) (EncodeResponse, error) + // Decode returns a path to restored file. + Decode(ctx context.Context, req DecodeRequest) (DecodeResponse, error) + // EncodeMetaData Get encode info(include encode parameters + symbol id files) + EncodeMetaData(ctx context.Context, req EncodeMetadataRequest) (EncodeResponse, error) +} diff --git a/pkg/raptorq/raptorq.go b/pkg/raptorq/raptorq.go new file mode 100644 index 00000000..720d693d --- /dev/null +++ b/pkg/raptorq/raptorq.go @@ -0,0 +1,139 @@ +package raptorq + +import ( + "github.com/LumeraProtocol/supernode/pkg/errors" + "io/fs" + "io/ioutil" + "os" + "path/filepath" + + json "github.com/json-iterator/go" + + "github.com/google/uuid" + + pb "github.com/LumeraProtocol/supernode/gen/raptorq" +) + +const ( + inputEncodeFileName = "input.data" + symbolIDFileSubDir = "meta" + symbolFileSubdir = "symbols" + concurrency = 1 +) + +type RawSymbolIDFile struct { + ID string `json:"id"` + BlockHash string `json:"block_hash"` + PastelID string `json:"pastel_id"` + SymbolIdentifiers []string `json:"symbol_identifiers"` +} + +type raptorQ struct { + conn *clientConn + client pb.RaptorQClient + config Config + semaphore chan struct{} // Semaphore to control concurrency +} + +func randID() string { + id := uuid.NewString() + return id[0:8] +} + +func writeFile(path string, data []byte) error { + return ioutil.WriteFile(path, data, 0750) +} + +func readFile(path string) ([]byte, error) { + return ioutil.ReadFile(path) +} + +func createTaskFolder(base string, subDirs ...string) (string, error) { + taskID := randID() + taskPath := filepath.Join(base, taskID) + taskPath = filepath.Join(taskPath, filepath.Join(subDirs...)) + + err := os.MkdirAll(taskPath, 0750) + + if err != nil { + return "", err + } + + return taskPath, nil +} + +func createInputEncodeFile(base string, data []byte) (taskPath string, inputFile string, err error) { + taskPath, err = createTaskFolder(base) + + if err != nil { + return "", "", errors.Errorf("create task folder: %w", err) + } + + inputFile = filepath.Join(taskPath, inputEncodeFileName) + err = writeFile(inputFile, data) + + if err != nil { + return "", "", errors.Errorf("write file: %w", err) + } + + return taskPath, inputFile, nil +} + +func createInputDecodeSymbols(base string, symbols map[string][]byte) (path string, err error) { + path, err = createTaskFolder(base, symbolFileSubdir) + + if err != nil { + return "", errors.Errorf("create task folder: %w", err) + } + + for id, data := range symbols { + symbolFile := filepath.Join(path, id) + err = writeFile(symbolFile, data) + + if err != nil { + return "", errors.Errorf("write symbol file: %w", err) + } + } + + return path, nil +} + +// scan symbol id files in "meta" folder, return map of file Ids & contents of file (as list of line) +func scanSymbolIDFiles(dirPath string) (map[string]RawSymbolIDFile, error) { + filesMap := make(map[string]RawSymbolIDFile) + + err := filepath.Walk(dirPath, func(path string, info fs.FileInfo, err error) error { + if err != nil { + return errors.Errorf("scan a path %s: %w", path, err) + } + + if info.IsDir() { + // TODO - compare it to root + return nil + } + + fileID := filepath.Base(path) + + configFile, err := os.Open(path) + if err != nil { + return errors.Errorf("opening file: %s - err: %w", path, err) + } + defer configFile.Close() + + file := RawSymbolIDFile{} + jsonParser := json.NewDecoder(configFile) + if err = jsonParser.Decode(&file); err != nil { + return errors.Errorf("parsing file: %s - err: %w", path, err) + } + + filesMap[fileID] = file + + return nil + }) + + if err != nil { + return nil, err + } + + return filesMap, nil +} diff --git a/pkg/raptorq/rq_mock.go b/pkg/raptorq/rq_mock.go index 2c5ed7a3..a61faf0c 100644 --- a/pkg/raptorq/rq_mock.go +++ b/pkg/raptorq/rq_mock.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: client.go +// Source: interfaces.go // Package raptorq is a generated GoMock package. package raptorq @@ -11,31 +11,120 @@ import ( gomock "github.com/golang/mock/gomock" ) -// MockService is a mock of Service interface. -type MockService struct { +// MockClientInterface is a mock of ClientInterface interface. +type MockClientInterface struct { ctrl *gomock.Controller - recorder *MockServiceMockRecorder + recorder *MockClientInterfaceMockRecorder } -// MockServiceMockRecorder is the mock recorder for MockService. -type MockServiceMockRecorder struct { - mock *MockService +// MockClientInterfaceMockRecorder is the mock recorder for MockClientInterface. +type MockClientInterfaceMockRecorder struct { + mock *MockClientInterface } -// NewMockService creates a new mock instance. -func NewMockService(ctrl *gomock.Controller) *MockService { - mock := &MockService{ctrl: ctrl} - mock.recorder = &MockServiceMockRecorder{mock} +// NewMockClientInterface creates a new mock instance. +func NewMockClientInterface(ctrl *gomock.Controller) *MockClientInterface { + mock := &MockClientInterface{ctrl: ctrl} + mock.recorder = &MockClientInterfaceMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockService) EXPECT() *MockServiceMockRecorder { +func (m *MockClientInterface) EXPECT() *MockClientInterfaceMockRecorder { + return m.recorder +} + +// Connect mocks base method. +func (m *MockClientInterface) Connect(ctx context.Context, address string) (Connection, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Connect", ctx, address) + ret0, _ := ret[0].(Connection) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Connect indicates an expected call of Connect. +func (mr *MockClientInterfaceMockRecorder) Connect(ctx, address interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Connect", reflect.TypeOf((*MockClientInterface)(nil).Connect), ctx, address) +} + +// MockConnection is a mock of Connection interface. +type MockConnection struct { + ctrl *gomock.Controller + recorder *MockConnectionMockRecorder +} + +// MockConnectionMockRecorder is the mock recorder for MockConnection. +type MockConnectionMockRecorder struct { + mock *MockConnection +} + +// NewMockConnection creates a new mock instance. +func NewMockConnection(ctrl *gomock.Controller) *MockConnection { + mock := &MockConnection{ctrl: ctrl} + mock.recorder = &MockConnectionMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockConnection) EXPECT() *MockConnectionMockRecorder { + return m.recorder +} + +// Close mocks base method. +func (m *MockConnection) Close() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Close") + ret0, _ := ret[0].(error) + return ret0 +} + +// Close indicates an expected call of Close. +func (mr *MockConnectionMockRecorder) Close() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockConnection)(nil).Close)) +} + +// RaptorQ mocks base method. +func (m *MockConnection) RaptorQ(config *Config) RaptorQ { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RaptorQ", config) + ret0, _ := ret[0].(RaptorQ) + return ret0 +} + +// RaptorQ indicates an expected call of RaptorQ. +func (mr *MockConnectionMockRecorder) RaptorQ(config interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RaptorQ", reflect.TypeOf((*MockConnection)(nil).RaptorQ), config) +} + +// MockRaptorQ is a mock of RaptorQ interface. +type MockRaptorQ struct { + ctrl *gomock.Controller + recorder *MockRaptorQMockRecorder +} + +// MockRaptorQMockRecorder is the mock recorder for MockRaptorQ. +type MockRaptorQMockRecorder struct { + mock *MockRaptorQ +} + +// NewMockRaptorQ creates a new mock instance. +func NewMockRaptorQ(ctrl *gomock.Controller) *MockRaptorQ { + mock := &MockRaptorQ{ctrl: ctrl} + mock.recorder = &MockRaptorQMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRaptorQ) EXPECT() *MockRaptorQMockRecorder { return m.recorder } // Decode mocks base method. -func (m *MockService) Decode(ctx context.Context, req DecodeRequest) (DecodeResponse, error) { +func (m *MockRaptorQ) Decode(ctx context.Context, req DecodeRequest) (DecodeResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Decode", ctx, req) ret0, _ := ret[0].(DecodeResponse) @@ -44,13 +133,13 @@ func (m *MockService) Decode(ctx context.Context, req DecodeRequest) (DecodeResp } // Decode indicates an expected call of Decode. -func (mr *MockServiceMockRecorder) Decode(ctx, req interface{}) *gomock.Call { +func (mr *MockRaptorQMockRecorder) Decode(ctx, req interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Decode", reflect.TypeOf((*MockService)(nil).Decode), ctx, req) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Decode", reflect.TypeOf((*MockRaptorQ)(nil).Decode), ctx, req) } // Encode mocks base method. -func (m *MockService) Encode(ctx context.Context, req EncodeRequest) (EncodeResponse, error) { +func (m *MockRaptorQ) Encode(ctx context.Context, req EncodeRequest) (EncodeResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Encode", ctx, req) ret0, _ := ret[0].(EncodeResponse) @@ -59,13 +148,13 @@ func (m *MockService) Encode(ctx context.Context, req EncodeRequest) (EncodeResp } // Encode indicates an expected call of Encode. -func (mr *MockServiceMockRecorder) Encode(ctx, req interface{}) *gomock.Call { +func (mr *MockRaptorQMockRecorder) Encode(ctx, req interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Encode", reflect.TypeOf((*MockService)(nil).Encode), ctx, req) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Encode", reflect.TypeOf((*MockRaptorQ)(nil).Encode), ctx, req) } // EncodeMetaData mocks base method. -func (m *MockService) EncodeMetaData(ctx context.Context, req EncodeMetadataRequest) (EncodeResponse, error) { +func (m *MockRaptorQ) EncodeMetaData(ctx context.Context, req EncodeMetadataRequest) (EncodeResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "EncodeMetaData", ctx, req) ret0, _ := ret[0].(EncodeResponse) @@ -74,7 +163,7 @@ func (m *MockService) EncodeMetaData(ctx context.Context, req EncodeMetadataRequ } // EncodeMetaData indicates an expected call of EncodeMetaData. -func (mr *MockServiceMockRecorder) EncodeMetaData(ctx, req interface{}) *gomock.Call { +func (mr *MockRaptorQMockRecorder) EncodeMetaData(ctx, req interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EncodeMetaData", reflect.TypeOf((*MockService)(nil).EncodeMetaData), ctx, req) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EncodeMetaData", reflect.TypeOf((*MockRaptorQ)(nil).EncodeMetaData), ctx, req) } diff --git a/pkg/raptorq/rq_server_client.go b/pkg/raptorq/rq_server_client.go new file mode 100644 index 00000000..1d0341ab --- /dev/null +++ b/pkg/raptorq/rq_server_client.go @@ -0,0 +1,32 @@ +package raptorq + +import ( + "time" + + rq "github.com/LumeraProtocol/supernode/gen/raptorq" +) + +const ( + logPrefix = "grpc-raptorqClient" + defaultConnectTimeout = 120 * time.Second +) + +type raptorQServerClient struct { + config *Config + conn *clientConn + rqService rq.RaptorQClient + semaphore chan struct{} // Semaphore to control concurrency +} + +func newRaptorQServerClient(conn *clientConn, config *Config) RaptorQ { + return &raptorQServerClient{ + conn: conn, + rqService: rq.NewRaptorQClient(conn), + config: config, + semaphore: make(chan struct{}, concurrency), + } +} + +func (c *raptorQServerClient) Close() { + c.conn.Close() +} diff --git a/proto/dupedetection/dd-server.proto b/proto/dupedetection/dd-server.proto new file mode 100644 index 00000000..fad25919 --- /dev/null +++ b/proto/dupedetection/dd-server.proto @@ -0,0 +1,108 @@ +// Copyright (c) 2021-2021 The Pastel Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +syntax = "proto3"; + +option go_package = "github.com/LumeraProtocol/supernode/gen/dupedetection"; + +package dupedetection; + +service DupeDetectionServer { + rpc ImageRarenessScore(RarenessScoreRequest) returns(ImageRarenessScoreReply); + rpc GetStatus(GetStatusRequest) returns(GetStatusResponse); +} + +message RarenessScoreRequest { + string image_filepath = 1; + string pastel_block_hash_when_request_submitted = 2; + string pastel_block_height_when_request_submitted = 3; + string utc_timestamp_when_request_submitted = 4; + string pastel_id_of_submitter = 5; + string pastel_id_of_registering_supernode_1 = 6; + string pastel_id_of_registering_supernode_2 = 7; + string pastel_id_of_registering_supernode_3 = 8; + bool is_pastel_openapi_request = 9; + string open_api_group_id_string = 10; + string collection_name_string = 11; +} + +message ImageRarenessScoreReply { + string pastel_block_hash_when_request_submitted = 1; + string pastel_block_height_when_request_submitted = 2; + string utc_timestamp_when_request_submitted = 3; + string pastel_id_of_submitter = 4; + string pastel_id_of_registering_supernode_1 = 5; + string pastel_id_of_registering_supernode_2 = 6; + string pastel_id_of_registering_supernode_3 = 7; + bool is_pastel_openapi_request = 8; + string image_file_path = 9; + string dupe_detection_system_version = 10; + bool is_likely_dupe = 11; + bool is_rare_on_internet = 12; + float overall_rareness_score = 13; + float pct_of_top_10_most_similar_with_dupe_prob_above_25pct = 14; + float pct_of_top_10_most_similar_with_dupe_prob_above_33pct = 15; + float pct_of_top_10_most_similar_with_dupe_prob_above_50pct = 16; + string rareness_scores_table_json_compressed_b64 = 17; + InternetRareness internet_rareness = 18; + float open_nsfw_score = 19; + AltNsfwScores alternative_nsfw_scores = 20; + repeated double image_fingerprint_of_candidate_image_file = 21; + string collection_name_string = 22; + string hash_of_candidate_image_file = 23; + string open_api_group_id_string = 24; + float group_rareness_score = 25; + string candidate_image_thumbnail_webp_as_base64_string = 26; + string does_not_impact_the_following_collection_strings = 27; + bool is_invalid_sense_request = 28; + string invalid_sense_request_reason = 29; + float similarity_score_to_first_entry_in_collection = 30; + float cp_probability = 31; + float child_probability = 32; + string image_fingerprint_set_checksum = 33; +} + + +message InternetRareness { + string rare_on_internet_summary_table_as_json_compressed_b64 = 1; + string rare_on_internet_graph_json_compressed_b64 = 2; + string alternative_rare_on_internet_dict_as_json_compressed_b64 = 3; + uint32 min_number_of_exact_matches_in_page = 4; + string earliest_available_date_of_internet_results = 5; +} + +message AltNsfwScores { + float drawings = 1; + float hentai = 2; + float neutral = 3; + float porn = 4; + float sexy = 5; +} + +message GetStatusRequest {} + +message TaskCount { + int32 max_concurrent = 1; + int32 executing = 2; + int32 waiting_in_queue = 3; + int32 succeeded = 4; + int32 failed = 5; + int32 cancelled = 6; +} + +message TaskMetrics { + float average_task_wait_time_secs = 1; + float max_task_wait_time_secs = 2; + float average_task_execution_time_secs = 3; + int64 average_task_virtual_memory_usage_bytes = 4; + int64 average_task_rss_memory_usage_bytes = 5; + int64 peak_task_rss_memory_usage_bytes = 6; + int64 peak_task_vms_memory_usage_bytes = 7; +} + +message GetStatusResponse { + string version = 1; + TaskCount task_count = 2; + TaskMetrics task_metrics = 3; +} diff --git a/proto/raptorq/raptorq.proto b/proto/raptorq/raptorq.proto new file mode 100644 index 00000000..6ca45e5a --- /dev/null +++ b/proto/raptorq/raptorq.proto @@ -0,0 +1,46 @@ +// Copyright (c) 2021-2021 The Pastel Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. +syntax = "proto3"; + +option go_package = "github.com/LumeraProtocol/supernode/gen/raptorq"; + +package raptorq; + +service RaptorQ { + rpc EncodeMetaData(EncodeMetaDataRequest) returns(EncodeMetaDataReply); + rpc Encode(EncodeRequest) returns(EncodeReply); + rpc Decode(DecodeRequest) returns(DecodeReply); +} + +message EncodeMetaDataRequest { + string path = 1; + uint32 files_number = 2; + string block_hash = 3; + string pastel_id = 4; +} + +message EncodeMetaDataReply { + bytes encoder_parameters = 1; + uint32 symbols_count = 2; + string path = 3; +} + +message EncodeRequest { + string path = 1; +} + +message EncodeReply { + bytes encoder_parameters = 1; + uint32 symbols_count = 2; + string path = 3; +} + +message DecodeRequest { + bytes encoder_parameters = 1; + string path = 2; +} + +message DecodeReply { + string path = 1; +} \ No newline at end of file