fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

sourcegraph-indexserver: add GRPC methods for Index and Delete (#933)

Closes SPLF-913

This only affects Sourcegraph.

This adds Index and Delete methods to
sourcegraph-indexserver's GRPC server.

The methods aren't called yet by Sourcegraph.

Notable differences to our current indexing loop:
- IndexOptions are pushed by the client instead of pulled by Zoekt
- A semaphore restricts concurrency
- New ENV `SRC_STOP_INDEXING` stops the "competing" indexing loop. This is just for
testing and will eventually be removed
- The Index method tries to recover a possibly older index from
`indexDir/.trash` first before starting to index

Review:
I recommend reviewing the `.proto` file first, followed by `main.go`

Test plan:
- I did a bunch of manual testing to test the trash recovery and the
semaphore logic. I successfuly triggered index and delete calls to the
GRPC server. I will put the Insomnia collection I used for testing in the ticket.
- New unit tests

+1217 -363
+1 -1
cmd/zoekt-sourcegraph-indexserver/debug.go
··· 33 33 if err != nil { 34 34 return err 35 35 } 36 - msg, err := s.forceIndex(uint32(id)) 36 + msg, err := s.forceIndex(ctx, uint32(id)) 37 37 infoLog.Println(msg) 38 38 if err != nil { 39 39 return err
-11
cmd/zoekt-sourcegraph-indexserver/grpc/protos/sourcegraph/zoekt/configuration/v1/buf.gen.yaml
··· 1 - # Configuration file for https://buf.build/, which we use for Protobuf code generation. 2 - version: v1 3 - plugins: 4 - - plugin: buf.build/protocolbuffers/go:v1.28.1 5 - out: . 6 - opt: 7 - - paths=source_relative 8 - - plugin: buf.build/grpc/go:v1.3.0 9 - out: . 10 - opt: 11 - - paths=source_relative
+222 -220
cmd/zoekt-sourcegraph-indexserver/grpc/protos/sourcegraph/zoekt/configuration/v1/configuration.pb.go
··· 2 2 // versions: 3 3 // protoc-gen-go v1.28.1 4 4 // protoc (unknown) 5 - // source: configuration.proto 5 + // source: sourcegraph/zoekt/configuration/v1/configuration.proto 6 6 7 7 package v1 8 8 ··· 57 57 } 58 58 59 59 func (CTagsParserType) Descriptor() protoreflect.EnumDescriptor { 60 - return file_configuration_proto_enumTypes[0].Descriptor() 60 + return file_sourcegraph_zoekt_configuration_v1_configuration_proto_enumTypes[0].Descriptor() 61 61 } 62 62 63 63 func (CTagsParserType) Type() protoreflect.EnumType { 64 - return &file_configuration_proto_enumTypes[0] 64 + return &file_sourcegraph_zoekt_configuration_v1_configuration_proto_enumTypes[0] 65 65 } 66 66 67 67 func (x CTagsParserType) Number() protoreflect.EnumNumber { ··· 70 70 71 71 // Deprecated: Use CTagsParserType.Descriptor instead. 72 72 func (CTagsParserType) EnumDescriptor() ([]byte, []int) { 73 - return file_configuration_proto_rawDescGZIP(), []int{0} 73 + return file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescGZIP(), []int{0} 74 74 } 75 75 76 76 // SearchConfigurationRequest is the request to the SearchConfiguration RPC. ··· 91 91 func (x *SearchConfigurationRequest) Reset() { 92 92 *x = SearchConfigurationRequest{} 93 93 if protoimpl.UnsafeEnabled { 94 - mi := &file_configuration_proto_msgTypes[0] 94 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[0] 95 95 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 96 96 ms.StoreMessageInfo(mi) 97 97 } ··· 104 104 func (*SearchConfigurationRequest) ProtoMessage() {} 105 105 106 106 func (x *SearchConfigurationRequest) ProtoReflect() protoreflect.Message { 107 - mi := &file_configuration_proto_msgTypes[0] 107 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[0] 108 108 if protoimpl.UnsafeEnabled && x != nil { 109 109 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 110 110 if ms.LoadMessageInfo() == nil { ··· 117 117 118 118 // Deprecated: Use SearchConfigurationRequest.ProtoReflect.Descriptor instead. 119 119 func (*SearchConfigurationRequest) Descriptor() ([]byte, []int) { 120 - return file_configuration_proto_rawDescGZIP(), []int{0} 120 + return file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescGZIP(), []int{0} 121 121 } 122 122 123 123 func (x *SearchConfigurationRequest) GetFingerprint() *Fingerprint { ··· 152 152 func (x *SearchConfigurationResponse) Reset() { 153 153 *x = SearchConfigurationResponse{} 154 154 if protoimpl.UnsafeEnabled { 155 - mi := &file_configuration_proto_msgTypes[1] 155 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[1] 156 156 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 157 157 ms.StoreMessageInfo(mi) 158 158 } ··· 165 165 func (*SearchConfigurationResponse) ProtoMessage() {} 166 166 167 167 func (x *SearchConfigurationResponse) ProtoReflect() protoreflect.Message { 168 - mi := &file_configuration_proto_msgTypes[1] 168 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[1] 169 169 if protoimpl.UnsafeEnabled && x != nil { 170 170 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 171 171 if ms.LoadMessageInfo() == nil { ··· 178 178 179 179 // Deprecated: Use SearchConfigurationResponse.ProtoReflect.Descriptor instead. 180 180 func (*SearchConfigurationResponse) Descriptor() ([]byte, []int) { 181 - return file_configuration_proto_rawDescGZIP(), []int{1} 181 + return file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescGZIP(), []int{1} 182 182 } 183 183 184 184 func (x *SearchConfigurationResponse) GetFingerprint() *Fingerprint { ··· 212 212 func (x *Fingerprint) Reset() { 213 213 *x = Fingerprint{} 214 214 if protoimpl.UnsafeEnabled { 215 - mi := &file_configuration_proto_msgTypes[2] 215 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[2] 216 216 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 217 217 ms.StoreMessageInfo(mi) 218 218 } ··· 225 225 func (*Fingerprint) ProtoMessage() {} 226 226 227 227 func (x *Fingerprint) ProtoReflect() protoreflect.Message { 228 - mi := &file_configuration_proto_msgTypes[2] 228 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[2] 229 229 if protoimpl.UnsafeEnabled && x != nil { 230 230 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 231 231 if ms.LoadMessageInfo() == nil { ··· 238 238 239 239 // Deprecated: Use Fingerprint.ProtoReflect.Descriptor instead. 240 240 func (*Fingerprint) Descriptor() ([]byte, []int) { 241 - return file_configuration_proto_rawDescGZIP(), []int{2} 241 + return file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescGZIP(), []int{2} 242 242 } 243 243 244 244 func (x *Fingerprint) GetGeneratedAt() *timestamppb.Timestamp { ··· 267 267 func (x *LanguageMapping) Reset() { 268 268 *x = LanguageMapping{} 269 269 if protoimpl.UnsafeEnabled { 270 - mi := &file_configuration_proto_msgTypes[3] 270 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[3] 271 271 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 272 272 ms.StoreMessageInfo(mi) 273 273 } ··· 280 280 func (*LanguageMapping) ProtoMessage() {} 281 281 282 282 func (x *LanguageMapping) ProtoReflect() protoreflect.Message { 283 - mi := &file_configuration_proto_msgTypes[3] 283 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[3] 284 284 if protoimpl.UnsafeEnabled && x != nil { 285 285 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 286 286 if ms.LoadMessageInfo() == nil { ··· 293 293 294 294 // Deprecated: Use LanguageMapping.ProtoReflect.Descriptor instead. 295 295 func (*LanguageMapping) Descriptor() ([]byte, []int) { 296 - return file_configuration_proto_rawDescGZIP(), []int{3} 296 + return file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescGZIP(), []int{3} 297 297 } 298 298 299 299 func (x *LanguageMapping) GetLanguage() string { ··· 358 358 func (x *ZoektIndexOptions) Reset() { 359 359 *x = ZoektIndexOptions{} 360 360 if protoimpl.UnsafeEnabled { 361 - mi := &file_configuration_proto_msgTypes[4] 361 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[4] 362 362 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 363 363 ms.StoreMessageInfo(mi) 364 364 } ··· 371 371 func (*ZoektIndexOptions) ProtoMessage() {} 372 372 373 373 func (x *ZoektIndexOptions) ProtoReflect() protoreflect.Message { 374 - mi := &file_configuration_proto_msgTypes[4] 374 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[4] 375 375 if protoimpl.UnsafeEnabled && x != nil { 376 376 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 377 377 if ms.LoadMessageInfo() == nil { ··· 384 384 385 385 // Deprecated: Use ZoektIndexOptions.ProtoReflect.Descriptor instead. 386 386 func (*ZoektIndexOptions) Descriptor() ([]byte, []int) { 387 - return file_configuration_proto_rawDescGZIP(), []int{4} 387 + return file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescGZIP(), []int{4} 388 388 } 389 389 390 390 func (x *ZoektIndexOptions) GetName() string { ··· 500 500 func (x *ZoektRepositoryBranch) Reset() { 501 501 *x = ZoektRepositoryBranch{} 502 502 if protoimpl.UnsafeEnabled { 503 - mi := &file_configuration_proto_msgTypes[5] 503 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[5] 504 504 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 505 505 ms.StoreMessageInfo(mi) 506 506 } ··· 513 513 func (*ZoektRepositoryBranch) ProtoMessage() {} 514 514 515 515 func (x *ZoektRepositoryBranch) ProtoReflect() protoreflect.Message { 516 - mi := &file_configuration_proto_msgTypes[5] 516 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[5] 517 517 if protoimpl.UnsafeEnabled && x != nil { 518 518 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 519 519 if ms.LoadMessageInfo() == nil { ··· 526 526 527 527 // Deprecated: Use ZoektRepositoryBranch.ProtoReflect.Descriptor instead. 528 528 func (*ZoektRepositoryBranch) Descriptor() ([]byte, []int) { 529 - return file_configuration_proto_rawDescGZIP(), []int{5} 529 + return file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescGZIP(), []int{5} 530 530 } 531 531 532 532 func (x *ZoektRepositoryBranch) GetName() string { ··· 558 558 func (x *ListRequest) Reset() { 559 559 *x = ListRequest{} 560 560 if protoimpl.UnsafeEnabled { 561 - mi := &file_configuration_proto_msgTypes[6] 561 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[6] 562 562 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 563 563 ms.StoreMessageInfo(mi) 564 564 } ··· 571 571 func (*ListRequest) ProtoMessage() {} 572 572 573 573 func (x *ListRequest) ProtoReflect() protoreflect.Message { 574 - mi := &file_configuration_proto_msgTypes[6] 574 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[6] 575 575 if protoimpl.UnsafeEnabled && x != nil { 576 576 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 577 577 if ms.LoadMessageInfo() == nil { ··· 584 584 585 585 // Deprecated: Use ListRequest.ProtoReflect.Descriptor instead. 586 586 func (*ListRequest) Descriptor() ([]byte, []int) { 587 - return file_configuration_proto_rawDescGZIP(), []int{6} 587 + return file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescGZIP(), []int{6} 588 588 } 589 589 590 590 func (x *ListRequest) GetHostname() string { ··· 614 614 func (x *ListResponse) Reset() { 615 615 *x = ListResponse{} 616 616 if protoimpl.UnsafeEnabled { 617 - mi := &file_configuration_proto_msgTypes[7] 617 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[7] 618 618 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 619 619 ms.StoreMessageInfo(mi) 620 620 } ··· 627 627 func (*ListResponse) ProtoMessage() {} 628 628 629 629 func (x *ListResponse) ProtoReflect() protoreflect.Message { 630 - mi := &file_configuration_proto_msgTypes[7] 630 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[7] 631 631 if protoimpl.UnsafeEnabled && x != nil { 632 632 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 633 633 if ms.LoadMessageInfo() == nil { ··· 640 640 641 641 // Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. 642 642 func (*ListResponse) Descriptor() ([]byte, []int) { 643 - return file_configuration_proto_rawDescGZIP(), []int{7} 643 + return file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescGZIP(), []int{7} 644 644 } 645 645 646 646 func (x *ListResponse) GetRepoIds() []int32 { ··· 662 662 func (x *UpdateIndexStatusRequest) Reset() { 663 663 *x = UpdateIndexStatusRequest{} 664 664 if protoimpl.UnsafeEnabled { 665 - mi := &file_configuration_proto_msgTypes[8] 665 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[8] 666 666 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 667 667 ms.StoreMessageInfo(mi) 668 668 } ··· 675 675 func (*UpdateIndexStatusRequest) ProtoMessage() {} 676 676 677 677 func (x *UpdateIndexStatusRequest) ProtoReflect() protoreflect.Message { 678 - mi := &file_configuration_proto_msgTypes[8] 678 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[8] 679 679 if protoimpl.UnsafeEnabled && x != nil { 680 680 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 681 681 if ms.LoadMessageInfo() == nil { ··· 688 688 689 689 // Deprecated: Use UpdateIndexStatusRequest.ProtoReflect.Descriptor instead. 690 690 func (*UpdateIndexStatusRequest) Descriptor() ([]byte, []int) { 691 - return file_configuration_proto_rawDescGZIP(), []int{8} 691 + return file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescGZIP(), []int{8} 692 692 } 693 693 694 694 func (x *UpdateIndexStatusRequest) GetRepositories() []*UpdateIndexStatusRequest_Repository { ··· 708 708 func (x *UpdateIndexStatusResponse) Reset() { 709 709 *x = UpdateIndexStatusResponse{} 710 710 if protoimpl.UnsafeEnabled { 711 - mi := &file_configuration_proto_msgTypes[9] 711 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[9] 712 712 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 713 713 ms.StoreMessageInfo(mi) 714 714 } ··· 721 721 func (*UpdateIndexStatusResponse) ProtoMessage() {} 722 722 723 723 func (x *UpdateIndexStatusResponse) ProtoReflect() protoreflect.Message { 724 - mi := &file_configuration_proto_msgTypes[9] 724 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[9] 725 725 if protoimpl.UnsafeEnabled && x != nil { 726 726 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 727 727 if ms.LoadMessageInfo() == nil { ··· 734 734 735 735 // Deprecated: Use UpdateIndexStatusResponse.ProtoReflect.Descriptor instead. 736 736 func (*UpdateIndexStatusResponse) Descriptor() ([]byte, []int) { 737 - return file_configuration_proto_rawDescGZIP(), []int{9} 737 + return file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescGZIP(), []int{9} 738 738 } 739 739 740 740 type UpdateIndexStatusRequest_Repository struct { ··· 753 753 func (x *UpdateIndexStatusRequest_Repository) Reset() { 754 754 *x = UpdateIndexStatusRequest_Repository{} 755 755 if protoimpl.UnsafeEnabled { 756 - mi := &file_configuration_proto_msgTypes[10] 756 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[10] 757 757 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 758 758 ms.StoreMessageInfo(mi) 759 759 } ··· 766 766 func (*UpdateIndexStatusRequest_Repository) ProtoMessage() {} 767 767 768 768 func (x *UpdateIndexStatusRequest_Repository) ProtoReflect() protoreflect.Message { 769 - mi := &file_configuration_proto_msgTypes[10] 769 + mi := &file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[10] 770 770 if protoimpl.UnsafeEnabled && x != nil { 771 771 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 772 772 if ms.LoadMessageInfo() == nil { ··· 779 779 780 780 // Deprecated: Use UpdateIndexStatusRequest_Repository.ProtoReflect.Descriptor instead. 781 781 func (*UpdateIndexStatusRequest_Repository) Descriptor() ([]byte, []int) { 782 - return file_configuration_proto_rawDescGZIP(), []int{8, 0} 782 + return file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescGZIP(), []int{8, 0} 783 783 } 784 784 785 785 func (x *UpdateIndexStatusRequest_Repository) GetRepoId() uint32 { ··· 803 803 return 0 804 804 } 805 805 806 - var File_configuration_proto protoreflect.FileDescriptor 806 + var File_sourcegraph_zoekt_configuration_v1_configuration_proto protoreflect.FileDescriptor 807 807 808 - var file_configuration_proto_rawDesc = []byte{ 809 - 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 810 - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x22, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 811 - 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 812 - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 813 - 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 814 - 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8a, 0x01, 0x0a, 0x1a, 0x53, 808 + var file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDesc = []byte{ 809 + 0x0a, 0x36, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2f, 0x7a, 0x6f, 810 + 0x65, 0x6b, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 811 + 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 812 + 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x22, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 813 + 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 814 + 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 815 + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 816 + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8a, 0x01, 817 + 0x0a, 0x1a, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 818 + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x51, 0x0a, 0x0b, 819 + 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 820 + 0x0b, 0x32, 0x2f, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 821 + 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 822 + 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 823 + 0x6e, 0x74, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x12, 824 + 0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 825 + 0x05, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x49, 0x64, 0x73, 0x22, 0xd0, 0x01, 0x0a, 0x1b, 0x53, 815 826 0x65, 0x61, 0x72, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 816 - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x51, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 817 - 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 818 - 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 819 - 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 820 - 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x52, 821 - 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 822 - 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 823 - 0x72, 0x65, 0x70, 0x6f, 0x49, 0x64, 0x73, 0x22, 0xd0, 0x01, 0x0a, 0x1b, 0x53, 0x65, 0x61, 0x72, 824 - 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 825 - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 826 - 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x73, 827 - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 828 - 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 829 - 0x31, 0x2e, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x66, 830 - 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x5e, 0x0a, 0x0f, 0x75, 0x70, 831 - 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 832 - 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 833 - 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 834 - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x5a, 0x6f, 0x65, 0x6b, 0x74, 0x49, 0x6e, 835 - 0x64, 0x65, 0x78, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0e, 0x75, 0x70, 0x64, 0x61, 836 - 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x6c, 0x0a, 0x0b, 0x46, 0x69, 837 - 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x0c, 0x67, 0x65, 0x6e, 838 - 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 839 - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 840 - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x67, 0x65, 0x6e, 841 - 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 842 - 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x69, 0x64, 843 - 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, 0x78, 0x0a, 0x0f, 0x4c, 0x61, 0x6e, 0x67, 844 - 0x75, 0x61, 0x67, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 845 - 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 846 - 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x49, 0x0a, 0x05, 0x63, 0x74, 0x61, 0x67, 0x73, 847 - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 827 + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0b, 0x66, 0x69, 828 + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 829 + 0x2f, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 830 + 0x65, 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 831 + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 832 + 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x5e, 0x0a, 833 + 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 834 + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 848 835 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 849 - 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x54, 0x61, 0x67, 850 - 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x63, 0x74, 0x61, 851 - 0x67, 0x73, 0x22, 0xa4, 0x04, 0x0a, 0x11, 0x5a, 0x6f, 0x65, 0x6b, 0x74, 0x49, 0x6e, 0x64, 0x65, 852 - 0x78, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 853 - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 854 - 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, 855 - 0x65, 0x70, 0x6f, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 856 - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x12, 0x0a, 857 - 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, 0x6f, 0x72, 858 - 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x18, 0x05, 0x20, 859 - 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x12, 0x1f, 0x0a, 860 - 0x0b, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 861 - 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x18, 862 - 0x0a, 0x07, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 863 - 0x07, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x73, 0x12, 0x55, 0x0a, 0x08, 0x62, 0x72, 0x61, 0x6e, 864 - 0x63, 0x68, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x73, 0x6f, 0x75, 865 - 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x63, 866 - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 836 + 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x5a, 0x6f, 0x65, 0x6b, 837 + 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0e, 0x75, 838 + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x6c, 0x0a, 839 + 0x0b, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x0c, 840 + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 841 + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 842 + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 843 + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 844 + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 845 + 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, 0x78, 0x0a, 0x0f, 0x4c, 846 + 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x1a, 847 + 0x0a, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 848 + 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x49, 0x0a, 0x05, 0x63, 0x74, 849 + 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x73, 0x6f, 0x75, 0x72, 850 + 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x63, 0x6f, 851 + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 852 + 0x54, 0x61, 0x67, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 853 + 0x63, 0x74, 0x61, 0x67, 0x73, 0x22, 0xa4, 0x04, 0x0a, 0x11, 0x5a, 0x6f, 0x65, 0x6b, 0x74, 0x49, 854 + 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 855 + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 856 + 0x17, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 857 + 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 858 + 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 859 + 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 860 + 0x66, 0x6f, 0x72, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 861 + 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 862 + 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 863 + 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x46, 0x69, 0x6c, 0x65, 864 + 0x73, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x73, 0x18, 0x07, 0x20, 0x01, 865 + 0x28, 0x08, 0x52, 0x07, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x73, 0x12, 0x55, 0x0a, 0x08, 0x62, 866 + 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 867 + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 868 + 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 869 + 0x76, 0x31, 0x2e, 0x5a, 0x6f, 0x65, 0x6b, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 870 + 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 871 + 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x09, 872 + 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x34, 873 + 0x0a, 0x16, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x73, 874 + 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 875 + 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x73, 0x56, 0x65, 0x72, 876 + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0b, 0x20, 877 + 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x56, 0x0a, 0x0c, 0x6c, 0x61, 878 + 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 879 + 0x32, 0x33, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 880 + 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 881 + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x4d, 0x61, 882 + 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x4d, 883 + 0x61, 0x70, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x63, 884 + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x73, 885 + 0x68, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 886 + 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0e, 0x20, 0x01, 887 + 0x28, 0x03, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x45, 0x0a, 0x15, 867 888 0x5a, 0x6f, 0x65, 0x6b, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 868 - 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x12, 869 - 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 870 - 0x01, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x34, 0x0a, 0x16, 0x64, 871 - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x5f, 0x76, 0x65, 872 - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x64, 0x6f, 0x63, 873 - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 874 - 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 875 - 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x56, 0x0a, 0x0c, 0x6c, 0x61, 0x6e, 0x67, 0x75, 876 - 0x61, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 889 + 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 890 + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 891 + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 892 + 0x69, 0x6f, 0x6e, 0x22, 0x4a, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 893 + 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 894 + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 895 + 0x0a, 0x0b, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 896 + 0x03, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x49, 0x64, 0x73, 0x22, 897 + 0x29, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 898 + 0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 899 + 0x05, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x49, 0x64, 0x73, 0x22, 0xae, 0x02, 0x0a, 0x18, 0x55, 900 + 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 901 + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x6b, 0x0a, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 902 + 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x47, 0x2e, 877 903 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 878 904 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 879 - 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 880 - 0x6e, 0x67, 0x52, 0x0b, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x4d, 0x61, 0x70, 0x12, 881 - 0x2b, 0x0a, 0x11, 0x73, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 882 - 0x65, 0x6e, 0x63, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x73, 0x68, 0x61, 0x72, 883 - 0x64, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x1b, 0x0a, 0x09, 884 - 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 885 - 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x45, 0x0a, 0x15, 0x5a, 0x6f, 0x65, 886 - 0x6b, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 887 - 0x63, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 888 - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 889 - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 890 - 0x22, 0x4a, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 891 - 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 892 - 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 893 - 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 894 - 0x52, 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x49, 0x64, 0x73, 0x22, 0x29, 0x0a, 0x0c, 895 - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 896 - 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 897 - 0x72, 0x65, 0x70, 0x6f, 0x49, 0x64, 0x73, 0x22, 0xae, 0x02, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 898 - 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 899 - 0x75, 0x65, 0x73, 0x74, 0x12, 0x6b, 0x0a, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 900 - 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x47, 0x2e, 0x73, 0x6f, 0x75, 901 - 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x63, 902 - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 903 - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x74, 0x61, 0x74, 0x75, 904 - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 905 - 0x6f, 0x72, 0x79, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 906 - 0x73, 0x1a, 0xa4, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 907 - 0x12, 0x17, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 908 - 0x0d, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x49, 0x64, 0x12, 0x55, 0x0a, 0x08, 0x62, 0x72, 0x61, 909 - 0x6e, 0x63, 0x68, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x73, 0x6f, 910 - 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 911 - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 912 - 0x2e, 0x5a, 0x6f, 0x65, 0x6b, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 913 - 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 914 - 0x12, 0x26, 0x0a, 0x0f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 915 - 0x6e, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x69, 0x6e, 0x64, 0x65, 0x78, 916 - 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x22, 0x1b, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 905 + 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x74, 906 + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x70, 0x6f, 907 + 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 908 + 0x72, 0x69, 0x65, 0x73, 0x1a, 0xa4, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 909 + 0x6f, 0x72, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x01, 910 + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x49, 0x64, 0x12, 0x55, 0x0a, 0x08, 911 + 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 912 + 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 913 + 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 914 + 0x2e, 0x76, 0x31, 0x2e, 0x5a, 0x6f, 0x65, 0x6b, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 915 + 0x6f, 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 916 + 0x68, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x74, 0x69, 0x6d, 917 + 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x69, 0x6e, 918 + 0x64, 0x65, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x22, 0x1b, 0x0a, 0x19, 0x55, 919 + 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 920 + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x91, 0x01, 0x0a, 0x0f, 0x43, 0x54, 0x61, 921 + 0x67, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x1e, 922 + 0x43, 0x5f, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x50, 0x41, 0x52, 0x53, 0x45, 0x52, 0x5f, 0x54, 0x59, 923 + 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 924 + 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x5f, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x50, 0x41, 0x52, 0x53, 0x45, 925 + 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x20, 0x0a, 926 + 0x1c, 0x43, 0x5f, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x50, 0x41, 0x52, 0x53, 0x45, 0x52, 0x5f, 0x54, 927 + 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x49, 0x56, 0x45, 0x52, 0x53, 0x41, 0x4c, 0x10, 0x02, 0x12, 928 + 0x1b, 0x0a, 0x17, 0x43, 0x5f, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x50, 0x41, 0x52, 0x53, 0x45, 0x52, 929 + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x43, 0x49, 0x50, 0x10, 0x03, 0x32, 0xb8, 0x03, 0x0a, 930 + 0x19, 0x5a, 0x6f, 0x65, 0x6b, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 931 + 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x98, 0x01, 0x0a, 0x13, 0x53, 932 + 0x65, 0x61, 0x72, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 933 + 0x6f, 0x6e, 0x12, 0x3e, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 934 + 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 935 + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x43, 0x6f, 936 + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 937 + 0x73, 0x74, 0x1a, 0x3f, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 938 + 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 939 + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x43, 0x6f, 940 + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 941 + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6b, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2f, 0x2e, 942 + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 943 + 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 944 + 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 945 + 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 946 + 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 947 + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 948 + 0x22, 0x00, 0x12, 0x92, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 949 + 0x65, 0x78, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3c, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 950 + 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 951 + 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 952 + 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 953 + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 954 + 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 955 + 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 917 956 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 918 - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x91, 0x01, 0x0a, 0x0f, 0x43, 0x54, 0x61, 0x67, 0x73, 0x50, 919 - 0x61, 0x72, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x1e, 0x43, 0x5f, 0x54, 920 - 0x41, 0x47, 0x53, 0x5f, 0x50, 0x41, 0x52, 0x53, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 921 - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 922 - 0x17, 0x43, 0x5f, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x50, 0x41, 0x52, 0x53, 0x45, 0x52, 0x5f, 0x54, 923 - 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x20, 0x0a, 0x1c, 0x43, 0x5f, 924 - 0x54, 0x41, 0x47, 0x53, 0x5f, 0x50, 0x41, 0x52, 0x53, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 925 - 0x5f, 0x55, 0x4e, 0x49, 0x56, 0x45, 0x52, 0x53, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x1b, 0x0a, 0x17, 926 - 0x43, 0x5f, 0x54, 0x41, 0x47, 0x53, 0x5f, 0x50, 0x41, 0x52, 0x53, 0x45, 0x52, 0x5f, 0x54, 0x59, 927 - 0x50, 0x45, 0x5f, 0x53, 0x43, 0x49, 0x50, 0x10, 0x03, 0x32, 0xb8, 0x03, 0x0a, 0x19, 0x5a, 0x6f, 928 - 0x65, 0x6b, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 929 - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x98, 0x01, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, 930 - 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 931 - 0x3e, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 932 - 0x65, 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 933 - 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 934 - 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 935 - 0x3f, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 936 - 0x65, 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 937 - 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 938 - 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 939 - 0x22, 0x00, 0x12, 0x6b, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2f, 0x2e, 0x73, 0x6f, 0x75, 940 - 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x63, 941 - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 942 - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x73, 0x6f, 943 - 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 944 - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 945 - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 946 - 0x92, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 947 - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3c, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 948 - 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 949 - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 950 - 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 951 - 0x65, 0x73, 0x74, 0x1a, 0x3d, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 952 - 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 953 - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 954 - 0x6e, 0x64, 0x65, 0x78, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 955 - 0x73, 0x65, 0x22, 0x00, 0x42, 0x6f, 0x5a, 0x6d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 956 - 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2f, 0x7a, 957 - 0x6f, 0x65, 0x6b, 0x74, 0x2f, 0x63, 0x6d, 0x64, 0x2f, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2d, 0x73, 958 - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2d, 0x69, 0x6e, 0x64, 0x65, 0x78, 959 - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 960 - 0x6f, 0x73, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2f, 0x7a, 961 - 0x6f, 0x65, 0x6b, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 962 - 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 957 + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x6f, 0x5a, 0x6d, 0x67, 0x69, 0x74, 0x68, 0x75, 958 + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 959 + 0x68, 0x2f, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2f, 0x63, 0x6d, 0x64, 0x2f, 0x7a, 0x6f, 0x65, 0x6b, 960 + 0x74, 0x2d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2d, 0x69, 0x6e, 961 + 0x64, 0x65, 0x78, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 962 + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 963 + 0x68, 0x2f, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 964 + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 963 965 } 964 966 965 967 var ( 966 - file_configuration_proto_rawDescOnce sync.Once 967 - file_configuration_proto_rawDescData = file_configuration_proto_rawDesc 968 + file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescOnce sync.Once 969 + file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescData = file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDesc 968 970 ) 969 971 970 - func file_configuration_proto_rawDescGZIP() []byte { 971 - file_configuration_proto_rawDescOnce.Do(func() { 972 - file_configuration_proto_rawDescData = protoimpl.X.CompressGZIP(file_configuration_proto_rawDescData) 972 + func file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescGZIP() []byte { 973 + file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescOnce.Do(func() { 974 + file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescData = protoimpl.X.CompressGZIP(file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescData) 973 975 }) 974 - return file_configuration_proto_rawDescData 976 + return file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDescData 975 977 } 976 978 977 - var file_configuration_proto_enumTypes = make([]protoimpl.EnumInfo, 1) 978 - var file_configuration_proto_msgTypes = make([]protoimpl.MessageInfo, 11) 979 - var file_configuration_proto_goTypes = []interface{}{ 979 + var file_sourcegraph_zoekt_configuration_v1_configuration_proto_enumTypes = make([]protoimpl.EnumInfo, 1) 980 + var file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes = make([]protoimpl.MessageInfo, 11) 981 + var file_sourcegraph_zoekt_configuration_v1_configuration_proto_goTypes = []interface{}{ 980 982 (CTagsParserType)(0), // 0: sourcegraph.zoekt.configuration.v1.CTagsParserType 981 983 (*SearchConfigurationRequest)(nil), // 1: sourcegraph.zoekt.configuration.v1.SearchConfigurationRequest 982 984 (*SearchConfigurationResponse)(nil), // 2: sourcegraph.zoekt.configuration.v1.SearchConfigurationResponse ··· 991 993 (*UpdateIndexStatusRequest_Repository)(nil), // 11: sourcegraph.zoekt.configuration.v1.UpdateIndexStatusRequest.Repository 992 994 (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp 993 995 } 994 - var file_configuration_proto_depIdxs = []int32{ 996 + var file_sourcegraph_zoekt_configuration_v1_configuration_proto_depIdxs = []int32{ 995 997 3, // 0: sourcegraph.zoekt.configuration.v1.SearchConfigurationRequest.fingerprint:type_name -> sourcegraph.zoekt.configuration.v1.Fingerprint 996 998 3, // 1: sourcegraph.zoekt.configuration.v1.SearchConfigurationResponse.fingerprint:type_name -> sourcegraph.zoekt.configuration.v1.Fingerprint 997 999 5, // 2: sourcegraph.zoekt.configuration.v1.SearchConfigurationResponse.updated_options:type_name -> sourcegraph.zoekt.configuration.v1.ZoektIndexOptions ··· 1014 1016 0, // [0:9] is the sub-list for field type_name 1015 1017 } 1016 1018 1017 - func init() { file_configuration_proto_init() } 1018 - func file_configuration_proto_init() { 1019 - if File_configuration_proto != nil { 1019 + func init() { file_sourcegraph_zoekt_configuration_v1_configuration_proto_init() } 1020 + func file_sourcegraph_zoekt_configuration_v1_configuration_proto_init() { 1021 + if File_sourcegraph_zoekt_configuration_v1_configuration_proto != nil { 1020 1022 return 1021 1023 } 1022 1024 if !protoimpl.UnsafeEnabled { 1023 - file_configuration_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 1025 + file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 1024 1026 switch v := v.(*SearchConfigurationRequest); i { 1025 1027 case 0: 1026 1028 return &v.state ··· 1032 1034 return nil 1033 1035 } 1034 1036 } 1035 - file_configuration_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 1037 + file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 1036 1038 switch v := v.(*SearchConfigurationResponse); i { 1037 1039 case 0: 1038 1040 return &v.state ··· 1044 1046 return nil 1045 1047 } 1046 1048 } 1047 - file_configuration_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { 1049 + file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { 1048 1050 switch v := v.(*Fingerprint); i { 1049 1051 case 0: 1050 1052 return &v.state ··· 1056 1058 return nil 1057 1059 } 1058 1060 } 1059 - file_configuration_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { 1061 + file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { 1060 1062 switch v := v.(*LanguageMapping); i { 1061 1063 case 0: 1062 1064 return &v.state ··· 1068 1070 return nil 1069 1071 } 1070 1072 } 1071 - file_configuration_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { 1073 + file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { 1072 1074 switch v := v.(*ZoektIndexOptions); i { 1073 1075 case 0: 1074 1076 return &v.state ··· 1080 1082 return nil 1081 1083 } 1082 1084 } 1083 - file_configuration_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { 1085 + file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { 1084 1086 switch v := v.(*ZoektRepositoryBranch); i { 1085 1087 case 0: 1086 1088 return &v.state ··· 1092 1094 return nil 1093 1095 } 1094 1096 } 1095 - file_configuration_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { 1097 + file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { 1096 1098 switch v := v.(*ListRequest); i { 1097 1099 case 0: 1098 1100 return &v.state ··· 1104 1106 return nil 1105 1107 } 1106 1108 } 1107 - file_configuration_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { 1109 + file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { 1108 1110 switch v := v.(*ListResponse); i { 1109 1111 case 0: 1110 1112 return &v.state ··· 1116 1118 return nil 1117 1119 } 1118 1120 } 1119 - file_configuration_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { 1121 + file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { 1120 1122 switch v := v.(*UpdateIndexStatusRequest); i { 1121 1123 case 0: 1122 1124 return &v.state ··· 1128 1130 return nil 1129 1131 } 1130 1132 } 1131 - file_configuration_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { 1133 + file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { 1132 1134 switch v := v.(*UpdateIndexStatusResponse); i { 1133 1135 case 0: 1134 1136 return &v.state ··· 1140 1142 return nil 1141 1143 } 1142 1144 } 1143 - file_configuration_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { 1145 + file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { 1144 1146 switch v := v.(*UpdateIndexStatusRequest_Repository); i { 1145 1147 case 0: 1146 1148 return &v.state ··· 1157 1159 out := protoimpl.TypeBuilder{ 1158 1160 File: protoimpl.DescBuilder{ 1159 1161 GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 1160 - RawDescriptor: file_configuration_proto_rawDesc, 1162 + RawDescriptor: file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDesc, 1161 1163 NumEnums: 1, 1162 1164 NumMessages: 11, 1163 1165 NumExtensions: 0, 1164 1166 NumServices: 1, 1165 1167 }, 1166 - GoTypes: file_configuration_proto_goTypes, 1167 - DependencyIndexes: file_configuration_proto_depIdxs, 1168 - EnumInfos: file_configuration_proto_enumTypes, 1169 - MessageInfos: file_configuration_proto_msgTypes, 1168 + GoTypes: file_sourcegraph_zoekt_configuration_v1_configuration_proto_goTypes, 1169 + DependencyIndexes: file_sourcegraph_zoekt_configuration_v1_configuration_proto_depIdxs, 1170 + EnumInfos: file_sourcegraph_zoekt_configuration_v1_configuration_proto_enumTypes, 1171 + MessageInfos: file_sourcegraph_zoekt_configuration_v1_configuration_proto_msgTypes, 1170 1172 }.Build() 1171 - File_configuration_proto = out.File 1172 - file_configuration_proto_rawDesc = nil 1173 - file_configuration_proto_goTypes = nil 1174 - file_configuration_proto_depIdxs = nil 1173 + File_sourcegraph_zoekt_configuration_v1_configuration_proto = out.File 1174 + file_sourcegraph_zoekt_configuration_v1_configuration_proto_rawDesc = nil 1175 + file_sourcegraph_zoekt_configuration_v1_configuration_proto_goTypes = nil 1176 + file_sourcegraph_zoekt_configuration_v1_configuration_proto_depIdxs = nil 1175 1177 }
+2 -2
cmd/zoekt-sourcegraph-indexserver/grpc/protos/sourcegraph/zoekt/configuration/v1/configuration_grpc.pb.go
··· 2 2 // versions: 3 3 // - protoc-gen-go-grpc v1.3.0 4 4 // - protoc (unknown) 5 - // source: configuration.proto 5 + // source: sourcegraph/zoekt/configuration/v1/configuration.proto 6 6 7 7 package v1 8 8 ··· 188 188 }, 189 189 }, 190 190 Streams: []grpc.StreamDesc{}, 191 - Metadata: "configuration.proto", 191 + Metadata: "sourcegraph/zoekt/configuration/v1/configuration.proto", 192 192 }
cmd/zoekt-sourcegraph-indexserver/grpc/protos/zoekt/indexserver/v1/buf.gen.yaml cmd/zoekt-sourcegraph-indexserver/grpc/protos/buf.gen.yaml
+359 -63
cmd/zoekt-sourcegraph-indexserver/grpc/protos/zoekt/indexserver/v1/indexserver.pb.go
··· 2 2 // versions: 3 3 // protoc-gen-go v1.28.1 4 4 // protoc (unknown) 5 - // source: indexserver.proto 5 + // source: zoekt/indexserver/v1/indexserver.proto 6 6 7 7 package v1 8 8 9 9 import ( 10 + v1 "github.com/sourcegraph/zoekt/cmd/zoekt-sourcegraph-indexserver/grpc/protos/sourcegraph/zoekt/configuration/v1" 10 11 protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 12 protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 13 reflect "reflect" ··· 29 30 func (x *DeleteAllDataRequest) Reset() { 30 31 *x = DeleteAllDataRequest{} 31 32 if protoimpl.UnsafeEnabled { 32 - mi := &file_indexserver_proto_msgTypes[0] 33 + mi := &file_zoekt_indexserver_v1_indexserver_proto_msgTypes[0] 33 34 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 34 35 ms.StoreMessageInfo(mi) 35 36 } ··· 42 43 func (*DeleteAllDataRequest) ProtoMessage() {} 43 44 44 45 func (x *DeleteAllDataRequest) ProtoReflect() protoreflect.Message { 45 - mi := &file_indexserver_proto_msgTypes[0] 46 + mi := &file_zoekt_indexserver_v1_indexserver_proto_msgTypes[0] 46 47 if protoimpl.UnsafeEnabled && x != nil { 47 48 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 48 49 if ms.LoadMessageInfo() == nil { ··· 55 56 56 57 // Deprecated: Use DeleteAllDataRequest.ProtoReflect.Descriptor instead. 57 58 func (*DeleteAllDataRequest) Descriptor() ([]byte, []int) { 58 - return file_indexserver_proto_rawDescGZIP(), []int{0} 59 + return file_zoekt_indexserver_v1_indexserver_proto_rawDescGZIP(), []int{0} 59 60 } 60 61 61 62 type DeleteAllDataResponse struct { ··· 67 68 func (x *DeleteAllDataResponse) Reset() { 68 69 *x = DeleteAllDataResponse{} 69 70 if protoimpl.UnsafeEnabled { 70 - mi := &file_indexserver_proto_msgTypes[1] 71 + mi := &file_zoekt_indexserver_v1_indexserver_proto_msgTypes[1] 71 72 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 72 73 ms.StoreMessageInfo(mi) 73 74 } ··· 80 81 func (*DeleteAllDataResponse) ProtoMessage() {} 81 82 82 83 func (x *DeleteAllDataResponse) ProtoReflect() protoreflect.Message { 83 - mi := &file_indexserver_proto_msgTypes[1] 84 + mi := &file_zoekt_indexserver_v1_indexserver_proto_msgTypes[1] 84 85 if protoimpl.UnsafeEnabled && x != nil { 85 86 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 86 87 if ms.LoadMessageInfo() == nil { ··· 93 94 94 95 // Deprecated: Use DeleteAllDataResponse.ProtoReflect.Descriptor instead. 95 96 func (*DeleteAllDataResponse) Descriptor() ([]byte, []int) { 96 - return file_indexserver_proto_rawDescGZIP(), []int{1} 97 + return file_zoekt_indexserver_v1_indexserver_proto_rawDescGZIP(), []int{1} 98 + } 99 + 100 + type DeleteRequest struct { 101 + state protoimpl.MessageState 102 + sizeCache protoimpl.SizeCache 103 + unknownFields protoimpl.UnknownFields 104 + 105 + // repo_ids are the Sourcegraph repository IDs to delete. 106 + RepoIds []uint32 `protobuf:"varint,1,rep,packed,name=repo_ids,json=repoIds,proto3" json:"repo_ids,omitempty"` 107 + } 108 + 109 + func (x *DeleteRequest) Reset() { 110 + *x = DeleteRequest{} 111 + if protoimpl.UnsafeEnabled { 112 + mi := &file_zoekt_indexserver_v1_indexserver_proto_msgTypes[2] 113 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 114 + ms.StoreMessageInfo(mi) 115 + } 116 + } 117 + 118 + func (x *DeleteRequest) String() string { 119 + return protoimpl.X.MessageStringOf(x) 120 + } 121 + 122 + func (*DeleteRequest) ProtoMessage() {} 123 + 124 + func (x *DeleteRequest) ProtoReflect() protoreflect.Message { 125 + mi := &file_zoekt_indexserver_v1_indexserver_proto_msgTypes[2] 126 + if protoimpl.UnsafeEnabled && x != nil { 127 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 128 + if ms.LoadMessageInfo() == nil { 129 + ms.StoreMessageInfo(mi) 130 + } 131 + return ms 132 + } 133 + return mi.MessageOf(x) 134 + } 135 + 136 + // Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. 137 + func (*DeleteRequest) Descriptor() ([]byte, []int) { 138 + return file_zoekt_indexserver_v1_indexserver_proto_rawDescGZIP(), []int{2} 139 + } 140 + 141 + func (x *DeleteRequest) GetRepoIds() []uint32 { 142 + if x != nil { 143 + return x.RepoIds 144 + } 145 + return nil 146 + } 147 + 148 + type DeleteResponse struct { 149 + state protoimpl.MessageState 150 + sizeCache protoimpl.SizeCache 151 + unknownFields protoimpl.UnknownFields 152 + } 153 + 154 + func (x *DeleteResponse) Reset() { 155 + *x = DeleteResponse{} 156 + if protoimpl.UnsafeEnabled { 157 + mi := &file_zoekt_indexserver_v1_indexserver_proto_msgTypes[3] 158 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 159 + ms.StoreMessageInfo(mi) 160 + } 161 + } 162 + 163 + func (x *DeleteResponse) String() string { 164 + return protoimpl.X.MessageStringOf(x) 165 + } 166 + 167 + func (*DeleteResponse) ProtoMessage() {} 168 + 169 + func (x *DeleteResponse) ProtoReflect() protoreflect.Message { 170 + mi := &file_zoekt_indexserver_v1_indexserver_proto_msgTypes[3] 171 + if protoimpl.UnsafeEnabled && x != nil { 172 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 173 + if ms.LoadMessageInfo() == nil { 174 + ms.StoreMessageInfo(mi) 175 + } 176 + return ms 177 + } 178 + return mi.MessageOf(x) 179 + } 180 + 181 + // Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. 182 + func (*DeleteResponse) Descriptor() ([]byte, []int) { 183 + return file_zoekt_indexserver_v1_indexserver_proto_rawDescGZIP(), []int{3} 184 + } 185 + 186 + type IndexRequest struct { 187 + state protoimpl.MessageState 188 + sizeCache protoimpl.SizeCache 189 + unknownFields protoimpl.UnknownFields 190 + 191 + Options *v1.ZoektIndexOptions `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` 192 + } 193 + 194 + func (x *IndexRequest) Reset() { 195 + *x = IndexRequest{} 196 + if protoimpl.UnsafeEnabled { 197 + mi := &file_zoekt_indexserver_v1_indexserver_proto_msgTypes[4] 198 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 199 + ms.StoreMessageInfo(mi) 200 + } 201 + } 202 + 203 + func (x *IndexRequest) String() string { 204 + return protoimpl.X.MessageStringOf(x) 205 + } 206 + 207 + func (*IndexRequest) ProtoMessage() {} 208 + 209 + func (x *IndexRequest) ProtoReflect() protoreflect.Message { 210 + mi := &file_zoekt_indexserver_v1_indexserver_proto_msgTypes[4] 211 + if protoimpl.UnsafeEnabled && x != nil { 212 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 213 + if ms.LoadMessageInfo() == nil { 214 + ms.StoreMessageInfo(mi) 215 + } 216 + return ms 217 + } 218 + return mi.MessageOf(x) 219 + } 220 + 221 + // Deprecated: Use IndexRequest.ProtoReflect.Descriptor instead. 222 + func (*IndexRequest) Descriptor() ([]byte, []int) { 223 + return file_zoekt_indexserver_v1_indexserver_proto_rawDescGZIP(), []int{4} 224 + } 225 + 226 + func (x *IndexRequest) GetOptions() *v1.ZoektIndexOptions { 227 + if x != nil { 228 + return x.Options 229 + } 230 + return nil 231 + } 232 + 233 + type IndexResponse struct { 234 + state protoimpl.MessageState 235 + sizeCache protoimpl.SizeCache 236 + unknownFields protoimpl.UnknownFields 237 + 238 + // repo_id is the Sourcegraph repository ID. 239 + RepoId uint32 `protobuf:"varint,1,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` 240 + // branches is the list of branches that the client has indexed. 241 + Branches []*v1.ZoektRepositoryBranch `protobuf:"bytes,2,rep,name=branches,proto3" json:"branches,omitempty"` 242 + // index_time_unix is the unix timestamp for when the index was created. 243 + IndexTimeUnix int64 `protobuf:"varint,3,opt,name=index_time_unix,json=indexTimeUnix,proto3" json:"index_time_unix,omitempty"` 97 244 } 98 245 99 - var File_indexserver_proto protoreflect.FileDescriptor 246 + func (x *IndexResponse) Reset() { 247 + *x = IndexResponse{} 248 + if protoimpl.UnsafeEnabled { 249 + mi := &file_zoekt_indexserver_v1_indexserver_proto_msgTypes[5] 250 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 251 + ms.StoreMessageInfo(mi) 252 + } 253 + } 100 254 101 - var file_indexserver_proto_rawDesc = []byte{ 102 - 0x0a, 0x11, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 103 - 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 104 - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x22, 0x16, 0x0a, 0x14, 0x44, 0x65, 0x6c, 105 - 0x65, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 106 - 0x74, 0x22, 0x17, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x44, 0x61, 107 - 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x8e, 0x01, 0x0a, 0x1d, 0x53, 108 - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x73, 109 - 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6d, 0x0a, 0x0d, 110 - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2a, 0x2e, 111 - 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x73, 0x65, 0x72, 0x76, 0x65, 112 - 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x44, 0x61, 113 - 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 114 - 0x74, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 115 - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 116 - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x42, 0x5c, 0x5a, 0x5a, 0x67, 117 - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 118 - 0x67, 0x72, 0x61, 0x70, 0x68, 0x2f, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2f, 0x63, 0x6d, 0x64, 0x2f, 119 - 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 120 - 0x68, 0x2d, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 121 - 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 122 - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 123 - 0x33, 255 + func (x *IndexResponse) String() string { 256 + return protoimpl.X.MessageStringOf(x) 257 + } 258 + 259 + func (*IndexResponse) ProtoMessage() {} 260 + 261 + func (x *IndexResponse) ProtoReflect() protoreflect.Message { 262 + mi := &file_zoekt_indexserver_v1_indexserver_proto_msgTypes[5] 263 + if protoimpl.UnsafeEnabled && x != nil { 264 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 265 + if ms.LoadMessageInfo() == nil { 266 + ms.StoreMessageInfo(mi) 267 + } 268 + return ms 269 + } 270 + return mi.MessageOf(x) 271 + } 272 + 273 + // Deprecated: Use IndexResponse.ProtoReflect.Descriptor instead. 274 + func (*IndexResponse) Descriptor() ([]byte, []int) { 275 + return file_zoekt_indexserver_v1_indexserver_proto_rawDescGZIP(), []int{5} 276 + } 277 + 278 + func (x *IndexResponse) GetRepoId() uint32 { 279 + if x != nil { 280 + return x.RepoId 281 + } 282 + return 0 283 + } 284 + 285 + func (x *IndexResponse) GetBranches() []*v1.ZoektRepositoryBranch { 286 + if x != nil { 287 + return x.Branches 288 + } 289 + return nil 290 + } 291 + 292 + func (x *IndexResponse) GetIndexTimeUnix() int64 { 293 + if x != nil { 294 + return x.IndexTimeUnix 295 + } 296 + return 0 297 + } 298 + 299 + var File_zoekt_indexserver_v1_indexserver_proto protoreflect.FileDescriptor 300 + 301 + var file_zoekt_indexserver_v1_indexserver_proto_rawDesc = []byte{ 302 + 0x0a, 0x26, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x73, 0x65, 0x72, 303 + 0x76, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x73, 0x65, 0x72, 0x76, 304 + 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 305 + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x36, 306 + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2f, 0x7a, 0x6f, 0x65, 0x6b, 307 + 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 308 + 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 309 + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x16, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 310 + 0x41, 0x6c, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x17, 311 + 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 312 + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 313 + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 314 + 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 315 + 0x49, 0x64, 0x73, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 316 + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5f, 0x0a, 0x0c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 317 + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 318 + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 319 + 0x72, 0x61, 0x70, 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 320 + 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x5a, 0x6f, 0x65, 0x6b, 321 + 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 322 + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa7, 0x01, 0x0a, 0x0d, 0x49, 0x6e, 0x64, 0x65, 0x78, 323 + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6f, 324 + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x49, 325 + 0x64, 0x12, 0x55, 0x0a, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x18, 0x02, 0x20, 326 + 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 327 + 0x68, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 328 + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x5a, 0x6f, 0x65, 0x6b, 0x74, 0x52, 0x65, 329 + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x08, 330 + 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x69, 0x6e, 0x64, 0x65, 331 + 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 332 + 0x03, 0x52, 0x0d, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 333 + 0x32, 0xbf, 0x02, 0x0a, 0x1d, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 334 + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 335 + 0x63, 0x65, 0x12, 0x6d, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x44, 336 + 0x61, 0x74, 0x61, 0x12, 0x2a, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x69, 0x6e, 0x64, 0x65, 337 + 0x78, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 338 + 0x65, 0x41, 0x6c, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 339 + 0x2b, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x73, 0x65, 0x72, 340 + 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6c, 0x6c, 341 + 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 342 + 0x02, 0x12, 0x58, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x23, 0x2e, 0x7a, 0x6f, 343 + 0x65, 0x6b, 0x74, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 344 + 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 345 + 0x1a, 0x24, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x73, 0x65, 346 + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 347 + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x12, 0x55, 0x0a, 0x05, 0x49, 348 + 0x6e, 0x64, 0x65, 0x78, 0x12, 0x22, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2e, 0x69, 0x6e, 0x64, 349 + 0x65, 0x78, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 350 + 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 351 + 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 352 + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 353 + 0x02, 0x02, 0x42, 0x5c, 0x5a, 0x5a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 354 + 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2f, 0x7a, 0x6f, 0x65, 355 + 0x6b, 0x74, 0x2f, 0x63, 0x6d, 0x64, 0x2f, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2d, 0x73, 0x6f, 0x75, 356 + 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2d, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x73, 0x65, 357 + 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x7a, 0x6f, 0x65, 0x6b, 358 + 0x74, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x76, 0x31, 359 + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 124 360 } 125 361 126 362 var ( 127 - file_indexserver_proto_rawDescOnce sync.Once 128 - file_indexserver_proto_rawDescData = file_indexserver_proto_rawDesc 363 + file_zoekt_indexserver_v1_indexserver_proto_rawDescOnce sync.Once 364 + file_zoekt_indexserver_v1_indexserver_proto_rawDescData = file_zoekt_indexserver_v1_indexserver_proto_rawDesc 129 365 ) 130 366 131 - func file_indexserver_proto_rawDescGZIP() []byte { 132 - file_indexserver_proto_rawDescOnce.Do(func() { 133 - file_indexserver_proto_rawDescData = protoimpl.X.CompressGZIP(file_indexserver_proto_rawDescData) 367 + func file_zoekt_indexserver_v1_indexserver_proto_rawDescGZIP() []byte { 368 + file_zoekt_indexserver_v1_indexserver_proto_rawDescOnce.Do(func() { 369 + file_zoekt_indexserver_v1_indexserver_proto_rawDescData = protoimpl.X.CompressGZIP(file_zoekt_indexserver_v1_indexserver_proto_rawDescData) 134 370 }) 135 - return file_indexserver_proto_rawDescData 371 + return file_zoekt_indexserver_v1_indexserver_proto_rawDescData 136 372 } 137 373 138 - var file_indexserver_proto_msgTypes = make([]protoimpl.MessageInfo, 2) 139 - var file_indexserver_proto_goTypes = []interface{}{ 140 - (*DeleteAllDataRequest)(nil), // 0: zoekt.indexserver.v1.DeleteAllDataRequest 141 - (*DeleteAllDataResponse)(nil), // 1: zoekt.indexserver.v1.DeleteAllDataResponse 374 + var file_zoekt_indexserver_v1_indexserver_proto_msgTypes = make([]protoimpl.MessageInfo, 6) 375 + var file_zoekt_indexserver_v1_indexserver_proto_goTypes = []interface{}{ 376 + (*DeleteAllDataRequest)(nil), // 0: zoekt.indexserver.v1.DeleteAllDataRequest 377 + (*DeleteAllDataResponse)(nil), // 1: zoekt.indexserver.v1.DeleteAllDataResponse 378 + (*DeleteRequest)(nil), // 2: zoekt.indexserver.v1.DeleteRequest 379 + (*DeleteResponse)(nil), // 3: zoekt.indexserver.v1.DeleteResponse 380 + (*IndexRequest)(nil), // 4: zoekt.indexserver.v1.IndexRequest 381 + (*IndexResponse)(nil), // 5: zoekt.indexserver.v1.IndexResponse 382 + (*v1.ZoektIndexOptions)(nil), // 6: sourcegraph.zoekt.configuration.v1.ZoektIndexOptions 383 + (*v1.ZoektRepositoryBranch)(nil), // 7: sourcegraph.zoekt.configuration.v1.ZoektRepositoryBranch 142 384 } 143 - var file_indexserver_proto_depIdxs = []int32{ 144 - 0, // 0: zoekt.indexserver.v1.SourcegraphIndexserverService.DeleteAllData:input_type -> zoekt.indexserver.v1.DeleteAllDataRequest 145 - 1, // 1: zoekt.indexserver.v1.SourcegraphIndexserverService.DeleteAllData:output_type -> zoekt.indexserver.v1.DeleteAllDataResponse 146 - 1, // [1:2] is the sub-list for method output_type 147 - 0, // [0:1] is the sub-list for method input_type 148 - 0, // [0:0] is the sub-list for extension type_name 149 - 0, // [0:0] is the sub-list for extension extendee 150 - 0, // [0:0] is the sub-list for field type_name 385 + var file_zoekt_indexserver_v1_indexserver_proto_depIdxs = []int32{ 386 + 6, // 0: zoekt.indexserver.v1.IndexRequest.options:type_name -> sourcegraph.zoekt.configuration.v1.ZoektIndexOptions 387 + 7, // 1: zoekt.indexserver.v1.IndexResponse.branches:type_name -> sourcegraph.zoekt.configuration.v1.ZoektRepositoryBranch 388 + 0, // 2: zoekt.indexserver.v1.SourcegraphIndexserverService.DeleteAllData:input_type -> zoekt.indexserver.v1.DeleteAllDataRequest 389 + 2, // 3: zoekt.indexserver.v1.SourcegraphIndexserverService.Delete:input_type -> zoekt.indexserver.v1.DeleteRequest 390 + 4, // 4: zoekt.indexserver.v1.SourcegraphIndexserverService.Index:input_type -> zoekt.indexserver.v1.IndexRequest 391 + 1, // 5: zoekt.indexserver.v1.SourcegraphIndexserverService.DeleteAllData:output_type -> zoekt.indexserver.v1.DeleteAllDataResponse 392 + 3, // 6: zoekt.indexserver.v1.SourcegraphIndexserverService.Delete:output_type -> zoekt.indexserver.v1.DeleteResponse 393 + 5, // 7: zoekt.indexserver.v1.SourcegraphIndexserverService.Index:output_type -> zoekt.indexserver.v1.IndexResponse 394 + 5, // [5:8] is the sub-list for method output_type 395 + 2, // [2:5] is the sub-list for method input_type 396 + 2, // [2:2] is the sub-list for extension type_name 397 + 2, // [2:2] is the sub-list for extension extendee 398 + 0, // [0:2] is the sub-list for field type_name 151 399 } 152 400 153 - func init() { file_indexserver_proto_init() } 154 - func file_indexserver_proto_init() { 155 - if File_indexserver_proto != nil { 401 + func init() { file_zoekt_indexserver_v1_indexserver_proto_init() } 402 + func file_zoekt_indexserver_v1_indexserver_proto_init() { 403 + if File_zoekt_indexserver_v1_indexserver_proto != nil { 156 404 return 157 405 } 158 406 if !protoimpl.UnsafeEnabled { 159 - file_indexserver_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 407 + file_zoekt_indexserver_v1_indexserver_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 160 408 switch v := v.(*DeleteAllDataRequest); i { 161 409 case 0: 162 410 return &v.state ··· 168 416 return nil 169 417 } 170 418 } 171 - file_indexserver_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 419 + file_zoekt_indexserver_v1_indexserver_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 172 420 switch v := v.(*DeleteAllDataResponse); i { 173 421 case 0: 174 422 return &v.state ··· 180 428 return nil 181 429 } 182 430 } 431 + file_zoekt_indexserver_v1_indexserver_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { 432 + switch v := v.(*DeleteRequest); i { 433 + case 0: 434 + return &v.state 435 + case 1: 436 + return &v.sizeCache 437 + case 2: 438 + return &v.unknownFields 439 + default: 440 + return nil 441 + } 442 + } 443 + file_zoekt_indexserver_v1_indexserver_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { 444 + switch v := v.(*DeleteResponse); i { 445 + case 0: 446 + return &v.state 447 + case 1: 448 + return &v.sizeCache 449 + case 2: 450 + return &v.unknownFields 451 + default: 452 + return nil 453 + } 454 + } 455 + file_zoekt_indexserver_v1_indexserver_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { 456 + switch v := v.(*IndexRequest); i { 457 + case 0: 458 + return &v.state 459 + case 1: 460 + return &v.sizeCache 461 + case 2: 462 + return &v.unknownFields 463 + default: 464 + return nil 465 + } 466 + } 467 + file_zoekt_indexserver_v1_indexserver_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { 468 + switch v := v.(*IndexResponse); i { 469 + case 0: 470 + return &v.state 471 + case 1: 472 + return &v.sizeCache 473 + case 2: 474 + return &v.unknownFields 475 + default: 476 + return nil 477 + } 478 + } 183 479 } 184 480 type x struct{} 185 481 out := protoimpl.TypeBuilder{ 186 482 File: protoimpl.DescBuilder{ 187 483 GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 188 - RawDescriptor: file_indexserver_proto_rawDesc, 484 + RawDescriptor: file_zoekt_indexserver_v1_indexserver_proto_rawDesc, 189 485 NumEnums: 0, 190 - NumMessages: 2, 486 + NumMessages: 6, 191 487 NumExtensions: 0, 192 488 NumServices: 1, 193 489 }, 194 - GoTypes: file_indexserver_proto_goTypes, 195 - DependencyIndexes: file_indexserver_proto_depIdxs, 196 - MessageInfos: file_indexserver_proto_msgTypes, 490 + GoTypes: file_zoekt_indexserver_v1_indexserver_proto_goTypes, 491 + DependencyIndexes: file_zoekt_indexserver_v1_indexserver_proto_depIdxs, 492 + MessageInfos: file_zoekt_indexserver_v1_indexserver_proto_msgTypes, 197 493 }.Build() 198 - File_indexserver_proto = out.File 199 - file_indexserver_proto_rawDesc = nil 200 - file_indexserver_proto_goTypes = nil 201 - file_indexserver_proto_depIdxs = nil 494 + File_zoekt_indexserver_v1_indexserver_proto = out.File 495 + file_zoekt_indexserver_v1_indexserver_proto_rawDesc = nil 496 + file_zoekt_indexserver_v1_indexserver_proto_goTypes = nil 497 + file_zoekt_indexserver_v1_indexserver_proto_depIdxs = nil 202 498 }
+37
cmd/zoekt-sourcegraph-indexserver/grpc/protos/zoekt/indexserver/v1/indexserver.proto
··· 2 2 3 3 package zoekt.indexserver.v1; 4 4 5 + import "sourcegraph/zoekt/configuration/v1/configuration.proto"; 6 + 5 7 option go_package = "github.com/sourcegraph/zoekt/cmd/zoekt-sourcegraph-indexserver/protos/zoekt/indexserver/v1"; 6 8 7 9 message DeleteAllDataRequest {} 8 10 9 11 message DeleteAllDataResponse {} 10 12 13 + message DeleteRequest { 14 + // repo_ids are the Sourcegraph repository IDs to delete. 15 + repeated uint32 repo_ids = 1; 16 + } 17 + 18 + message DeleteResponse {} 19 + 20 + message IndexRequest { 21 + sourcegraph.zoekt.configuration.v1.ZoektIndexOptions options = 1; 22 + } 23 + 24 + message IndexResponse { 25 + // repo_id is the Sourcegraph repository ID. 26 + uint32 repo_id = 1; 27 + 28 + // branches is the list of branches that the client has indexed. 29 + repeated sourcegraph.zoekt.configuration.v1.ZoektRepositoryBranch branches = 2; 30 + 31 + // index_time_unix is the unix timestamp for when the index was created. 32 + int64 index_time_unix = 3; 33 + } 34 + 11 35 service SourcegraphIndexserverService { 12 36 // DeleteAllData deletes all data for the tenant in the request context. 13 37 // This is used for pruning all data after a tenant has been deleted. 14 38 rpc DeleteAllData(DeleteAllDataRequest) returns (DeleteAllDataResponse) { 39 + option idempotency_level = IDEMPOTENT; 40 + } 41 + 42 + // Delete deletes the index for a specific repository. 43 + // This is used when a repository needs to be reindexed from scratch or when it's deleted. 44 + rpc Delete(DeleteRequest) returns (DeleteResponse) { 45 + option idempotency_level = IDEMPOTENT; 46 + } 47 + 48 + // Index indexes a repository with the given options and returns the repository information 49 + // including the index timestamp. This information is needed by the frontend to update its state 50 + // since Zoekt no longer sends status updates to Sourcegraph. 51 + rpc Index(IndexRequest) returns (IndexResponse) { 15 52 option idempotency_level = IDEMPOTENT; 16 53 } 17 54 }
+86 -2
cmd/zoekt-sourcegraph-indexserver/grpc/protos/zoekt/indexserver/v1/indexserver_grpc.pb.go
··· 2 2 // versions: 3 3 // - protoc-gen-go-grpc v1.3.0 4 4 // - protoc (unknown) 5 - // source: indexserver.proto 5 + // source: zoekt/indexserver/v1/indexserver.proto 6 6 7 7 package v1 8 8 ··· 20 20 21 21 const ( 22 22 SourcegraphIndexserverService_DeleteAllData_FullMethodName = "/zoekt.indexserver.v1.SourcegraphIndexserverService/DeleteAllData" 23 + SourcegraphIndexserverService_Delete_FullMethodName = "/zoekt.indexserver.v1.SourcegraphIndexserverService/Delete" 24 + SourcegraphIndexserverService_Index_FullMethodName = "/zoekt.indexserver.v1.SourcegraphIndexserverService/Index" 23 25 ) 24 26 25 27 // SourcegraphIndexserverServiceClient is the client API for SourcegraphIndexserverService service. ··· 29 31 // DeleteAllData deletes all data for the tenant in the request context. 30 32 // This is used for pruning all data after a tenant has been deleted. 31 33 DeleteAllData(ctx context.Context, in *DeleteAllDataRequest, opts ...grpc.CallOption) (*DeleteAllDataResponse, error) 34 + // Delete deletes the index for a specific repository. 35 + // This is used when a repository needs to be reindexed from scratch or when it's deleted. 36 + Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) 37 + // Index indexes a repository with the given options and returns the repository information 38 + // including the index timestamp. This information is needed by the frontend to update its state 39 + // since Zoekt no longer sends status updates to Sourcegraph. 40 + Index(ctx context.Context, in *IndexRequest, opts ...grpc.CallOption) (*IndexResponse, error) 32 41 } 33 42 34 43 type sourcegraphIndexserverServiceClient struct { ··· 48 57 return out, nil 49 58 } 50 59 60 + func (c *sourcegraphIndexserverServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { 61 + out := new(DeleteResponse) 62 + err := c.cc.Invoke(ctx, SourcegraphIndexserverService_Delete_FullMethodName, in, out, opts...) 63 + if err != nil { 64 + return nil, err 65 + } 66 + return out, nil 67 + } 68 + 69 + func (c *sourcegraphIndexserverServiceClient) Index(ctx context.Context, in *IndexRequest, opts ...grpc.CallOption) (*IndexResponse, error) { 70 + out := new(IndexResponse) 71 + err := c.cc.Invoke(ctx, SourcegraphIndexserverService_Index_FullMethodName, in, out, opts...) 72 + if err != nil { 73 + return nil, err 74 + } 75 + return out, nil 76 + } 77 + 51 78 // SourcegraphIndexserverServiceServer is the server API for SourcegraphIndexserverService service. 52 79 // All implementations must embed UnimplementedSourcegraphIndexserverServiceServer 53 80 // for forward compatibility ··· 55 82 // DeleteAllData deletes all data for the tenant in the request context. 56 83 // This is used for pruning all data after a tenant has been deleted. 57 84 DeleteAllData(context.Context, *DeleteAllDataRequest) (*DeleteAllDataResponse, error) 85 + // Delete deletes the index for a specific repository. 86 + // This is used when a repository needs to be reindexed from scratch or when it's deleted. 87 + Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) 88 + // Index indexes a repository with the given options and returns the repository information 89 + // including the index timestamp. This information is needed by the frontend to update its state 90 + // since Zoekt no longer sends status updates to Sourcegraph. 91 + Index(context.Context, *IndexRequest) (*IndexResponse, error) 58 92 mustEmbedUnimplementedSourcegraphIndexserverServiceServer() 59 93 } 60 94 ··· 64 98 65 99 func (UnimplementedSourcegraphIndexserverServiceServer) DeleteAllData(context.Context, *DeleteAllDataRequest) (*DeleteAllDataResponse, error) { 66 100 return nil, status.Errorf(codes.Unimplemented, "method DeleteAllData not implemented") 101 + } 102 + func (UnimplementedSourcegraphIndexserverServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) { 103 + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") 104 + } 105 + func (UnimplementedSourcegraphIndexserverServiceServer) Index(context.Context, *IndexRequest) (*IndexResponse, error) { 106 + return nil, status.Errorf(codes.Unimplemented, "method Index not implemented") 67 107 } 68 108 func (UnimplementedSourcegraphIndexserverServiceServer) mustEmbedUnimplementedSourcegraphIndexserverServiceServer() { 69 109 } ··· 97 137 return interceptor(ctx, in, info, handler) 98 138 } 99 139 140 + func _SourcegraphIndexserverService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 141 + in := new(DeleteRequest) 142 + if err := dec(in); err != nil { 143 + return nil, err 144 + } 145 + if interceptor == nil { 146 + return srv.(SourcegraphIndexserverServiceServer).Delete(ctx, in) 147 + } 148 + info := &grpc.UnaryServerInfo{ 149 + Server: srv, 150 + FullMethod: SourcegraphIndexserverService_Delete_FullMethodName, 151 + } 152 + handler := func(ctx context.Context, req interface{}) (interface{}, error) { 153 + return srv.(SourcegraphIndexserverServiceServer).Delete(ctx, req.(*DeleteRequest)) 154 + } 155 + return interceptor(ctx, in, info, handler) 156 + } 157 + 158 + func _SourcegraphIndexserverService_Index_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 159 + in := new(IndexRequest) 160 + if err := dec(in); err != nil { 161 + return nil, err 162 + } 163 + if interceptor == nil { 164 + return srv.(SourcegraphIndexserverServiceServer).Index(ctx, in) 165 + } 166 + info := &grpc.UnaryServerInfo{ 167 + Server: srv, 168 + FullMethod: SourcegraphIndexserverService_Index_FullMethodName, 169 + } 170 + handler := func(ctx context.Context, req interface{}) (interface{}, error) { 171 + return srv.(SourcegraphIndexserverServiceServer).Index(ctx, req.(*IndexRequest)) 172 + } 173 + return interceptor(ctx, in, info, handler) 174 + } 175 + 100 176 // SourcegraphIndexserverService_ServiceDesc is the grpc.ServiceDesc for SourcegraphIndexserverService service. 101 177 // It's only intended for direct use with grpc.RegisterService, 102 178 // and not to be introspected or modified (even as a copy) ··· 108 184 MethodName: "DeleteAllData", 109 185 Handler: _SourcegraphIndexserverService_DeleteAllData_Handler, 110 186 }, 187 + { 188 + MethodName: "Delete", 189 + Handler: _SourcegraphIndexserverService_Delete_Handler, 190 + }, 191 + { 192 + MethodName: "Index", 193 + Handler: _SourcegraphIndexserverService_Index_Handler, 194 + }, 111 195 }, 112 196 Streams: []grpc.StreamDesc{}, 113 - Metadata: "indexserver.proto", 197 + Metadata: "zoekt/indexserver/v1/indexserver.proto", 114 198 }
+38 -2
cmd/zoekt-sourcegraph-indexserver/index.go
··· 18 18 19 19 sglog "github.com/sourcegraph/log" 20 20 "github.com/sourcegraph/zoekt" 21 + configv1 "github.com/sourcegraph/zoekt/cmd/zoekt-sourcegraph-indexserver/grpc/protos/sourcegraph/zoekt/configuration/v1" 21 22 "github.com/sourcegraph/zoekt/index" 22 23 "github.com/sourcegraph/zoekt/internal/ctags" 23 24 "github.com/sourcegraph/zoekt/internal/tenant" ··· 180 181 timeout time.Duration 181 182 } 182 183 183 - func gitIndex(c gitIndexConfig, o *indexArgs, sourcegraph Sourcegraph, l sglog.Logger) error { 184 + func gitIndex(ctx context.Context, c gitIndexConfig, o *indexArgs, sourcegraph Sourcegraph, l sglog.Logger) error { 184 185 logger := l.Scoped("gitIndex") 185 186 186 187 if len(o.Branches) == 0 { ··· 195 196 return errors.New("findRepositoryMetadata in provided configuration was nil - a function must be provided") 196 197 } 197 198 198 - ctx, cancel := context.WithTimeout(context.Background(), c.timeout) 199 + ctx, cancel := context.WithTimeout(ctx, c.timeout) 199 200 defer cancel() 200 201 201 202 gitDir, err := tmpGitDir(o.Name) ··· 450 451 } 451 452 return dir, nil 452 453 } 454 + 455 + // FromProto converts a ZoektIndexOptions proto message into an IndexOptions struct. 456 + func (o *IndexOptions) FromProto(x *configv1.ZoektIndexOptions) { 457 + branches := make([]zoekt.RepositoryBranch, 0, len(x.Branches)) 458 + for _, b := range x.GetBranches() { 459 + branches = append(branches, zoekt.RepositoryBranch{ 460 + Name: b.GetName(), 461 + Version: b.GetVersion(), 462 + }) 463 + } 464 + 465 + languageMap := make(map[string]ctags.CTagsParserType) 466 + for _, lang := range x.GetLanguageMap() { 467 + languageMap[lang.GetLanguage()] = ctags.CTagsParserType(lang.GetCtags().Number()) 468 + } 469 + 470 + *o = IndexOptions{ 471 + RepoID: uint32(x.GetRepoId()), 472 + LargeFiles: x.GetLargeFiles(), 473 + Symbols: x.GetSymbols(), 474 + Branches: branches, 475 + Name: x.GetName(), 476 + 477 + Priority: x.GetPriority(), 478 + 479 + Public: x.GetPublic(), 480 + Fork: x.GetFork(), 481 + Archived: x.GetArchived(), 482 + 483 + LanguageMap: languageMap, 484 + ShardConcurrency: x.GetShardConcurrency(), 485 + 486 + TenantID: int(x.TenantId), 487 + } 488 + }
+2 -2
cmd/zoekt-sourcegraph-indexserver/index_test.go
··· 530 530 findRepositoryMetadata: findRepositoryMetadata, 531 531 } 532 532 533 - if err := gitIndex(c, &tc.args, sourcegraphNop{}, logtest.Scoped(t)); err != nil { 533 + if err := gitIndex(context.Background(), c, &tc.args, sourcegraphNop{}, logtest.Scoped(t)); err != nil { 534 534 t.Fatal(err) 535 535 } 536 536 if !cmp.Equal(got, tc.want) { ··· 706 706 findRepositoryMetadata: findRepositoryMetadata, 707 707 } 708 708 709 - if err := gitIndex(c, &tc.args, sourcegraphNop{}, logtest.Scoped(t)); err != nil { 709 + if err := gitIndex(context.Background(), c, &tc.args, sourcegraphNop{}, logtest.Scoped(t)); err != nil { 710 710 t.Fatal(err) 711 711 } 712 712 if !cmp.Equal(got, tc.want) {
+271 -16
cmd/zoekt-sourcegraph-indexserver/main.go
··· 35 35 "os" 36 36 "os/exec" 37 37 "os/signal" 38 + "path" 38 39 "path/filepath" 39 40 "runtime" 41 + "slices" 40 42 "sort" 41 43 "strconv" 42 44 "strings" ··· 64 66 "github.com/sourcegraph/zoekt/internal/profiler" 65 67 "github.com/sourcegraph/zoekt/internal/tenant" 66 68 67 - "slices" 68 - 69 69 "go.uber.org/automaxprocs/maxprocs" 70 70 "go.uber.org/multierr" 71 71 "golang.org/x/net/trace" ··· 74 74 "google.golang.org/grpc/codes" 75 75 "google.golang.org/grpc/credentials/insecure" 76 76 "google.golang.org/grpc/metadata" 77 + "google.golang.org/grpc/status" 77 78 ) 78 79 79 80 var ( ··· 193 194 logger sglog.Logger 194 195 195 196 Sourcegraph Sourcegraph 196 - BatchSize int 197 + 198 + // rootURL is the root URL of the Sourcegraph instance. 199 + rootURL *url.URL 200 + 201 + BatchSize int 197 202 198 203 // IndexDir is the index directory to use. 199 204 IndexDir string 200 205 201 206 // IndexConcurrency is the number of repositories we index at once. 202 207 IndexConcurrency int 208 + 209 + // indexSemaphore limits the number of concurrent index operations 210 + indexSemaphore chan struct{} 203 211 204 212 // Interval is how often we sync with Sourcegraph. 205 213 Interval time.Duration ··· 346 354 // pauseFileName if present in IndexDir will stop index jobs from 347 355 // running. This is to make it possible to experiment with the content of the 348 356 // IndexDir without the indexserver writing to it. 349 - const pauseFileName = "PAUSE" 357 + const ( 358 + pauseFileName = "PAUSE" 359 + pauseEnvVar = "SRC_PAUSE_INDEXING" 360 + ) 361 + 362 + // isIndexingPaused checks if indexing should be paused based on either: 363 + // 1. The presence of a PAUSE file in the index directory 364 + // 2. The SRC_PAUSE_INDEXING environment variable being set to true 365 + func isIndexingPaused(indexDir string) (bool, string) { 366 + // Check for PAUSE file first 367 + if b, err := os.ReadFile(filepath.Join(indexDir, pauseFileName)); err == nil { 368 + return true, fmt.Sprintf("indexserver manually paused via PAUSE file: %s", string(bytes.TrimSpace(b))) 369 + } 370 + 371 + // Then check environment variable 372 + if getEnvWithDefaultBool(pauseEnvVar, false) { 373 + return true, fmt.Sprintf("indexserver paused via %s environment variable", pauseEnvVar) 374 + } 375 + 376 + return false, "" 377 + } 350 378 351 379 // Run the sync loop. This blocks forever. 352 380 func (s *Server) Run() { ··· 356 384 go func() { 357 385 // We update the list of indexed repos every Interval. To speed up manual 358 386 // testing we also listen for SIGUSR1 to trigger updates. 359 - // 360 387 // "pkill -SIGUSR1 zoekt-sourcegra" 361 388 for range jitterTicker(s.Interval, unix.SIGUSR1) { 362 - if b, err := os.ReadFile(filepath.Join(s.IndexDir, pauseFileName)); err == nil { 363 - infoLog.Printf("indexserver manually paused via PAUSE file: %s", string(bytes.TrimSpace(b))) 389 + if paused, msg := isIndexingPaused(s.IndexDir); paused { 390 + infoLog.Printf(msg) 364 391 continue 365 392 } 366 393 ··· 448 475 449 476 func (s *Server) processQueue() { 450 477 for { 451 - if _, err := os.Stat(filepath.Join(s.IndexDir, pauseFileName)); err == nil { 478 + if paused, _ := isIndexingPaused(s.IndexDir); paused { 452 479 time.Sleep(time.Second) 453 480 continue 454 481 } ··· 467 494 // recording time taken while merging/cleanup runs. 468 495 start := time.Now() 469 496 470 - state, err := s.Index(args) 497 + state, err := s.index(context.Background(), args) 471 498 472 499 elapsed := time.Since(start) 473 500 metricIndexDuration.WithLabelValues(string(state), repoNameForMetric(opts.Name)).Observe(elapsed.Seconds()) ··· 569 596 } 570 597 571 598 // Index starts an index job for repo name at commit. 572 - func (s *Server) Index(args *indexArgs) (state indexState, err error) { 599 + func (s *Server) index(ctx context.Context, args *indexArgs) (state indexState, err error) { 573 600 tr := trace.New("index", args.Name) 574 601 tr.SetMaxEvents(30) // Ensure we capture all indexing events 575 602 ··· 651 678 timeout: s.timeout, 652 679 } 653 680 654 - err = gitIndex(c, args, s.Sourcegraph, s.logger) 681 + err = gitIndex(ctx, c, args, s.Sourcegraph, s.logger) 655 682 if err != nil { 656 683 return indexStateFail, err 657 684 } ··· 834 861 http.Error(w, err.Error(), http.StatusBadRequest) 835 862 return 836 863 } 837 - indexMsg, _ = s.forceIndex(uint32(id)) 864 + indexMsg, _ = s.forceIndex(r.Context(), uint32(id)) 838 865 } 839 866 840 867 // ?show_repos= ··· 889 916 return 890 917 } 891 918 892 - go func() { s.forceIndex(uint32(id)) }() 919 + go func() { s.forceIndex(r.Context(), uint32(id)) }() 893 920 894 921 // 202 Accepted 895 922 w.WriteHeader(http.StatusAccepted) ··· 1021 1048 1022 1049 // forceIndex will run the index job for repo name now. It will return always 1023 1050 // return a string explaining what it did, even if it failed. 1024 - func (s *Server) forceIndex(id uint32) (string, error) { 1051 + func (s *Server) forceIndex(ctx context.Context, id uint32) (string, error) { 1025 1052 var opts IndexOptions 1026 1053 var err error 1027 1054 s.Sourcegraph.ForceIterateIndexOptions(func(o IndexOptions) { ··· 1038 1065 1039 1066 var state indexState 1040 1067 ran := s.muIndexDir.With(opts.Name, func() { 1041 - state, err = s.Index(args) 1068 + state, err = s.index(ctx, args) 1042 1069 }) 1043 1070 if !ran { 1044 1071 return fmt.Sprintf("index job for repository already running: %s", args), nil ··· 1049 1076 return fmt.Sprintf("Indexed %s with state %s", args.String(), state), nil 1050 1077 } 1051 1078 1079 + // Index implements the gRPC method for indexing a repository. If the repository 1080 + // exists in the trash, it will attempt to recover it before indexing. The 1081 + // method returns metadata about the indexed repository including branches and 1082 + // and the time of indexing. The metadata might be empty if we fail to read the 1083 + // metadata after the index or if the repository is empty. 1084 + // 1085 + // Possible GRPC error codes: 1086 + // - InvalidArgument: returned when the index options are missing or invalid 1087 + // - AlreadyExists: returned when the repository is already being indexed by another process 1088 + // - Internal: returned when indexing fails 1089 + // - Canceled: returned when the context is canceled while waiting for an index slot 1090 + func (s *Server) Index(ctx context.Context, req *indexserverv1.IndexRequest) (*indexserverv1.IndexResponse, error) { 1091 + return s.indexGRPC(ctx, req, s.index) 1092 + } 1093 + 1094 + // indexGRPC takes an index func which is used for testing. For production GRPC calls, use 1095 + // Server.Index instead 1096 + func (s *Server) indexGRPC(ctx context.Context, req *indexserverv1.IndexRequest, indexFunc func(ctx context.Context, args *indexArgs) (indexState, error)) (*indexserverv1.IndexResponse, error) { 1097 + // Validate request 1098 + if req.Options == nil { 1099 + return nil, status.Error(codes.InvalidArgument, "index options are required") 1100 + } 1101 + 1102 + // Try to acquire semaphore, but respect context cancellation 1103 + select { 1104 + case s.indexSemaphore <- struct{}{}: 1105 + defer func() { <-s.indexSemaphore }() 1106 + case <-ctx.Done(): 1107 + return nil, status.Error(codes.Canceled, "context canceled while waiting for index slot") 1108 + case <-time.After(s.timeout): 1109 + return nil, status.Error(codes.DeadlineExceeded, "timed out while waiting for index slot") 1110 + } 1111 + 1112 + var opts IndexOptions 1113 + opts.FromProto(req.Options) 1114 + opts.CloneURL = s.rootURL.ResolveReference(&url.URL{Path: path.Join("/.internal/git", req.Options.Name)}).String() 1115 + args := s.indexArgs(opts) 1116 + 1117 + // Recover the index from the trash if possible. First we have to make sure 1118 + // the shard doesn't exist in the index dir, because it might potentially be 1119 + // overwritten if we recover a shard from the trash. If we can find a shard 1120 + // in the index dir, we skip recovery. In both cases we continue and let the 1121 + // index process figure out whether the shard is up-to-date or requires a 1122 + // reindex. 1123 + if _, _, ok, err := args.BuildOptions().FindRepositoryMetadata(); err == nil && !ok { 1124 + if s.recoverFromTrash(opts.RepoID) { 1125 + infoLog.Printf("restored repository %d from trash", opts.RepoID) 1126 + } 1127 + } 1128 + 1129 + // Index the repository. 1130 + var indexErr error 1131 + var indexTimeUnix int64 1132 + var zoektRepo *zoekt.Repository 1133 + 1134 + ran := s.muIndexDir.With(opts.Name, func() { 1135 + // only record time taken once we hold the lock. This avoids us 1136 + // recording time taken while merging/cleanup runs. 1137 + start := time.Now() 1138 + 1139 + var state indexState 1140 + state, indexErr = indexFunc(ctx, args) 1141 + elapsed := time.Since(start) 1142 + metricIndexDuration.WithLabelValues(string(state), repoNameForMetric(opts.Name)).Observe(elapsed.Seconds()) 1143 + 1144 + if indexErr != nil { 1145 + errorLog.Printf("error indexing %s: %s", args.String(), indexErr) 1146 + indexErr = status.Errorf(codes.Internal, "failed to index repository: %v", indexErr) 1147 + return 1148 + } 1149 + 1150 + readMetadata := func(args *indexArgs) (*zoekt.Repository, int64, error) { 1151 + repo, metadata, ok, err := args.BuildOptions().FindRepositoryMetadata() 1152 + if err != nil || !ok { 1153 + return nil, 0, fmt.Errorf("failed to read metadata for %s: %w", args.String(), err) 1154 + } 1155 + return repo, metadata.IndexTime.Unix(), nil 1156 + } 1157 + 1158 + switch state { 1159 + case indexStateSuccess: 1160 + zoektRepo, indexTimeUnix, indexErr = readMetadata(args) 1161 + if indexErr != nil { 1162 + return 1163 + } 1164 + var branches []string 1165 + for _, b := range zoektRepo.Branches { 1166 + branches = append(branches, fmt.Sprintf("%s=%s", b.Name, b.Version)) 1167 + } 1168 + s.logger.Info("updated index", 1169 + sglog.Int("tenant", args.TenantID), 1170 + sglog.String("repo", args.Name), 1171 + sglog.Uint32("id", args.RepoID), 1172 + sglog.Strings("branches", branches), 1173 + sglog.Duration("duration", elapsed), 1174 + ) 1175 + case indexStateSuccessMeta: 1176 + zoektRepo, indexTimeUnix, indexErr = readMetadata(args) 1177 + if indexErr != nil { 1178 + return 1179 + } 1180 + infoLog.Printf("updated meta %s in %v", args.String(), elapsed) 1181 + case indexStateNoop: 1182 + zoektRepo, indexTimeUnix, indexErr = readMetadata(args) 1183 + if indexErr != nil { 1184 + return 1185 + } 1186 + case indexStateEmpty: 1187 + zoektRepo = &zoekt.Repository{ 1188 + ID: args.RepoID, 1189 + } 1190 + case indexStateFail: 1191 + // This should never happen, because indexStateFail implies 1192 + // indexErr!=nil and we exit early, but we'll handle it gracefully 1193 + // just in case. 1194 + indexErr = status.Error(codes.Internal, "failed to index repository") 1195 + // Repository exists but is empty, return OK with empty response 1196 + default: 1197 + indexErr = status.Errorf(codes.Internal, "unknown index state: %s", state) 1198 + } 1199 + }) 1200 + 1201 + if !ran { 1202 + // Someone else is processing the repository. 1203 + debugLog.Printf("index job for repository already running: %s", args) 1204 + return nil, status.Error(codes.AlreadyExists, "repository is already being indexed") 1205 + } 1206 + 1207 + if indexErr != nil { 1208 + return nil, indexErr 1209 + } 1210 + 1211 + if zoektRepo == nil { 1212 + // This should never happen, because zoektRepo=nil means we either 1213 + // failed to index or failed to read the metadata, both of which yield 1214 + // indexErr!=nil. 1215 + return nil, status.Error(codes.Internal, fmt.Sprintf("unexpected error: zoektRepo is nil for options %+v", opts)) 1216 + } 1217 + 1218 + // Convert branches to proto format 1219 + repoBranchesProto := make([]*configv1.ZoektRepositoryBranch, len(zoektRepo.Branches)) 1220 + for i, b := range zoektRepo.Branches { 1221 + repoBranchesProto[i] = &configv1.ZoektRepositoryBranch{ 1222 + Name: b.Name, 1223 + Version: b.Version, 1224 + } 1225 + } 1226 + 1227 + return &indexserverv1.IndexResponse{ 1228 + RepoId: zoektRepo.ID, 1229 + Branches: repoBranchesProto, 1230 + IndexTimeUnix: indexTimeUnix, 1231 + }, nil 1232 + } 1233 + 1234 + // recoverFromTrash attempts to recover an index from the trash or tombstones. 1235 + // It returns true if the repository was recovered. 1236 + func (s *Server) recoverFromTrash(repoID uint32) bool { 1237 + trashShards := getShards(filepath.Join(s.IndexDir, ".trash")) 1238 + if shards, ok := trashShards[repoID]; ok { 1239 + moveAll(s.IndexDir, shards) 1240 + return true 1241 + } 1242 + 1243 + tombstones := getTombstonedRepos(s.IndexDir) 1244 + if tombstone, ok := tombstones[repoID]; ok { 1245 + if err := index.UnsetTombstone(tombstone.Path, repoID); err == nil { 1246 + return true 1247 + } 1248 + } 1249 + 1250 + return false 1251 + } 1252 + 1253 + // Delete implements the gRPC method for deleting a repository. It moves the 1254 + // simple shards to the trash dir and tombstones repos in compound shards. 1255 + func (s *Server) Delete(ctx context.Context, req *indexserverv1.DeleteRequest) (*indexserverv1.DeleteResponse, error) { 1256 + var err error 1257 + 1258 + // Run the delete operation in a goroutine to be able to respond to context 1259 + // cancellation while waiting for the lock. 1260 + done := make(chan struct{}) 1261 + go func() { 1262 + defer close(done) 1263 + s.muIndexDir.Global(func() { 1264 + indexShards := getShards(s.IndexDir) 1265 + for _, repoID := range req.RepoIds { 1266 + if ctx.Err() != nil { 1267 + err = status.Error(codes.Canceled, "context canceled") 1268 + return 1269 + } 1270 + 1271 + if shards, ok := indexShards[repoID]; ok { 1272 + simple := shards[:0] 1273 + for _, shardItem := range shards { 1274 + if s.shardMerging && maybeSetTombstone([]shard{shardItem}, repoID) { 1275 + continue 1276 + } 1277 + 1278 + simple = append(simple, shardItem) 1279 + } 1280 + 1281 + if len(simple) == 0 { 1282 + continue 1283 + } 1284 + 1285 + moveAll(filepath.Join(s.IndexDir, ".trash"), simple) 1286 + } 1287 + } 1288 + }) 1289 + }() 1290 + 1291 + select { 1292 + case <-done: 1293 + if err != nil { 1294 + return nil, err 1295 + } 1296 + case <-ctx.Done(): 1297 + return nil, status.Error(codes.Canceled, "context canceled") 1298 + case <-time.After(s.timeout): 1299 + return nil, status.Error(codes.DeadlineExceeded, "timed out while waiting for delete operation to complete") 1300 + } 1301 + 1302 + return &indexserverv1.DeleteResponse{}, nil 1303 + } 1304 + 1052 1305 // DeleteAllData deletes all shards in the index and trash dir belonging to the 1053 1306 // tenant associated with the request. The deletion is best-effort, which means 1054 1307 // we will delete as much as possible. If no error is returned, the caller can ··· 1547 1800 1548 1801 return &Server{ 1549 1802 logger: logger, 1803 + rootURL: rootURL, 1550 1804 Sourcegraph: sg, 1551 1805 IndexDir: conf.index, 1552 1806 IndexConcurrency: int(conf.indexConcurrency), ··· 1565 1819 minSizeBytes: conf.minSize * 1024 * 1024, 1566 1820 minAgeDays: conf.minAgeDays, 1567 1821 }, 1568 - timeout: indexingTimeout, 1822 + timeout: indexingTimeout, 1823 + indexSemaphore: make(chan struct{}, int(conf.indexConcurrency)), 1569 1824 }, err 1570 1825 } 1571 1826
+198 -9
cmd/zoekt-sourcegraph-indexserver/main_test.go
··· 9 9 "net/url" 10 10 "os" 11 11 "path/filepath" 12 + "slices" 12 13 "strings" 13 14 "testing" 15 + "time" 14 16 17 + "github.com/google/go-cmp/cmp" 15 18 sglog "github.com/sourcegraph/log" 16 19 "github.com/sourcegraph/log/logtest" 17 - "github.com/stretchr/testify/require" 18 - "github.com/xeipuuv/gojsonschema" 19 - "google.golang.org/grpc" 20 - 21 - "github.com/google/go-cmp/cmp" 22 - 23 - "slices" 24 - 25 20 "github.com/sourcegraph/zoekt" 26 21 configv1 "github.com/sourcegraph/zoekt/cmd/zoekt-sourcegraph-indexserver/grpc/protos/sourcegraph/zoekt/configuration/v1" 22 + indexserverv1 "github.com/sourcegraph/zoekt/cmd/zoekt-sourcegraph-indexserver/grpc/protos/zoekt/indexserver/v1" 23 + "github.com/sourcegraph/zoekt/index" 27 24 "github.com/sourcegraph/zoekt/internal/tenant" 25 + "github.com/stretchr/testify/require" 26 + "github.com/xeipuuv/gojsonschema" 27 + "google.golang.org/grpc" 28 + "google.golang.org/grpc/codes" 29 + "google.golang.org/grpc/status" 28 30 ) 29 31 30 32 func TestServer_defaultArgs(t *testing.T) { ··· 56 58 57 59 func TestIndexNoTenant(t *testing.T) { 58 60 s := &Server{} 59 - _, err := s.Index(&indexArgs{}) 61 + _, err := s.index(context.Background(), &indexArgs{}) 60 62 require.ErrorIs(t, err, tenant.ErrMissingTenant) 61 63 } 62 64 ··· 448 450 }) 449 451 } 450 452 } 453 + 454 + func TestIndexGRPC(t *testing.T) { 455 + indexDir := t.TempDir() 456 + 457 + // Minimal server setup 458 + s := &Server{ 459 + logger: logtest.NoOp(t), 460 + IndexDir: indexDir, 461 + rootURL: &url.URL{Scheme: "http", Host: "example.com"}, 462 + indexSemaphore: make(chan struct{}, 1), 463 + timeout: time.Hour, // no timeout 464 + } 465 + 466 + branches := []*configv1.ZoektRepositoryBranch{ 467 + { 468 + Name: "HEAD", 469 + Version: "abc123", 470 + }, 471 + } 472 + 473 + req := &indexserverv1.IndexRequest{ 474 + Options: &configv1.ZoektIndexOptions{ 475 + RepoId: 42, 476 + Name: "repo", 477 + TenantId: 1, 478 + Branches: branches, 479 + }, 480 + } 481 + 482 + resp, err := s.indexGRPC(context.Background(), req, mockIndexFunc(t)) 483 + require.NoError(t, err) 484 + require.Equal(t, &indexserverv1.IndexResponse{ 485 + RepoId: 42, 486 + Branches: branches, 487 + IndexTimeUnix: resp.IndexTimeUnix, // Hack: this changes every time so we don't check it 488 + }, resp) 489 + 490 + require.NotZero(t, resp.IndexTimeUnix) 491 + } 492 + 493 + func TestIndexGRPC_Timeout(t *testing.T) { 494 + indexDir := t.TempDir() 495 + 496 + s := &Server{ 497 + logger: logtest.NoOp(t), 498 + IndexDir: indexDir, 499 + IndexConcurrency: 0, // impossible to acquire index slot 500 + timeout: time.Millisecond, 501 + } 502 + 503 + req := &indexserverv1.IndexRequest{ 504 + Options: &configv1.ZoektIndexOptions{ 505 + RepoId: 42, 506 + Name: "repo", 507 + }, 508 + } 509 + 510 + // use context.Background() to make sure we don't return because of context cancellation 511 + _, err := s.indexGRPC(context.Background(), req, mockIndexFunc(t)) 512 + require.Error(t, err) 513 + require.Equal(t, codes.DeadlineExceeded, status.Code(err)) 514 + } 515 + 516 + func TestDelete(t *testing.T) { 517 + indexDir := t.TempDir() 518 + trashDir := filepath.Join(indexDir, ".trash") 519 + if err := os.MkdirAll(trashDir, 0o755); err != nil { 520 + t.Fatal(err) 521 + } 522 + 523 + // Create a simple shard 524 + createShard(t, indexDir) 525 + 526 + // Verify the shard exists in index dir 527 + shards := getShards(indexDir) 528 + if len(shards) != 1 { 529 + t.Fatalf("expected 1 shard, got %d", len(shards)) 530 + } 531 + 532 + // Create server and call Delete 533 + s := &Server{ 534 + logger: logtest.NoOp(t), 535 + IndexDir: indexDir, 536 + rootURL: &url.URL{Scheme: "http", Host: "example.com"}, 537 + indexSemaphore: make(chan struct{}, 1), 538 + timeout: time.Hour, // no timeout 539 + } 540 + 541 + req := &indexserverv1.DeleteRequest{ 542 + RepoIds: []uint32{42}, // matches the repo ID in createShard 543 + } 544 + 545 + // Test case: context is canceled 546 + cancledCtx, cancel := context.WithCancel(context.Background()) 547 + cancel() 548 + _, err := s.Delete(cancledCtx, req) 549 + require.Error(t, err) 550 + 551 + shards = getShards(indexDir) 552 + require.Len(t, shards, 1) 553 + 554 + // Test case: context is not canceled 555 + _, err = s.Delete(context.Background(), req) 556 + require.NoError(t, err) 557 + 558 + // Verify shard was moved to trash 559 + trashShards := getShards(trashDir) 560 + require.Len(t, trashShards, 1) 561 + 562 + // Verify shard is no longer in index dir 563 + shards = getShards(indexDir) 564 + require.Len(t, shards, 0) 565 + } 566 + 567 + func mockIndexFunc(t *testing.T) func(ctx context.Context, args *indexArgs) (indexState, error) { 568 + return func(ctx context.Context, args *indexArgs) (indexState, error) { 569 + createShard(t, args.IndexDir) 570 + return indexStateSuccess, nil 571 + } 572 + } 573 + 574 + func createShard(t *testing.T, dir string) { 575 + opts := index.Options{ 576 + IndexDir: dir, 577 + RepositoryDescription: zoekt.Repository{ 578 + ID: 42, 579 + Name: "repo", 580 + Branches: []zoekt.RepositoryBranch{ 581 + { 582 + Name: "HEAD", 583 + Version: "abc123", 584 + }, 585 + }, 586 + }, 587 + } 588 + 589 + b, err := index.NewBuilder(opts) 590 + require.NoError(t, err) 591 + require.NoError(t, b.AddFile("test.txt", []byte("hello"))) 592 + require.NoError(t, b.Finish()) 593 + } 594 + 595 + func TestRecoverFromTrash(t *testing.T) { 596 + dir := t.TempDir() 597 + trashDir := filepath.Join(dir, ".trash") 598 + require.NoError(t, os.MkdirAll(trashDir, 0o755)) 599 + 600 + // Create a simple shard in trash 601 + createTestShard(t, "repo1", 1, filepath.Join(trashDir, "repo1.zoekt")) 602 + 603 + // Create a compound shard with two repos, one of them tombstoned 604 + cs := createCompoundShard(t, dir, []uint32{2, 3}) 605 + require.NoError(t, index.SetTombstone(cs, 2)) 606 + 607 + s := &Server{ 608 + IndexDir: dir, 609 + } 610 + 611 + // Test recovering from trash 612 + recovered := s.recoverFromTrash(1) 613 + require.True(t, recovered, "should have recovered repo1 from trash") 614 + 615 + // Verify shard was moved from trash to index 616 + indexShards := getShards(dir) 617 + trashShards := getShards(trashDir) 618 + 619 + require.Contains(t, indexShards, uint32(1), "repo1 should be in index") 620 + require.NotContains(t, trashShards, uint32(1), "repo1 should not be in trash") 621 + 622 + // Test unsetting tombstone 623 + recovered = s.recoverFromTrash(2) 624 + require.True(t, recovered, "should have recovered repo2 from tombstone") 625 + 626 + // Verify tombstone was unset 627 + repos, _, err := index.ReadMetadataPath(cs) 628 + require.NoError(t, err) 629 + 630 + for _, repo := range repos { 631 + if repo.ID == 2 { 632 + require.False(t, repo.Tombstone, "repo2 should not be tombstoned") 633 + } 634 + } 635 + 636 + // Test non-existent repo 637 + recovered = s.recoverFromTrash(99) 638 + require.False(t, recovered, "should not have recovered non-existent repo") 639 + }
+1 -35
cmd/zoekt-sourcegraph-indexserver/sg.go
··· 22 22 23 23 "github.com/sourcegraph/zoekt" 24 24 configv1 "github.com/sourcegraph/zoekt/cmd/zoekt-sourcegraph-indexserver/grpc/protos/sourcegraph/zoekt/configuration/v1" 25 - "github.com/sourcegraph/zoekt/internal/ctags" 26 25 ) 27 26 28 27 // SourcegraphListResult is the return value of Sourcegraph.List. It is its ··· 269 268 } 270 269 271 270 func (o *indexOptionsItem) FromProto(x *configv1.ZoektIndexOptions) { 272 - branches := make([]zoekt.RepositoryBranch, 0, len(x.Branches)) 273 - for _, b := range x.GetBranches() { 274 - branches = append(branches, zoekt.RepositoryBranch{ 275 - Name: b.GetName(), 276 - Version: b.GetVersion(), 277 - }) 278 - } 279 - 280 271 item := indexOptionsItem{} 281 - languageMap := make(map[string]ctags.CTagsParserType) 282 - 283 - for _, lang := range x.GetLanguageMap() { 284 - languageMap[lang.GetLanguage()] = ctags.CTagsParserType(lang.GetCtags().Number()) 285 - } 286 - 287 - item.IndexOptions = IndexOptions{ 288 - RepoID: uint32(x.GetRepoId()), 289 - LargeFiles: x.GetLargeFiles(), 290 - Symbols: x.GetSymbols(), 291 - Branches: branches, 292 - Name: x.GetName(), 293 - 294 - Priority: x.GetPriority(), 295 - 296 - Public: x.GetPublic(), 297 - Fork: x.GetFork(), 298 - Archived: x.GetArchived(), 299 - 300 - LanguageMap: languageMap, 301 - ShardConcurrency: x.GetShardConcurrency(), 302 - 303 - TenantID: int(x.TenantId), 304 - } 305 - 272 + item.IndexOptions.FromProto(x) 306 273 item.Error = x.GetError() 307 - 308 274 *o = item 309 275 } 310 276