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

Configure Feed

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

Add a gRPC API (#577)

This adds a gRPC API alongside the existing gob API.

It is enabled whenever the RPC setting is enabled. I didn't think it made sense to have a separate setting to enable it. It is only used when a gRPC request is detected (Content-Type: application/grpc). Eventually, we should likely open a separate port for gRPC traffic, but this should be okay for now.

In order to minimize the footprint of this change, we only use the protobuf definitions in the RPC layer. They are translated to/from the existing go types. This results in a small perf penalty.

+7690 -7
+8
BUILD.bazel
··· 21 21 name = "zoekt", 22 22 srcs = [ 23 23 "api.go", 24 + "api_proto.go", 24 25 "bits.go", 25 26 "btree.go", 26 27 "contentprovider.go", ··· 45 46 importpath = "github.com/sourcegraph/zoekt", 46 47 visibility = ["//visibility:public"], 47 48 deps = [ 49 + "//grpc/v1:grpc", 48 50 "//query", 49 51 "@com_github_edsrzf_mmap_go//:mmap-go", 50 52 "@com_github_go_enry_go_enry_v2//:go-enry", 51 53 "@com_github_go_enry_go_enry_v2//data", 52 54 "@com_github_grafana_regexp//:regexp", 53 55 "@com_github_rs_xid//:xid", 56 + "@org_golang_google_protobuf//types/known/durationpb", 57 + "@org_golang_google_protobuf//types/known/timestamppb", 54 58 ] + select({ 55 59 "@io_bazel_rules_go//go/platform:aix": [ 56 60 "@org_golang_x_sys//unix", ··· 98 102 go_test( 99 103 name = "zoekt_test", 100 104 srcs = [ 105 + "api_proto_test.go", 101 106 "api_test.go", 102 107 "bits_test.go", 103 108 "btree_test.go", ··· 114 119 ], 115 120 data = [":testdata"], 116 121 embed = [":zoekt"], 122 + embedsrcs = ["//testdata:search_result_1.pb"], #keep 117 123 deps = [ 124 + "//grpc/v1:grpc", 118 125 "//query", 119 126 "@com_github_google_go_cmp//cmp", 120 127 "@com_github_google_go_cmp//cmp/cmpopts", 121 128 "@com_github_grafana_regexp//:regexp", 122 129 "@com_github_kylelemons_godebug//pretty", 123 130 "@com_github_roaringbitmap_roaring//:roaring", 131 + "@org_golang_google_protobuf//proto", 124 132 ], 125 133 )
+1 -1
WORKSPACE
··· 49 49 50 50 # Go toolchain setup 51 51 load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") 52 - load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") 52 + load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") 53 53 load("//:deps.bzl", "go_dependencies") 54 54 55 55 # gazelle:repository_macro deps.bzl%go_dependencies
+1 -1
api.go
··· 525 525 526 526 // Repository holds repository metadata. 527 527 type Repository struct { 528 - // Sourcergaph's repository ID 528 + // Sourcegraph's repository ID 529 529 ID uint32 530 530 531 531 // The repository name
+723
api_proto.go
··· 1 + // Copyright 2016 Google Inc. All rights reserved. 2 + // 3 + // Licensed under the Apache License, Version 2.0 (the "License"); 4 + // you may not use this file except in compliance with the License. 5 + // You may obtain a copy of the License at 6 + // 7 + // http://www.apache.org/licenses/LICENSE-2.0 8 + // 9 + // Unless required by applicable law or agreed to in writing, software 10 + // distributed under the License is distributed on an "AS IS" BASIS, 11 + // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 + // See the License for the specific language governing permissions and 13 + // limitations under the License. 14 + 15 + package zoekt // import "github.com/sourcegraph/zoekt" 16 + 17 + import ( 18 + "math/rand" 19 + "reflect" 20 + 21 + proto "github.com/sourcegraph/zoekt/grpc/v1" 22 + "google.golang.org/protobuf/types/known/durationpb" 23 + "google.golang.org/protobuf/types/known/timestamppb" 24 + ) 25 + 26 + func FileMatchFromProto(p *proto.FileMatch) FileMatch { 27 + lineMatches := make([]LineMatch, len(p.GetLineMatches())) 28 + for i, lineMatch := range p.GetLineMatches() { 29 + lineMatches[i] = LineMatchFromProto(lineMatch) 30 + } 31 + 32 + chunkMatches := make([]ChunkMatch, len(p.GetChunkMatches())) 33 + for i, chunkMatch := range p.GetChunkMatches() { 34 + chunkMatches[i] = ChunkMatchFromProto(chunkMatch) 35 + } 36 + 37 + return FileMatch{ 38 + Score: p.GetScore(), 39 + Debug: p.GetDebug(), 40 + FileName: p.GetFileName(), 41 + Repository: p.GetRepository(), 42 + Branches: p.GetBranches(), 43 + LineMatches: lineMatches, 44 + ChunkMatches: chunkMatches, 45 + RepositoryID: p.GetRepositoryId(), 46 + RepositoryPriority: p.GetRepositoryPriority(), 47 + Content: p.GetContent(), 48 + Checksum: p.GetChecksum(), 49 + Language: p.GetLanguage(), 50 + SubRepositoryName: p.GetSubRepositoryName(), 51 + SubRepositoryPath: p.GetSubRepositoryPath(), 52 + Version: p.GetVersion(), 53 + } 54 + } 55 + 56 + func (m *FileMatch) ToProto() *proto.FileMatch { 57 + lineMatches := make([]*proto.LineMatch, len(m.LineMatches)) 58 + for i, lm := range m.LineMatches { 59 + lineMatches[i] = lm.ToProto() 60 + } 61 + 62 + chunkMatches := make([]*proto.ChunkMatch, len(m.ChunkMatches)) 63 + for i, cm := range m.ChunkMatches { 64 + chunkMatches[i] = cm.ToProto() 65 + } 66 + 67 + return &proto.FileMatch{ 68 + Score: m.Score, 69 + Debug: m.Debug, 70 + FileName: m.FileName, 71 + Repository: m.Repository, 72 + Branches: m.Branches, 73 + LineMatches: lineMatches, 74 + ChunkMatches: chunkMatches, 75 + RepositoryId: m.RepositoryID, 76 + RepositoryPriority: m.RepositoryPriority, 77 + Content: m.Content, 78 + Checksum: m.Checksum, 79 + Language: m.Language, 80 + SubRepositoryName: m.SubRepositoryName, 81 + SubRepositoryPath: m.SubRepositoryPath, 82 + Version: m.Version, 83 + } 84 + } 85 + 86 + func ChunkMatchFromProto(p *proto.ChunkMatch) ChunkMatch { 87 + ranges := make([]Range, len(p.GetRanges())) 88 + for i, r := range p.GetRanges() { 89 + ranges[i] = RangeFromProto(r) 90 + } 91 + 92 + symbols := make([]*Symbol, len(p.GetSymbolInfo())) 93 + for i, r := range p.GetSymbolInfo() { 94 + symbols[i] = SymbolFromProto(r) 95 + } 96 + 97 + return ChunkMatch{ 98 + Content: p.GetContent(), 99 + ContentStart: LocationFromProto(p.GetContentStart()), 100 + FileName: p.GetFileName(), 101 + Ranges: ranges, 102 + SymbolInfo: symbols, 103 + Score: p.GetScore(), 104 + DebugScore: p.GetDebugScore(), 105 + } 106 + } 107 + 108 + func (cm *ChunkMatch) ToProto() *proto.ChunkMatch { 109 + ranges := make([]*proto.Range, len(cm.Ranges)) 110 + for i, r := range cm.Ranges { 111 + ranges[i] = r.ToProto() 112 + } 113 + 114 + symbolInfo := make([]*proto.SymbolInfo, len(cm.SymbolInfo)) 115 + for i, si := range cm.SymbolInfo { 116 + symbolInfo[i] = si.ToProto() 117 + } 118 + 119 + return &proto.ChunkMatch{ 120 + Content: cm.Content, 121 + ContentStart: cm.ContentStart.ToProto(), 122 + FileName: cm.FileName, 123 + Ranges: ranges, 124 + SymbolInfo: symbolInfo, 125 + Score: cm.Score, 126 + DebugScore: cm.DebugScore, 127 + } 128 + } 129 + 130 + func RangeFromProto(p *proto.Range) Range { 131 + return Range{ 132 + Start: LocationFromProto(p.GetStart()), 133 + End: LocationFromProto(p.GetEnd()), 134 + } 135 + } 136 + 137 + func (r *Range) ToProto() *proto.Range { 138 + return &proto.Range{ 139 + Start: r.Start.ToProto(), 140 + End: r.End.ToProto(), 141 + } 142 + } 143 + 144 + func LocationFromProto(p *proto.Location) Location { 145 + return Location{ 146 + ByteOffset: p.GetByteOffset(), 147 + LineNumber: p.GetLineNumber(), 148 + Column: p.GetColumn(), 149 + } 150 + } 151 + 152 + func (l *Location) ToProto() *proto.Location { 153 + return &proto.Location{ 154 + ByteOffset: l.ByteOffset, 155 + LineNumber: l.LineNumber, 156 + Column: l.Column, 157 + } 158 + } 159 + 160 + func LineMatchFromProto(p *proto.LineMatch) LineMatch { 161 + lineFragments := make([]LineFragmentMatch, len(p.GetLineFragments())) 162 + for i, lineFragment := range p.GetLineFragments() { 163 + lineFragments[i] = LineFragmentMatchFromProto(lineFragment) 164 + } 165 + 166 + return LineMatch{ 167 + Line: p.GetLine(), 168 + LineStart: int(p.GetLineStart()), 169 + LineEnd: int(p.GetLineEnd()), 170 + LineNumber: int(p.GetLineNumber()), 171 + Before: p.GetBefore(), 172 + After: p.GetAfter(), 173 + FileName: p.GetFileName(), 174 + Score: p.GetScore(), 175 + DebugScore: p.GetDebugScore(), 176 + LineFragments: lineFragments, 177 + } 178 + } 179 + 180 + func (lm *LineMatch) ToProto() *proto.LineMatch { 181 + fragments := make([]*proto.LineFragmentMatch, len(lm.LineFragments)) 182 + for i, fragment := range lm.LineFragments { 183 + fragments[i] = fragment.ToProto() 184 + } 185 + 186 + return &proto.LineMatch{ 187 + Line: lm.Line, 188 + LineStart: int64(lm.LineStart), 189 + LineEnd: int64(lm.LineEnd), 190 + LineNumber: int64(lm.LineNumber), 191 + Before: lm.Before, 192 + After: lm.After, 193 + FileName: lm.FileName, 194 + Score: lm.Score, 195 + DebugScore: lm.DebugScore, 196 + LineFragments: fragments, 197 + } 198 + } 199 + 200 + func SymbolFromProto(p *proto.SymbolInfo) *Symbol { 201 + if p == nil { 202 + return nil 203 + } 204 + 205 + return &Symbol{ 206 + Sym: p.GetSym(), 207 + Kind: p.GetKind(), 208 + Parent: p.GetParent(), 209 + ParentKind: p.GetParentKind(), 210 + } 211 + } 212 + 213 + func (s *Symbol) ToProto() *proto.SymbolInfo { 214 + if s == nil { 215 + return nil 216 + } 217 + 218 + return &proto.SymbolInfo{ 219 + Sym: s.Sym, 220 + Kind: s.Kind, 221 + Parent: s.Parent, 222 + ParentKind: s.ParentKind, 223 + } 224 + } 225 + 226 + func LineFragmentMatchFromProto(p *proto.LineFragmentMatch) LineFragmentMatch { 227 + return LineFragmentMatch{ 228 + LineOffset: int(p.GetLineOffset()), 229 + Offset: p.GetOffset(), 230 + MatchLength: int(p.GetMatchLength()), 231 + SymbolInfo: SymbolFromProto(p.GetSymbolInfo()), 232 + } 233 + } 234 + 235 + func (lfm *LineFragmentMatch) ToProto() *proto.LineFragmentMatch { 236 + return &proto.LineFragmentMatch{ 237 + LineOffset: int64(lfm.LineOffset), 238 + Offset: lfm.Offset, 239 + MatchLength: int64(lfm.MatchLength), 240 + SymbolInfo: lfm.SymbolInfo.ToProto(), 241 + } 242 + } 243 + 244 + func FlushReasonFromProto(p proto.FlushReason) FlushReason { 245 + switch p { 246 + case proto.FlushReason_TIMER_EXPIRED: 247 + return FlushReasonTimerExpired 248 + case proto.FlushReason_FINAL_FLUSH: 249 + return FlushReasonFinalFlush 250 + case proto.FlushReason_MAX_SIZE: 251 + return FlushReasonMaxSize 252 + default: 253 + return FlushReason(0) 254 + } 255 + } 256 + 257 + func (fr FlushReason) ToProto() proto.FlushReason { 258 + switch fr { 259 + case FlushReasonTimerExpired: 260 + return proto.FlushReason_TIMER_EXPIRED 261 + case FlushReasonFinalFlush: 262 + return proto.FlushReason_FINAL_FLUSH 263 + case FlushReasonMaxSize: 264 + return proto.FlushReason_MAX_SIZE 265 + default: 266 + return proto.FlushReason_UNKNOWN 267 + } 268 + } 269 + 270 + // Generate valid reasons for quickchecks 271 + func (fr FlushReason) Generate(rand *rand.Rand, size int) reflect.Value { 272 + switch rand.Int() % 4 { 273 + case 1: 274 + return reflect.ValueOf(FlushReasonMaxSize) 275 + case 2: 276 + return reflect.ValueOf(FlushReasonFinalFlush) 277 + case 3: 278 + return reflect.ValueOf(FlushReasonTimerExpired) 279 + default: 280 + return reflect.ValueOf(FlushReason(0)) 281 + } 282 + } 283 + 284 + func StatsFromProto(p *proto.Stats) Stats { 285 + return Stats{ 286 + ContentBytesLoaded: p.GetContentBytesLoaded(), 287 + IndexBytesLoaded: p.GetIndexBytesLoaded(), 288 + Crashes: int(p.GetCrashes()), 289 + Duration: p.GetDuration().AsDuration(), 290 + FileCount: int(p.GetFileCount()), 291 + ShardFilesConsidered: int(p.GetShardFilesConsidered()), 292 + FilesConsidered: int(p.GetFilesConsidered()), 293 + FilesLoaded: int(p.GetFilesLoaded()), 294 + FilesSkipped: int(p.GetFilesSkipped()), 295 + ShardsScanned: int(p.GetShardsScanned()), 296 + ShardsSkipped: int(p.GetShardsSkipped()), 297 + ShardsSkippedFilter: int(p.GetShardsSkippedFilter()), 298 + MatchCount: int(p.GetMatchCount()), 299 + NgramMatches: int(p.GetNgramMatches()), 300 + Wait: p.GetWait().AsDuration(), 301 + RegexpsConsidered: int(p.GetRegexpsConsidered()), 302 + FlushReason: FlushReasonFromProto(p.GetFlushReason()), 303 + } 304 + } 305 + 306 + func (s *Stats) ToProto() *proto.Stats { 307 + return &proto.Stats{ 308 + ContentBytesLoaded: s.ContentBytesLoaded, 309 + IndexBytesLoaded: s.IndexBytesLoaded, 310 + Crashes: int64(s.Crashes), 311 + Duration: durationpb.New(s.Duration), 312 + FileCount: int64(s.FileCount), 313 + ShardFilesConsidered: int64(s.ShardFilesConsidered), 314 + FilesConsidered: int64(s.FilesConsidered), 315 + FilesLoaded: int64(s.FilesLoaded), 316 + FilesSkipped: int64(s.FilesSkipped), 317 + ShardsScanned: int64(s.ShardsScanned), 318 + ShardsSkipped: int64(s.ShardsSkipped), 319 + ShardsSkippedFilter: int64(s.ShardsSkippedFilter), 320 + MatchCount: int64(s.MatchCount), 321 + NgramMatches: int64(s.NgramMatches), 322 + Wait: durationpb.New(s.Wait), 323 + RegexpsConsidered: int64(s.RegexpsConsidered), 324 + FlushReason: s.FlushReason.ToProto(), 325 + } 326 + } 327 + 328 + func ProgressFromProto(p *proto.Progress) Progress { 329 + return Progress{ 330 + Priority: p.GetPriority(), 331 + MaxPendingPriority: p.GetMaxPendingPriority(), 332 + } 333 + } 334 + 335 + func (p *Progress) ToProto() *proto.Progress { 336 + return &proto.Progress{ 337 + Priority: p.Priority, 338 + MaxPendingPriority: p.MaxPendingPriority, 339 + } 340 + } 341 + 342 + func SearchResultFromProto(p *proto.SearchResponse) *SearchResult { 343 + if p == nil { 344 + return nil 345 + } 346 + 347 + files := make([]FileMatch, len(p.GetFiles())) 348 + for i, file := range p.GetFiles() { 349 + files[i] = FileMatchFromProto(file) 350 + } 351 + 352 + return &SearchResult{ 353 + Stats: StatsFromProto(p.GetStats()), 354 + Progress: ProgressFromProto(p.GetProgress()), 355 + Files: files, 356 + RepoURLs: p.RepoUrls, 357 + LineFragments: p.LineFragments, 358 + } 359 + } 360 + 361 + func (sr *SearchResult) ToProto() *proto.SearchResponse { 362 + if sr == nil { 363 + return nil 364 + } 365 + 366 + files := make([]*proto.FileMatch, len(sr.Files)) 367 + for i, file := range sr.Files { 368 + files[i] = file.ToProto() 369 + } 370 + 371 + return &proto.SearchResponse{ 372 + Stats: sr.Stats.ToProto(), 373 + Progress: sr.Progress.ToProto(), 374 + Files: files, 375 + RepoUrls: sr.RepoURLs, 376 + LineFragments: sr.LineFragments, 377 + } 378 + } 379 + 380 + func RepositoryBranchFromProto(p *proto.RepositoryBranch) RepositoryBranch { 381 + return RepositoryBranch{ 382 + Name: p.GetName(), 383 + Version: p.GetVersion(), 384 + } 385 + 386 + } 387 + 388 + func (r *RepositoryBranch) ToProto() *proto.RepositoryBranch { 389 + return &proto.RepositoryBranch{ 390 + Name: r.Name, 391 + Version: r.Version, 392 + } 393 + } 394 + 395 + func RepositoryFromProto(p *proto.Repository) Repository { 396 + branches := make([]RepositoryBranch, len(p.GetBranches())) 397 + for i, branch := range p.GetBranches() { 398 + branches[i] = RepositoryBranchFromProto(branch) 399 + } 400 + 401 + subRepoMap := make(map[string]*Repository, len(p.GetSubRepoMap())) 402 + for name, repo := range p.GetSubRepoMap() { 403 + r := RepositoryFromProto(repo) 404 + subRepoMap[name] = &r 405 + } 406 + 407 + fileTombstones := make(map[string]struct{}, len(p.GetFileTombstones())) 408 + for _, file := range p.GetFileTombstones() { 409 + fileTombstones[file] = struct{}{} 410 + } 411 + 412 + return Repository{ 413 + ID: p.GetId(), 414 + Name: p.GetName(), 415 + URL: p.GetUrl(), 416 + Source: p.GetSource(), 417 + Branches: branches, 418 + SubRepoMap: subRepoMap, 419 + CommitURLTemplate: p.GetCommitUrlTemplate(), 420 + FileURLTemplate: p.GetFileUrlTemplate(), 421 + LineFragmentTemplate: p.GetLineFragmentTemplate(), 422 + priority: p.GetPriority(), 423 + RawConfig: p.GetRawConfig(), 424 + Rank: uint16(p.GetRank()), 425 + IndexOptions: p.GetIndexOptions(), 426 + HasSymbols: p.GetHasSymbols(), 427 + Tombstone: p.GetTombstone(), 428 + LatestCommitDate: p.GetLatestCommitDate().AsTime(), 429 + FileTombstones: fileTombstones, 430 + } 431 + } 432 + 433 + func (r *Repository) ToProto() *proto.Repository { 434 + if r == nil { 435 + return nil 436 + } 437 + 438 + branches := make([]*proto.RepositoryBranch, len(r.Branches)) 439 + for i, branch := range r.Branches { 440 + branches[i] = branch.ToProto() 441 + } 442 + 443 + subRepoMap := make(map[string]*proto.Repository, len(r.SubRepoMap)) 444 + for name, repo := range r.SubRepoMap { 445 + subRepoMap[name] = repo.ToProto() 446 + } 447 + 448 + fileTombstones := make([]string, 0, len(r.FileTombstones)) 449 + for file := range r.FileTombstones { 450 + fileTombstones = append(fileTombstones, file) 451 + } 452 + 453 + return &proto.Repository{ 454 + Id: r.ID, 455 + Name: r.Name, 456 + Url: r.URL, 457 + Source: r.Source, 458 + Branches: branches, 459 + SubRepoMap: subRepoMap, 460 + CommitUrlTemplate: r.CommitURLTemplate, 461 + FileUrlTemplate: r.FileURLTemplate, 462 + LineFragmentTemplate: r.LineFragmentTemplate, 463 + Priority: r.priority, 464 + RawConfig: r.RawConfig, 465 + Rank: uint32(r.Rank), 466 + IndexOptions: r.IndexOptions, 467 + HasSymbols: r.HasSymbols, 468 + Tombstone: r.Tombstone, 469 + LatestCommitDate: timestamppb.New(r.LatestCommitDate), 470 + FileTombstones: fileTombstones, 471 + } 472 + } 473 + 474 + func IndexMetadataFromProto(p *proto.IndexMetadata) IndexMetadata { 475 + languageMap := make(map[string]uint16, len(p.GetLanguageMap())) 476 + for language, id := range p.GetLanguageMap() { 477 + languageMap[language] = uint16(id) 478 + } 479 + 480 + return IndexMetadata{ 481 + IndexFormatVersion: int(p.GetIndexFormatVersion()), 482 + IndexFeatureVersion: int(p.GetIndexFeatureVersion()), 483 + IndexMinReaderVersion: int(p.GetIndexMinReaderVersion()), 484 + IndexTime: p.GetIndexTime().AsTime(), 485 + PlainASCII: p.GetPlainAscii(), 486 + LanguageMap: languageMap, 487 + ZoektVersion: p.GetZoektVersion(), 488 + ID: p.GetId(), 489 + } 490 + } 491 + 492 + func (m *IndexMetadata) ToProto() *proto.IndexMetadata { 493 + if m == nil { 494 + return nil 495 + } 496 + 497 + languageMap := make(map[string]uint32, len(m.LanguageMap)) 498 + for language, id := range m.LanguageMap { 499 + languageMap[language] = uint32(id) 500 + } 501 + 502 + return &proto.IndexMetadata{ 503 + IndexFormatVersion: int64(m.IndexFormatVersion), 504 + IndexFeatureVersion: int64(m.IndexFeatureVersion), 505 + IndexMinReaderVersion: int64(m.IndexMinReaderVersion), 506 + IndexTime: timestamppb.New(m.IndexTime), 507 + PlainAscii: m.PlainASCII, 508 + LanguageMap: languageMap, 509 + ZoektVersion: m.ZoektVersion, 510 + Id: m.ID, 511 + } 512 + } 513 + 514 + func RepoStatsFromProto(p *proto.RepoStats) RepoStats { 515 + return RepoStats{ 516 + Repos: int(p.GetRepos()), 517 + Shards: int(p.GetShards()), 518 + Documents: int(p.GetDocuments()), 519 + IndexBytes: p.GetIndexBytes(), 520 + ContentBytes: p.GetContentBytes(), 521 + NewLinesCount: p.GetNewLinesCount(), 522 + DefaultBranchNewLinesCount: p.GetDefaultBranchNewLinesCount(), 523 + OtherBranchesNewLinesCount: p.GetOtherBranchesNewLinesCount(), 524 + } 525 + } 526 + 527 + func (s *RepoStats) ToProto() *proto.RepoStats { 528 + return &proto.RepoStats{ 529 + Repos: int64(s.Repos), 530 + Shards: int64(s.Shards), 531 + Documents: int64(s.Documents), 532 + IndexBytes: s.IndexBytes, 533 + ContentBytes: s.ContentBytes, 534 + NewLinesCount: s.NewLinesCount, 535 + DefaultBranchNewLinesCount: s.DefaultBranchNewLinesCount, 536 + OtherBranchesNewLinesCount: s.OtherBranchesNewLinesCount, 537 + } 538 + } 539 + 540 + func RepoListEntryFromProto(p *proto.RepoListEntry) *RepoListEntry { 541 + if p == nil { 542 + return nil 543 + } 544 + 545 + return &RepoListEntry{ 546 + Repository: RepositoryFromProto(p.GetRepository()), 547 + IndexMetadata: IndexMetadataFromProto(p.GetIndexMetadata()), 548 + Stats: RepoStatsFromProto(p.GetStats()), 549 + } 550 + } 551 + 552 + func (r *RepoListEntry) ToProto() *proto.RepoListEntry { 553 + if r == nil { 554 + return nil 555 + } 556 + 557 + return &proto.RepoListEntry{ 558 + Repository: r.Repository.ToProto(), 559 + IndexMetadata: r.IndexMetadata.ToProto(), 560 + Stats: r.Stats.ToProto(), 561 + } 562 + } 563 + 564 + func MinimalRepoListEntryFromProto(p *proto.MinimalRepoListEntry) MinimalRepoListEntry { 565 + branches := make([]RepositoryBranch, len(p.GetBranches())) 566 + for i, branch := range p.GetBranches() { 567 + branches[i] = RepositoryBranchFromProto(branch) 568 + } 569 + 570 + return MinimalRepoListEntry{ 571 + HasSymbols: p.GetHasSymbols(), 572 + Branches: branches, 573 + } 574 + } 575 + 576 + func (m *MinimalRepoListEntry) ToProto() *proto.MinimalRepoListEntry { 577 + branches := make([]*proto.RepositoryBranch, len(m.Branches)) 578 + for i, branch := range m.Branches { 579 + branches[i] = branch.ToProto() 580 + } 581 + return &proto.MinimalRepoListEntry{ 582 + HasSymbols: m.HasSymbols, 583 + Branches: branches, 584 + } 585 + } 586 + 587 + func RepoListFromProto(p *proto.ListResponse) *RepoList { 588 + repos := make([]*RepoListEntry, len(p.GetRepos())) 589 + for i, repo := range p.GetRepos() { 590 + repos[i] = RepoListEntryFromProto(repo) 591 + } 592 + 593 + reposMap := make(map[uint32]MinimalRepoListEntry, len(p.GetReposMap())) 594 + for id, mle := range p.GetReposMap() { 595 + reposMap[id] = MinimalRepoListEntryFromProto(mle) 596 + } 597 + 598 + minimal := make(map[uint32]*MinimalRepoListEntry, len(p.GetMinimal())) 599 + for id, mle := range p.GetMinimal() { 600 + m := MinimalRepoListEntryFromProto(mle) 601 + minimal[id] = &m 602 + } 603 + 604 + return &RepoList{ 605 + Repos: repos, 606 + ReposMap: reposMap, 607 + Crashes: int(p.GetCrashes()), 608 + Stats: RepoStatsFromProto(p.GetStats()), 609 + Minimal: minimal, 610 + } 611 + } 612 + 613 + func (r *RepoList) ToProto() *proto.ListResponse { 614 + repos := make([]*proto.RepoListEntry, len(r.Repos)) 615 + for i, repo := range r.Repos { 616 + repos[i] = repo.ToProto() 617 + } 618 + 619 + reposMap := make(map[uint32]*proto.MinimalRepoListEntry, len(r.ReposMap)) 620 + for id, repo := range r.ReposMap { 621 + reposMap[id] = repo.ToProto() 622 + } 623 + 624 + minimal := make(map[uint32]*proto.MinimalRepoListEntry, len(r.Minimal)) 625 + for id, repo := range r.Minimal { 626 + minimal[id] = repo.ToProto() 627 + } 628 + 629 + return &proto.ListResponse{ 630 + Repos: []*proto.RepoListEntry{}, 631 + ReposMap: reposMap, 632 + Crashes: int64(r.Crashes), 633 + Stats: r.Stats.ToProto(), 634 + Minimal: minimal, 635 + } 636 + } 637 + 638 + func (l *ListOptions) ToProto() *proto.ListOptions { 639 + if l == nil { 640 + return nil 641 + } 642 + var field proto.ListOptions_RepoListField 643 + switch l.Field { 644 + case RepoListFieldRepos: 645 + field = proto.ListOptions_REPO_LIST_FIELD_REPOS 646 + case RepoListFieldMinimal: 647 + field = proto.ListOptions_REPO_LIST_FIELD_MINIMAL 648 + case RepoListFieldReposMap: 649 + field = proto.ListOptions_REPO_LIST_FIELD_REPOS_MAP 650 + } 651 + 652 + return &proto.ListOptions{ 653 + Field: field, 654 + Minimal: l.Minimal, 655 + } 656 + } 657 + 658 + func ListOptionsFromProto(p *proto.ListOptions) *ListOptions { 659 + if p == nil { 660 + return nil 661 + } 662 + var field RepoListField 663 + switch p.GetField() { 664 + case proto.ListOptions_REPO_LIST_FIELD_REPOS: 665 + field = RepoListFieldRepos 666 + case proto.ListOptions_REPO_LIST_FIELD_MINIMAL: 667 + field = RepoListFieldMinimal 668 + case proto.ListOptions_REPO_LIST_FIELD_REPOS_MAP: 669 + field = RepoListFieldReposMap 670 + } 671 + return &ListOptions{ 672 + Field: field, 673 + Minimal: p.GetMinimal(), 674 + } 675 + } 676 + 677 + func SearchOptionsFromProto(p *proto.SearchOptions) *SearchOptions { 678 + if p == nil { 679 + return nil 680 + } 681 + 682 + return &SearchOptions{ 683 + EstimateDocCount: p.GetEstimateDocCount(), 684 + Whole: p.GetWhole(), 685 + ShardMaxMatchCount: int(p.GetShardMaxMatchCount()), 686 + TotalMaxMatchCount: int(p.GetTotalMaxMatchCount()), 687 + ShardRepoMaxMatchCount: int(p.GetShardRepoMaxMatchCount()), 688 + MaxWallTime: p.GetMaxWallTime().AsDuration(), 689 + FlushWallTime: p.GetFlushWallTime().AsDuration(), 690 + MaxDocDisplayCount: int(p.GetMaxDocDisplayCount()), 691 + NumContextLines: int(p.GetNumContextLines()), 692 + ChunkMatches: p.GetChunkMatches(), 693 + UseDocumentRanks: p.GetUseDocumentRanks(), 694 + DocumentRanksWeight: p.GetDocumentRanksWeight(), 695 + Trace: p.GetTrace(), 696 + DebugScore: p.GetDebugScore(), 697 + UseKeywordScoring: p.GetUseKeywordScoring(), 698 + } 699 + } 700 + 701 + func (s *SearchOptions) ToProto() *proto.SearchOptions { 702 + if s == nil { 703 + return nil 704 + } 705 + 706 + return &proto.SearchOptions{ 707 + EstimateDocCount: s.EstimateDocCount, 708 + Whole: s.Whole, 709 + ShardMaxMatchCount: int64(s.ShardMaxMatchCount), 710 + TotalMaxMatchCount: int64(s.TotalMaxMatchCount), 711 + ShardRepoMaxMatchCount: int64(s.ShardRepoMaxMatchCount), 712 + MaxWallTime: durationpb.New(s.MaxWallTime), 713 + FlushWallTime: durationpb.New(s.FlushWallTime), 714 + MaxDocDisplayCount: int64(s.MaxDocDisplayCount), 715 + NumContextLines: int64(s.NumContextLines), 716 + ChunkMatches: s.ChunkMatches, 717 + UseDocumentRanks: s.UseDocumentRanks, 718 + DocumentRanksWeight: s.DocumentRanksWeight, 719 + Trace: s.Trace, 720 + DebugScore: s.DebugScore, 721 + UseKeywordScoring: s.UseKeywordScoring, 722 + } 723 + }
+454
api_proto_test.go
··· 1 + // Copyright 2016 Google Inc. All rights reserved. 2 + // 3 + // Licensed under the Apache License, Version 2.0 (the "License"); 4 + // you may not use this file except in compliance with the License. 5 + // You may obtain a copy of the License at 6 + // 7 + // http://www.apache.org/licenses/LICENSE-2.0 8 + // 9 + // Unless required by applicable law or agreed to in writing, software 10 + // distributed under the License is distributed on an "AS IS" BASIS, 11 + // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 + // See the License for the specific language governing permissions and 13 + // limitations under the License. 14 + 15 + package zoekt // import "github.com/sourcegraph/zoekt" 16 + 17 + import ( 18 + "bytes" 19 + _ "embed" 20 + "encoding/gob" 21 + "fmt" 22 + "math/rand" 23 + "reflect" 24 + "testing" 25 + "testing/quick" 26 + "time" 27 + 28 + "github.com/google/go-cmp/cmp" 29 + "github.com/google/go-cmp/cmp/cmpopts" 30 + "google.golang.org/protobuf/proto" 31 + 32 + v1 "github.com/sourcegraph/zoekt/grpc/v1" 33 + ) 34 + 35 + func TestProtoRoundtrip(t *testing.T) { 36 + t.Run("FileMatch", func(t *testing.T) { 37 + f := func(f1 FileMatch) bool { 38 + p1 := f1.ToProto() 39 + f2 := FileMatchFromProto(p1) 40 + return reflect.DeepEqual(f1, f2) 41 + } 42 + if err := quick.Check(f, nil); err != nil { 43 + t.Fatal(err) 44 + } 45 + }) 46 + 47 + t.Run("ChunkMatch", func(t *testing.T) { 48 + f := func(f1 ChunkMatch) bool { 49 + p1 := f1.ToProto() 50 + f2 := ChunkMatchFromProto(p1) 51 + return reflect.DeepEqual(f1, f2) 52 + } 53 + if err := quick.Check(f, nil); err != nil { 54 + t.Fatal(err) 55 + } 56 + }) 57 + 58 + t.Run("Range", func(t *testing.T) { 59 + f := func(f1 Range) bool { 60 + p1 := f1.ToProto() 61 + f2 := RangeFromProto(p1) 62 + return reflect.DeepEqual(f1, f2) 63 + } 64 + if err := quick.Check(f, nil); err != nil { 65 + t.Fatal(err) 66 + } 67 + }) 68 + 69 + t.Run("Location", func(t *testing.T) { 70 + f := func(f1 Range) bool { 71 + p1 := f1.ToProto() 72 + f2 := RangeFromProto(p1) 73 + return reflect.DeepEqual(f1, f2) 74 + } 75 + if err := quick.Check(f, nil); err != nil { 76 + t.Fatal(err) 77 + } 78 + }) 79 + 80 + t.Run("LineMatch", func(t *testing.T) { 81 + f := func(f1 LineMatch) bool { 82 + p1 := f1.ToProto() 83 + f2 := LineMatchFromProto(p1) 84 + return reflect.DeepEqual(f1, f2) 85 + } 86 + if err := quick.Check(f, nil); err != nil { 87 + t.Fatal(err) 88 + } 89 + }) 90 + 91 + t.Run("Symbol", func(t *testing.T) { 92 + f := func(f1 *Symbol) bool { 93 + p1 := f1.ToProto() 94 + f2 := SymbolFromProto(p1) 95 + return reflect.DeepEqual(f1, f2) 96 + } 97 + if err := quick.Check(f, nil); err != nil { 98 + t.Fatal(err) 99 + } 100 + }) 101 + 102 + t.Run("FlushReson", func(t *testing.T) { 103 + f := func(f1 FlushReason) bool { 104 + p1 := f1.ToProto() 105 + f2 := FlushReasonFromProto(p1) 106 + return reflect.DeepEqual(f1.String(), f2.String()) 107 + } 108 + if err := quick.Check(f, nil); err != nil { 109 + t.Fatal(err) 110 + } 111 + }) 112 + 113 + t.Run("Stats", func(t *testing.T) { 114 + f := func(f1 Stats) bool { 115 + p1 := f1.ToProto() 116 + f2 := StatsFromProto(p1) 117 + return reflect.DeepEqual(f1, f2) 118 + } 119 + if err := quick.Check(f, nil); err != nil { 120 + t.Fatal(err) 121 + } 122 + }) 123 + 124 + t.Run("Progress", func(t *testing.T) { 125 + f := func(f1 Progress) bool { 126 + p1 := f1.ToProto() 127 + f2 := ProgressFromProto(p1) 128 + return reflect.DeepEqual(f1, f2) 129 + } 130 + if err := quick.Check(f, nil); err != nil { 131 + t.Fatal(err) 132 + } 133 + }) 134 + 135 + t.Run("SearchResult", func(t *testing.T) { 136 + f := func(f1 *SearchResult) bool { 137 + p1 := f1.ToProto() 138 + f2 := SearchResultFromProto(p1) 139 + return reflect.DeepEqual(f1, f2) 140 + } 141 + if err := quick.Check(f, nil); err != nil { 142 + t.Fatal(err) 143 + } 144 + }) 145 + 146 + t.Run("Repository", func(t *testing.T) { 147 + f := func(f1 *Repository) bool { 148 + p1 := f1.ToProto() 149 + f2 := RepositoryFromProto(p1) 150 + if diff := cmp.Diff(f1, &f2, cmpopts.IgnoreUnexported(Repository{})); diff != "" { 151 + fmt.Printf("got diff: %s", diff) 152 + return false 153 + } 154 + return true 155 + } 156 + if err := quick.Check(f, nil); err != nil { 157 + t.Fatal(err) 158 + } 159 + }) 160 + 161 + t.Run("IndexMetadata", func(t *testing.T) { 162 + f := func(f1 *IndexMetadata) bool { 163 + p1 := f1.ToProto() 164 + f2 := IndexMetadataFromProto(p1) 165 + if diff := cmp.Diff(f1, &f2); diff != "" { 166 + fmt.Printf("got diff: %s", diff) 167 + return false 168 + } 169 + return true 170 + } 171 + if err := quick.Check(f, nil); err != nil { 172 + t.Fatal(err) 173 + } 174 + }) 175 + 176 + t.Run("RepoStats", func(t *testing.T) { 177 + f := func(f1 RepoStats) bool { 178 + p1 := f1.ToProto() 179 + f2 := RepoStatsFromProto(p1) 180 + if diff := cmp.Diff(f1, f2); diff != "" { 181 + fmt.Printf("got diff: %s", diff) 182 + return false 183 + } 184 + return true 185 + } 186 + if err := quick.Check(f, nil); err != nil { 187 + t.Fatal(err) 188 + } 189 + }) 190 + 191 + t.Run("RepoListEntry", func(t *testing.T) { 192 + r1 := &RepoListEntry{ 193 + Repository: Repository{ 194 + ID: 1, 195 + Name: "test", 196 + URL: "testurl", 197 + Source: "testsource", 198 + Branches: []RepositoryBranch{{ 199 + Name: "branch", 200 + Version: "version", 201 + }}, 202 + SubRepoMap: map[string]*Repository{ 203 + "test": { 204 + ID: 2, 205 + Name: "subrepo", 206 + Branches: []RepositoryBranch{}, 207 + SubRepoMap: map[string]*Repository{}, 208 + FileTombstones: map[string]struct{}{}, 209 + }, 210 + }, 211 + CommitURLTemplate: "committemplate", 212 + FileURLTemplate: "fileurltemplate", 213 + LineFragmentTemplate: "linefragmenttemplate", 214 + priority: 10, 215 + RawConfig: map[string]string{ 216 + "a": "b", 217 + }, 218 + Rank: 32, 219 + IndexOptions: "indexoptions", 220 + HasSymbols: true, 221 + Tombstone: false, 222 + LatestCommitDate: time.Now(), 223 + FileTombstones: map[string]struct{}{ 224 + "test1": {}, 225 + }, 226 + }, 227 + IndexMetadata: IndexMetadata{ 228 + IndexFormatVersion: 32, 229 + IndexFeatureVersion: 42, 230 + IndexMinReaderVersion: 52, 231 + IndexTime: time.Now(), 232 + PlainASCII: true, 233 + LanguageMap: map[string]uint16{ 234 + "go": 1, 235 + }, 236 + ZoektVersion: "32", 237 + ID: "52", 238 + }, 239 + Stats: RepoStats{ 240 + Repos: 3, 241 + Shards: 4, 242 + Documents: 5, 243 + IndexBytes: 6, 244 + ContentBytes: 7, 245 + NewLinesCount: 8, 246 + DefaultBranchNewLinesCount: 9, 247 + OtherBranchesNewLinesCount: 10, 248 + }, 249 + } 250 + 251 + p1 := r1.ToProto() 252 + r2 := RepoListEntryFromProto(p1) 253 + if diff := cmp.Diff(r1, r2, cmpopts.IgnoreUnexported(Repository{})); diff != "" { 254 + t.Fatalf("got diff: %s", diff) 255 + } 256 + }) 257 + 258 + t.Run("RepositoryBranch", func(t *testing.T) { 259 + f := func(f1 RepositoryBranch) bool { 260 + p1 := f1.ToProto() 261 + f2 := RepositoryBranchFromProto(p1) 262 + if diff := cmp.Diff(f1, f2); diff != "" { 263 + fmt.Printf("got diff: %s", diff) 264 + return false 265 + } 266 + return true 267 + } 268 + if err := quick.Check(f, nil); err != nil { 269 + t.Fatal(err) 270 + } 271 + }) 272 + 273 + t.Run("MinimalRepoListEntry", func(t *testing.T) { 274 + f := func(f1 MinimalRepoListEntry) bool { 275 + p1 := f1.ToProto() 276 + f2 := MinimalRepoListEntryFromProto(p1) 277 + if diff := cmp.Diff(f1, f2); diff != "" { 278 + fmt.Printf("got diff: %s", diff) 279 + return false 280 + } 281 + return true 282 + } 283 + if err := quick.Check(f, nil); err != nil { 284 + t.Fatal(err) 285 + } 286 + }) 287 + 288 + t.Run("ListOptions", func(t *testing.T) { 289 + f := func(f1 *ListOptions) bool { 290 + p1 := f1.ToProto() 291 + f2 := ListOptionsFromProto(p1) 292 + if diff := cmp.Diff(f1, f2); diff != "" { 293 + fmt.Printf("got diff: %s", diff) 294 + return false 295 + } 296 + return true 297 + } 298 + if err := quick.Check(f, nil); err != nil { 299 + t.Fatal(err) 300 + } 301 + }) 302 + 303 + t.Run("SearchOptions", func(t *testing.T) { 304 + f := func(f1 *SearchOptions) bool { 305 + if f1 != nil { 306 + // Ignore deprecated and unimplemented fields 307 + f1.ShardMaxImportantMatch = 0 308 + f1.TotalMaxImportantMatch = 0 309 + f1.SpanContext = nil 310 + } 311 + p1 := f1.ToProto() 312 + f2 := SearchOptionsFromProto(p1) 313 + if diff := cmp.Diff(f1, f2); diff != "" { 314 + fmt.Printf("got diff: %s", diff) 315 + return false 316 + } 317 + return true 318 + } 319 + if err := quick.Check(f, nil); err != nil { 320 + t.Fatal(err) 321 + } 322 + }) 323 + } 324 + 325 + func (*IndexMetadata) Generate(r *rand.Rand, _ int) reflect.Value { 326 + indexTime := time.Now().Add(time.Duration(r.Int63n(1000)) * time.Hour) 327 + var i IndexMetadata 328 + i.IndexFormatVersion = gen(i.IndexFormatVersion, r) 329 + i.IndexFeatureVersion = gen(i.IndexFeatureVersion, r) 330 + i.IndexMinReaderVersion = gen(i.IndexMinReaderVersion, r) 331 + i.IndexTime = indexTime 332 + i.PlainASCII = gen(i.PlainASCII, r) 333 + i.LanguageMap = gen(i.LanguageMap, r) 334 + i.ZoektVersion = gen(i.ZoektVersion, r) 335 + i.ID = gen(i.ID, r) 336 + return reflect.ValueOf(&i) 337 + } 338 + 339 + func (*Repository) Generate(rng *rand.Rand, _ int) reflect.Value { 340 + latestCommitDate := time.Now().Add(time.Duration(rng.Int63n(1000)) * time.Hour) 341 + var r Repository 342 + v := &Repository{ 343 + ID: gen(r.ID, rng), 344 + Name: gen(r.Name, rng), 345 + URL: gen(r.URL, rng), 346 + Source: gen(r.Source, rng), 347 + Branches: gen(r.Branches, rng), 348 + SubRepoMap: map[string]*Repository{}, 349 + CommitURLTemplate: gen(r.CommitURLTemplate, rng), 350 + FileURLTemplate: gen(r.FileURLTemplate, rng), 351 + LineFragmentTemplate: gen(r.LineFragmentTemplate, rng), 352 + priority: gen(r.priority, rng), 353 + RawConfig: gen(r.RawConfig, rng), 354 + Rank: gen(r.Rank, rng), 355 + IndexOptions: gen(r.IndexOptions, rng), 356 + HasSymbols: gen(r.HasSymbols, rng), 357 + Tombstone: gen(r.Tombstone, rng), 358 + LatestCommitDate: latestCommitDate, 359 + FileTombstones: gen(r.FileTombstones, rng), 360 + } 361 + return reflect.ValueOf(v) 362 + } 363 + 364 + func (RepoListField) Generate(rng *rand.Rand, _ int) reflect.Value { 365 + switch rng.Int() % 3 { 366 + case 0: 367 + return reflect.ValueOf(RepoListField(RepoListFieldRepos)) 368 + case 1: 369 + return reflect.ValueOf(RepoListField(RepoListFieldMinimal)) 370 + default: 371 + return reflect.ValueOf(RepoListField(RepoListFieldReposMap)) 372 + } 373 + } 374 + 375 + func gen[T any](sample T, r *rand.Rand) T { 376 + var t T 377 + v, _ := quick.Value(reflect.TypeOf(t), r) 378 + return v.Interface().(T) 379 + } 380 + 381 + // This is a real search result that is intended to be a reasonable representative 382 + // for serialization benchmarks. 383 + // Generated by modifying the code to dump the proto to a file, then running a 384 + // fairly broadly-matching search. 385 + var ( 386 + //go:embed testdata/search_result_1.pb 387 + exampleSearchResultBytes []byte 388 + 389 + // The proto struct representation of the search result 390 + exampleSearchResultProto = func() *v1.SearchResponse { 391 + sr := new(v1.SearchResponse) 392 + err := proto.Unmarshal(exampleSearchResultBytes, sr) 393 + if err != nil { 394 + panic(err) 395 + } 396 + return sr 397 + }() 398 + 399 + // The non-proto struct representation of the search result 400 + exampleSearchResultGo = SearchResultFromProto(exampleSearchResultProto) 401 + ) 402 + 403 + func BenchmarkGobRoundtrip(b *testing.B) { 404 + for _, count := range []int{1, 100, 1000, 10000} { 405 + b.Run(fmt.Sprintf("count=%d", count), func(b *testing.B) { 406 + for i := 0; i < b.N; i++ { 407 + var buf bytes.Buffer 408 + enc := gob.NewEncoder(&buf) 409 + 410 + for i := 0; i < count; i++ { 411 + err := enc.Encode(exampleSearchResultGo) 412 + if err != nil { 413 + panic(err) 414 + } 415 + 416 + } 417 + 418 + dec := gob.NewDecoder(&buf) 419 + for i := 0; i < count; i++ { 420 + var res SearchResult 421 + err := dec.Decode(&res) 422 + if err != nil { 423 + panic(err) 424 + } 425 + } 426 + } 427 + }) 428 + } 429 + } 430 + 431 + func BenchmarkProtoRoundtrip(b *testing.B) { 432 + for _, count := range []int{1, 100, 1000, 10000} { 433 + b.Run(fmt.Sprintf("count=%d", count), func(b *testing.B) { 434 + for i := 0; i < b.N; i++ { 435 + buffers := make([][]byte, 0, count) 436 + for i := 0; i < count; i++ { 437 + buf, err := proto.Marshal(exampleSearchResultProto) 438 + if err != nil { 439 + b.Fatal(err) 440 + } 441 + buffers = append(buffers, buf) 442 + } 443 + 444 + for _, buf := range buffers { 445 + res := new(v1.SearchResponse) 446 + err := proto.Unmarshal(buf, res) 447 + if err != nil { 448 + b.Fatal(err) 449 + } 450 + } 451 + } 452 + }) 453 + } 454 + }
+5
cmd/zoekt-webserver/BUILD.bazel
··· 15 15 "//:zoekt", 16 16 "//build", 17 17 "//debugserver", 18 + "//grpc", 19 + "//grpc/v1:grpc", 18 20 "//internal/profiler", 19 21 "//internal/tracer", 20 22 "//query", ··· 29 31 "@com_github_sourcegraph_mountinfo//:mountinfo", 30 32 "@com_github_uber_jaeger_client_go//:jaeger-client-go", 31 33 "@io_opentelemetry_go_otel_trace//:trace", 34 + "@org_golang_google_grpc//:go_default_library", 35 + "@org_golang_x_net//http2", 36 + "@org_golang_x_net//http2/h2c", 32 37 "@org_uber_go_automaxprocs//maxprocs", 33 38 ] + select({ 34 39 "@io_bazel_rules_go//go/platform:aix": [
+27 -1
cmd/zoekt-webserver/main.go
··· 38 38 "time" 39 39 40 40 "github.com/sourcegraph/mountinfo" 41 + "golang.org/x/net/http2" 42 + "golang.org/x/net/http2/h2c" 43 + "google.golang.org/grpc" 41 44 42 45 "github.com/sourcegraph/zoekt" 43 46 "github.com/sourcegraph/zoekt/build" 44 47 "github.com/sourcegraph/zoekt/debugserver" 48 + zoektgrpc "github.com/sourcegraph/zoekt/grpc" 49 + v1 "github.com/sourcegraph/zoekt/grpc/v1" 45 50 "github.com/sourcegraph/zoekt/internal/profiler" 46 51 "github.com/sourcegraph/zoekt/internal/tracer" 47 52 "github.com/sourcegraph/zoekt/query" ··· 277 282 log.Println("watchdog disabled") 278 283 } 279 284 285 + grpcServer := grpc.NewServer() 286 + v1.RegisterWebserverServiceServer(grpcServer, zoektgrpc.NewServer(web.NewTraceAwareSearcher(s.Searcher))) 287 + 280 288 srv := &http.Server{ 281 289 Addr: *listen, 282 - Handler: handler, 290 + Handler: multiplexGRPC(grpcServer, handler), 283 291 } 284 292 285 293 go func() { ··· 309 317 log.Fatalf("http.Server.Shutdown: %v", err) 310 318 } 311 319 } 320 + } 321 + 322 + // multiplexGRPC takes a gRPC server and a plain HTTP handler and multiplexes the 323 + // request handling. Any requests that declare themselves as gRPC requests are routed 324 + // to the gRPC server, all others are routed to the httpHandler. 325 + func multiplexGRPC(grpcServer *grpc.Server, httpHandler http.Handler) http.Handler { 326 + newHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 327 + if r.ProtoMajor == 2 && strings.Contains(r.Header.Get("Content-Type"), "application/grpc") { 328 + grpcServer.ServeHTTP(w, r) 329 + } else { 330 + httpHandler.ServeHTTP(w, r) 331 + } 332 + }) 333 + 334 + // Until we enable TLS, we need to fall back to the h2c protocol, which is 335 + // basically HTTP2 without TLS. The standard library does not implement the 336 + // h2s protocol, so this hijacks h2s requests and handles them correctly. 337 + return h2c.NewHandler(newHandler, &http2.Server{}) 312 338 } 313 339 314 340 // addProxyHandler adds a handler to "mux" that proxies all requests with base
+3 -1
go.mod
··· 62 62 github.com/Microsoft/go-winio v0.6.0 // indirect 63 63 github.com/ProtonMail/go-crypto v0.0.0-20230214155104-81033d7f4442 // indirect 64 64 github.com/acomagu/bufpipe v1.0.3 // indirect 65 + github.com/benbjohnson/clock v1.3.0 // indirect 65 66 github.com/beorn7/perks v1.0.1 // indirect 66 67 github.com/bits-and-blooms/bitset v1.5.0 // indirect 67 68 github.com/cenkalti/backoff/v4 v4.2.0 // indirect ··· 108 109 github.com/rogpeppe/go-internal v1.9.0 // indirect 109 110 github.com/sergi/go-diff v1.3.1 // indirect 110 111 github.com/skeema/knownhosts v1.1.0 // indirect 112 + github.com/stretchr/testify v1.8.2 // indirect 111 113 github.com/xanzy/ssh-agent v0.3.3 // indirect 112 - github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect 114 + github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect 113 115 github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect 114 116 github.com/yusufpapurcu/wmi v1.2.2 // indirect 115 117 go.opencensus.io v0.24.0 // indirect
+6 -3
go.sum
··· 73 73 github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= 74 74 github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= 75 75 github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= 76 - github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= 76 + github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= 77 + github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= 77 78 github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= 78 79 github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= 79 80 github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= ··· 469 470 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 470 471 github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 471 472 github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= 472 - github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= 473 473 github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= 474 + github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= 475 + github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= 474 476 github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= 475 477 github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= 476 478 github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= ··· 491 493 github.com/xanzy/go-gitlab v0.80.0/go.mod h1:DlByVTSXhPsJMYL6+cm8e8fTJjeBmhrXdC/yvkKKt6M= 492 494 github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= 493 495 github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= 494 - github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= 495 496 github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= 497 + github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= 498 + github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= 496 499 github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= 497 500 github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= 498 501 github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
+33
grpc/BUILD.bazel
··· 1 + load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") 2 + 3 + go_library( 4 + name = "grpc", 5 + srcs = ["server.go"], 6 + importpath = "github.com/sourcegraph/zoekt/grpc", 7 + visibility = ["//visibility:public"], 8 + deps = [ 9 + "//:zoekt", 10 + "//grpc/v1:grpc", 11 + "//query", 12 + "//stream", 13 + "@org_golang_google_grpc//codes", 14 + "@org_golang_google_grpc//status", 15 + ], 16 + ) 17 + 18 + go_test( 19 + name = "grpc_test", 20 + srcs = ["server_test.go"], 21 + embed = [":grpc"], 22 + deps = [ 23 + "//:zoekt", 24 + "//grpc/v1:grpc", 25 + "//internal/mockSearcher", 26 + "//query", 27 + "@org_golang_google_grpc//:go_default_library", 28 + "@org_golang_google_grpc//credentials/insecure", 29 + "@org_golang_google_protobuf//proto", 30 + "@org_golang_x_net//http2", 31 + "@org_golang_x_net//http2/h2c", 32 + ], 33 + )
+65
grpc/server.go
··· 1 + package grpc 2 + 3 + import ( 4 + "context" 5 + 6 + "google.golang.org/grpc/codes" 7 + "google.golang.org/grpc/status" 8 + 9 + "github.com/sourcegraph/zoekt" 10 + v1 "github.com/sourcegraph/zoekt/grpc/v1" 11 + "github.com/sourcegraph/zoekt/query" 12 + "github.com/sourcegraph/zoekt/stream" 13 + ) 14 + 15 + func NewServer(s zoekt.Streamer) *Server { 16 + return &Server{ 17 + streamer: s, 18 + } 19 + } 20 + 21 + type Server struct { 22 + v1.UnimplementedWebserverServiceServer 23 + streamer zoekt.Streamer 24 + } 25 + 26 + func (s *Server) Search(ctx context.Context, req *v1.SearchRequest) (*v1.SearchResponse, error) { 27 + q, err := query.QFromProto(req.GetQuery()) 28 + if err != nil { 29 + return nil, status.Error(codes.InvalidArgument, err.Error()) 30 + } 31 + 32 + res, err := s.streamer.Search(ctx, q, zoekt.SearchOptionsFromProto(req.GetOpts())) 33 + if err != nil { 34 + return nil, err 35 + } 36 + 37 + return res.ToProto(), nil 38 + } 39 + 40 + func (s *Server) StreamSearch(req *v1.SearchRequest, ss v1.WebserverService_StreamSearchServer) error { 41 + q, err := query.QFromProto(req.GetQuery()) 42 + if err != nil { 43 + return status.Error(codes.InvalidArgument, err.Error()) 44 + } 45 + 46 + onMatch := stream.SenderFunc(func(res *zoekt.SearchResult) { 47 + ss.Send(res.ToProto()) 48 + }) 49 + 50 + return s.streamer.StreamSearch(ss.Context(), q, zoekt.SearchOptionsFromProto(req.GetOpts()), onMatch) 51 + } 52 + 53 + func (s *Server) List(ctx context.Context, req *v1.ListRequest) (*v1.ListResponse, error) { 54 + q, err := query.QFromProto(req.GetQuery()) 55 + if err != nil { 56 + return nil, status.Error(codes.InvalidArgument, err.Error()) 57 + } 58 + 59 + repoList, err := s.streamer.List(ctx, q, zoekt.ListOptionsFromProto(req.GetOpts())) 60 + if err != nil { 61 + return nil, err 62 + } 63 + 64 + return repoList.ToProto(), nil 65 + }
+94
grpc/server_test.go
··· 1 + package grpc 2 + 3 + import ( 4 + "context" 5 + "net/http/httptest" 6 + "net/url" 7 + "testing" 8 + 9 + "golang.org/x/net/http2" 10 + "golang.org/x/net/http2/h2c" 11 + "google.golang.org/grpc" 12 + "google.golang.org/grpc/credentials/insecure" 13 + "google.golang.org/protobuf/proto" 14 + 15 + "github.com/sourcegraph/zoekt" 16 + v1 "github.com/sourcegraph/zoekt/grpc/v1" 17 + "github.com/sourcegraph/zoekt/internal/mockSearcher" 18 + "github.com/sourcegraph/zoekt/query" 19 + ) 20 + 21 + func TestClientServer(t *testing.T) { 22 + mock := &mockSearcher.MockSearcher{ 23 + WantSearch: query.NewAnd(mustParse("hello world|universe"), query.NewSingleBranchesRepos("HEAD", 1, 2)), 24 + SearchResult: &zoekt.SearchResult{ 25 + Files: []zoekt.FileMatch{ 26 + {FileName: "bin.go"}, 27 + }, 28 + }, 29 + 30 + WantList: &query.Const{Value: true}, 31 + RepoList: &zoekt.RepoList{ 32 + Repos: []*zoekt.RepoListEntry{ 33 + { 34 + Repository: zoekt.Repository{ 35 + ID: 2, 36 + Name: "foo/bar", 37 + }, 38 + }, 39 + }, 40 + }, 41 + } 42 + 43 + gs := grpc.NewServer() 44 + v1.RegisterWebserverServiceServer(gs, NewServer(adapter{mock})) 45 + ts := httptest.NewServer(h2c.NewHandler(gs, &http2.Server{})) 46 + 47 + u, err := url.Parse(ts.URL) 48 + if err != nil { 49 + t.Fatal(err) 50 + } 51 + cc, err := grpc.Dial(u.Host, grpc.WithTransportCredentials(insecure.NewCredentials())) 52 + if err != nil { 53 + t.Fatal(err) 54 + } 55 + client := v1.NewWebserverServiceClient(cc) 56 + 57 + r, err := client.Search(context.Background(), &v1.SearchRequest{Query: query.QToProto(mock.WantSearch)}) 58 + if err != nil { 59 + t.Fatal(err) 60 + } 61 + if !proto.Equal(r, mock.SearchResult.ToProto()) { 62 + t.Fatalf("got %+v, want %+v", r, mock.SearchResult.ToProto()) 63 + } 64 + 65 + l, err := client.List(context.Background(), &v1.ListRequest{Query: query.QToProto(mock.WantList)}) 66 + if err != nil { 67 + t.Fatal(err) 68 + } 69 + 70 + if !proto.Equal(l, mock.RepoList.ToProto()) { 71 + t.Fatalf("got %+v, want %+v", l, mock.RepoList.ToProto()) 72 + } 73 + } 74 + 75 + func mustParse(s string) query.Q { 76 + q, err := query.Parse(s) 77 + if err != nil { 78 + panic(err) 79 + } 80 + return q 81 + } 82 + 83 + type adapter struct { 84 + zoekt.Searcher 85 + } 86 + 87 + func (a adapter) StreamSearch(ctx context.Context, q query.Q, opts *zoekt.SearchOptions, sender zoekt.Sender) (err error) { 88 + sr, err := a.Searcher.Search(ctx, q, opts) 89 + if err != nil { 90 + return err 91 + } 92 + sender.Send(sr) 93 + return nil 94 + }
+29
grpc/v1/BUILD.bazel
··· 1 + load("@rules_proto//proto:defs.bzl", "proto_library") 2 + load("@io_bazel_rules_go//go:def.bzl", "go_library") 3 + load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") 4 + 5 + proto_library( 6 + name = "v1_proto", 7 + srcs = ["webserver.proto"], 8 + visibility = ["//visibility:public"], 9 + deps = [ 10 + "@com_google_protobuf//:duration_proto", 11 + "@com_google_protobuf//:empty_proto", 12 + "@com_google_protobuf//:timestamp_proto", 13 + ], 14 + ) 15 + 16 + go_proto_library( 17 + name = "v1_go_proto", 18 + compilers = ["@io_bazel_rules_go//proto:go_grpc"], 19 + importpath = "github.com/sourcegraph/zoekt/grpc/v1", 20 + proto = ":v1_proto", 21 + visibility = ["//visibility:public"], 22 + ) 23 + 24 + go_library( 25 + name = "grpc", 26 + embed = [":v1_go_proto"], 27 + importpath = "github.com/sourcegraph/zoekt/grpc/v1", 28 + visibility = ["//visibility:public"], 29 + )
+11
grpc/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.29.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
+1793
grpc/v1/query.pb.go
··· 1 + // Code generated by protoc-gen-go. DO NOT EDIT. 2 + // versions: 3 + // protoc-gen-go v1.29.1 4 + // protoc (unknown) 5 + // source: query.proto 6 + 7 + package v1 8 + 9 + import ( 10 + protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 + protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 + _ "google.golang.org/protobuf/types/known/durationpb" 13 + _ "google.golang.org/protobuf/types/known/emptypb" 14 + _ "google.golang.org/protobuf/types/known/timestamppb" 15 + reflect "reflect" 16 + sync "sync" 17 + ) 18 + 19 + const ( 20 + // Verify that this generated code is sufficiently up-to-date. 21 + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 22 + // Verify that runtime/protoimpl is sufficiently up-to-date. 23 + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 24 + ) 25 + 26 + type RawConfig_Flag int32 27 + 28 + const ( 29 + RawConfig_UNKNOWN RawConfig_Flag = 0 30 + RawConfig_ONLY_PUBLIC RawConfig_Flag = 1 31 + RawConfig_ONLY_PRIVATE RawConfig_Flag = 2 32 + RawConfig_ONLY_FORKS RawConfig_Flag = 4 33 + RawConfig_NO_FORKS RawConfig_Flag = 8 34 + RawConfig_ONLY_ARCHIVED RawConfig_Flag = 16 35 + RawConfig_NO_ARCHIVED RawConfig_Flag = 32 36 + ) 37 + 38 + // Enum value maps for RawConfig_Flag. 39 + var ( 40 + RawConfig_Flag_name = map[int32]string{ 41 + 0: "UNKNOWN", 42 + 1: "ONLY_PUBLIC", 43 + 2: "ONLY_PRIVATE", 44 + 4: "ONLY_FORKS", 45 + 8: "NO_FORKS", 46 + 16: "ONLY_ARCHIVED", 47 + 32: "NO_ARCHIVED", 48 + } 49 + RawConfig_Flag_value = map[string]int32{ 50 + "UNKNOWN": 0, 51 + "ONLY_PUBLIC": 1, 52 + "ONLY_PRIVATE": 2, 53 + "ONLY_FORKS": 4, 54 + "NO_FORKS": 8, 55 + "ONLY_ARCHIVED": 16, 56 + "NO_ARCHIVED": 32, 57 + } 58 + ) 59 + 60 + func (x RawConfig_Flag) Enum() *RawConfig_Flag { 61 + p := new(RawConfig_Flag) 62 + *p = x 63 + return p 64 + } 65 + 66 + func (x RawConfig_Flag) String() string { 67 + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) 68 + } 69 + 70 + func (RawConfig_Flag) Descriptor() protoreflect.EnumDescriptor { 71 + return file_query_proto_enumTypes[0].Descriptor() 72 + } 73 + 74 + func (RawConfig_Flag) Type() protoreflect.EnumType { 75 + return &file_query_proto_enumTypes[0] 76 + } 77 + 78 + func (x RawConfig_Flag) Number() protoreflect.EnumNumber { 79 + return protoreflect.EnumNumber(x) 80 + } 81 + 82 + // Deprecated: Use RawConfig_Flag.Descriptor instead. 83 + func (RawConfig_Flag) EnumDescriptor() ([]byte, []int) { 84 + return file_query_proto_rawDescGZIP(), []int{1, 0} 85 + } 86 + 87 + type Type_Kind int32 88 + 89 + const ( 90 + Type_UNKNOWN Type_Kind = 0 91 + Type_FILE_MATCH Type_Kind = 1 92 + Type_FILE_NAME Type_Kind = 2 93 + Type_REPO Type_Kind = 3 94 + ) 95 + 96 + // Enum value maps for Type_Kind. 97 + var ( 98 + Type_Kind_name = map[int32]string{ 99 + 0: "UNKNOWN", 100 + 1: "FILE_MATCH", 101 + 2: "FILE_NAME", 102 + 3: "REPO", 103 + } 104 + Type_Kind_value = map[string]int32{ 105 + "UNKNOWN": 0, 106 + "FILE_MATCH": 1, 107 + "FILE_NAME": 2, 108 + "REPO": 3, 109 + } 110 + ) 111 + 112 + func (x Type_Kind) Enum() *Type_Kind { 113 + p := new(Type_Kind) 114 + *p = x 115 + return p 116 + } 117 + 118 + func (x Type_Kind) String() string { 119 + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) 120 + } 121 + 122 + func (Type_Kind) Descriptor() protoreflect.EnumDescriptor { 123 + return file_query_proto_enumTypes[1].Descriptor() 124 + } 125 + 126 + func (Type_Kind) Type() protoreflect.EnumType { 127 + return &file_query_proto_enumTypes[1] 128 + } 129 + 130 + func (x Type_Kind) Number() protoreflect.EnumNumber { 131 + return protoreflect.EnumNumber(x) 132 + } 133 + 134 + // Deprecated: Use Type_Kind.Descriptor instead. 135 + func (Type_Kind) EnumDescriptor() ([]byte, []int) { 136 + return file_query_proto_rawDescGZIP(), []int{12, 0} 137 + } 138 + 139 + type Q struct { 140 + state protoimpl.MessageState 141 + sizeCache protoimpl.SizeCache 142 + unknownFields protoimpl.UnknownFields 143 + 144 + // Types that are assignable to Query: 145 + // 146 + // *Q_RawConfig 147 + // *Q_Regexp 148 + // *Q_Symbol 149 + // *Q_Language 150 + // *Q_Const 151 + // *Q_Repo 152 + // *Q_RepoRegexp 153 + // *Q_BranchesRepos 154 + // *Q_RepoIds 155 + // *Q_RepoSet 156 + // *Q_FileNameSet 157 + // *Q_Type 158 + // *Q_Substring 159 + // *Q_And 160 + // *Q_Or 161 + // *Q_Not 162 + // *Q_Branch 163 + Query isQ_Query `protobuf_oneof:"query"` 164 + } 165 + 166 + func (x *Q) Reset() { 167 + *x = Q{} 168 + if protoimpl.UnsafeEnabled { 169 + mi := &file_query_proto_msgTypes[0] 170 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 171 + ms.StoreMessageInfo(mi) 172 + } 173 + } 174 + 175 + func (x *Q) String() string { 176 + return protoimpl.X.MessageStringOf(x) 177 + } 178 + 179 + func (*Q) ProtoMessage() {} 180 + 181 + func (x *Q) ProtoReflect() protoreflect.Message { 182 + mi := &file_query_proto_msgTypes[0] 183 + if protoimpl.UnsafeEnabled && x != nil { 184 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 185 + if ms.LoadMessageInfo() == nil { 186 + ms.StoreMessageInfo(mi) 187 + } 188 + return ms 189 + } 190 + return mi.MessageOf(x) 191 + } 192 + 193 + // Deprecated: Use Q.ProtoReflect.Descriptor instead. 194 + func (*Q) Descriptor() ([]byte, []int) { 195 + return file_query_proto_rawDescGZIP(), []int{0} 196 + } 197 + 198 + func (m *Q) GetQuery() isQ_Query { 199 + if m != nil { 200 + return m.Query 201 + } 202 + return nil 203 + } 204 + 205 + func (x *Q) GetRawConfig() *RawConfig { 206 + if x, ok := x.GetQuery().(*Q_RawConfig); ok { 207 + return x.RawConfig 208 + } 209 + return nil 210 + } 211 + 212 + func (x *Q) GetRegexp() *Regexp { 213 + if x, ok := x.GetQuery().(*Q_Regexp); ok { 214 + return x.Regexp 215 + } 216 + return nil 217 + } 218 + 219 + func (x *Q) GetSymbol() *Symbol { 220 + if x, ok := x.GetQuery().(*Q_Symbol); ok { 221 + return x.Symbol 222 + } 223 + return nil 224 + } 225 + 226 + func (x *Q) GetLanguage() *Language { 227 + if x, ok := x.GetQuery().(*Q_Language); ok { 228 + return x.Language 229 + } 230 + return nil 231 + } 232 + 233 + func (x *Q) GetConst() bool { 234 + if x, ok := x.GetQuery().(*Q_Const); ok { 235 + return x.Const 236 + } 237 + return false 238 + } 239 + 240 + func (x *Q) GetRepo() *Repo { 241 + if x, ok := x.GetQuery().(*Q_Repo); ok { 242 + return x.Repo 243 + } 244 + return nil 245 + } 246 + 247 + func (x *Q) GetRepoRegexp() *RepoRegexp { 248 + if x, ok := x.GetQuery().(*Q_RepoRegexp); ok { 249 + return x.RepoRegexp 250 + } 251 + return nil 252 + } 253 + 254 + func (x *Q) GetBranchesRepos() *BranchesRepos { 255 + if x, ok := x.GetQuery().(*Q_BranchesRepos); ok { 256 + return x.BranchesRepos 257 + } 258 + return nil 259 + } 260 + 261 + func (x *Q) GetRepoIds() *RepoIds { 262 + if x, ok := x.GetQuery().(*Q_RepoIds); ok { 263 + return x.RepoIds 264 + } 265 + return nil 266 + } 267 + 268 + func (x *Q) GetRepoSet() *RepoSet { 269 + if x, ok := x.GetQuery().(*Q_RepoSet); ok { 270 + return x.RepoSet 271 + } 272 + return nil 273 + } 274 + 275 + func (x *Q) GetFileNameSet() *FileNameSet { 276 + if x, ok := x.GetQuery().(*Q_FileNameSet); ok { 277 + return x.FileNameSet 278 + } 279 + return nil 280 + } 281 + 282 + func (x *Q) GetType() *Type { 283 + if x, ok := x.GetQuery().(*Q_Type); ok { 284 + return x.Type 285 + } 286 + return nil 287 + } 288 + 289 + func (x *Q) GetSubstring() *Substring { 290 + if x, ok := x.GetQuery().(*Q_Substring); ok { 291 + return x.Substring 292 + } 293 + return nil 294 + } 295 + 296 + func (x *Q) GetAnd() *And { 297 + if x, ok := x.GetQuery().(*Q_And); ok { 298 + return x.And 299 + } 300 + return nil 301 + } 302 + 303 + func (x *Q) GetOr() *Or { 304 + if x, ok := x.GetQuery().(*Q_Or); ok { 305 + return x.Or 306 + } 307 + return nil 308 + } 309 + 310 + func (x *Q) GetNot() *Not { 311 + if x, ok := x.GetQuery().(*Q_Not); ok { 312 + return x.Not 313 + } 314 + return nil 315 + } 316 + 317 + func (x *Q) GetBranch() *Branch { 318 + if x, ok := x.GetQuery().(*Q_Branch); ok { 319 + return x.Branch 320 + } 321 + return nil 322 + } 323 + 324 + type isQ_Query interface { 325 + isQ_Query() 326 + } 327 + 328 + type Q_RawConfig struct { 329 + RawConfig *RawConfig `protobuf:"bytes,1,opt,name=raw_config,json=rawConfig,proto3,oneof"` 330 + } 331 + 332 + type Q_Regexp struct { 333 + Regexp *Regexp `protobuf:"bytes,2,opt,name=regexp,proto3,oneof"` 334 + } 335 + 336 + type Q_Symbol struct { 337 + Symbol *Symbol `protobuf:"bytes,3,opt,name=symbol,proto3,oneof"` 338 + } 339 + 340 + type Q_Language struct { 341 + Language *Language `protobuf:"bytes,4,opt,name=language,proto3,oneof"` 342 + } 343 + 344 + type Q_Const struct { 345 + Const bool `protobuf:"varint,5,opt,name=const,proto3,oneof"` 346 + } 347 + 348 + type Q_Repo struct { 349 + Repo *Repo `protobuf:"bytes,6,opt,name=repo,proto3,oneof"` 350 + } 351 + 352 + type Q_RepoRegexp struct { 353 + RepoRegexp *RepoRegexp `protobuf:"bytes,7,opt,name=repo_regexp,json=repoRegexp,proto3,oneof"` 354 + } 355 + 356 + type Q_BranchesRepos struct { 357 + BranchesRepos *BranchesRepos `protobuf:"bytes,8,opt,name=branches_repos,json=branchesRepos,proto3,oneof"` 358 + } 359 + 360 + type Q_RepoIds struct { 361 + RepoIds *RepoIds `protobuf:"bytes,9,opt,name=repo_ids,json=repoIds,proto3,oneof"` 362 + } 363 + 364 + type Q_RepoSet struct { 365 + RepoSet *RepoSet `protobuf:"bytes,10,opt,name=repo_set,json=repoSet,proto3,oneof"` 366 + } 367 + 368 + type Q_FileNameSet struct { 369 + FileNameSet *FileNameSet `protobuf:"bytes,11,opt,name=file_name_set,json=fileNameSet,proto3,oneof"` 370 + } 371 + 372 + type Q_Type struct { 373 + Type *Type `protobuf:"bytes,12,opt,name=type,proto3,oneof"` 374 + } 375 + 376 + type Q_Substring struct { 377 + Substring *Substring `protobuf:"bytes,13,opt,name=substring,proto3,oneof"` 378 + } 379 + 380 + type Q_And struct { 381 + And *And `protobuf:"bytes,14,opt,name=and,proto3,oneof"` 382 + } 383 + 384 + type Q_Or struct { 385 + Or *Or `protobuf:"bytes,15,opt,name=or,proto3,oneof"` 386 + } 387 + 388 + type Q_Not struct { 389 + Not *Not `protobuf:"bytes,16,opt,name=not,proto3,oneof"` 390 + } 391 + 392 + type Q_Branch struct { 393 + Branch *Branch `protobuf:"bytes,17,opt,name=branch,proto3,oneof"` 394 + } 395 + 396 + func (*Q_RawConfig) isQ_Query() {} 397 + 398 + func (*Q_Regexp) isQ_Query() {} 399 + 400 + func (*Q_Symbol) isQ_Query() {} 401 + 402 + func (*Q_Language) isQ_Query() {} 403 + 404 + func (*Q_Const) isQ_Query() {} 405 + 406 + func (*Q_Repo) isQ_Query() {} 407 + 408 + func (*Q_RepoRegexp) isQ_Query() {} 409 + 410 + func (*Q_BranchesRepos) isQ_Query() {} 411 + 412 + func (*Q_RepoIds) isQ_Query() {} 413 + 414 + func (*Q_RepoSet) isQ_Query() {} 415 + 416 + func (*Q_FileNameSet) isQ_Query() {} 417 + 418 + func (*Q_Type) isQ_Query() {} 419 + 420 + func (*Q_Substring) isQ_Query() {} 421 + 422 + func (*Q_And) isQ_Query() {} 423 + 424 + func (*Q_Or) isQ_Query() {} 425 + 426 + func (*Q_Not) isQ_Query() {} 427 + 428 + func (*Q_Branch) isQ_Query() {} 429 + 430 + // RawConfig filters repositories based on their encoded RawConfig map. 431 + type RawConfig struct { 432 + state protoimpl.MessageState 433 + sizeCache protoimpl.SizeCache 434 + unknownFields protoimpl.UnknownFields 435 + 436 + Flags []RawConfig_Flag `protobuf:"varint,1,rep,packed,name=flags,proto3,enum=grpc.v1.RawConfig_Flag" json:"flags,omitempty"` 437 + } 438 + 439 + func (x *RawConfig) Reset() { 440 + *x = RawConfig{} 441 + if protoimpl.UnsafeEnabled { 442 + mi := &file_query_proto_msgTypes[1] 443 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 444 + ms.StoreMessageInfo(mi) 445 + } 446 + } 447 + 448 + func (x *RawConfig) String() string { 449 + return protoimpl.X.MessageStringOf(x) 450 + } 451 + 452 + func (*RawConfig) ProtoMessage() {} 453 + 454 + func (x *RawConfig) ProtoReflect() protoreflect.Message { 455 + mi := &file_query_proto_msgTypes[1] 456 + if protoimpl.UnsafeEnabled && x != nil { 457 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 458 + if ms.LoadMessageInfo() == nil { 459 + ms.StoreMessageInfo(mi) 460 + } 461 + return ms 462 + } 463 + return mi.MessageOf(x) 464 + } 465 + 466 + // Deprecated: Use RawConfig.ProtoReflect.Descriptor instead. 467 + func (*RawConfig) Descriptor() ([]byte, []int) { 468 + return file_query_proto_rawDescGZIP(), []int{1} 469 + } 470 + 471 + func (x *RawConfig) GetFlags() []RawConfig_Flag { 472 + if x != nil { 473 + return x.Flags 474 + } 475 + return nil 476 + } 477 + 478 + // Regexp is a query looking for regular expressions matches. 479 + type Regexp struct { 480 + state protoimpl.MessageState 481 + sizeCache protoimpl.SizeCache 482 + unknownFields protoimpl.UnknownFields 483 + 484 + Regexp string `protobuf:"bytes,1,opt,name=regexp,proto3" json:"regexp,omitempty"` 485 + FileName bool `protobuf:"varint,2,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` 486 + Content bool `protobuf:"varint,3,opt,name=content,proto3" json:"content,omitempty"` 487 + CaseSensitive bool `protobuf:"varint,4,opt,name=case_sensitive,json=caseSensitive,proto3" json:"case_sensitive,omitempty"` 488 + } 489 + 490 + func (x *Regexp) Reset() { 491 + *x = Regexp{} 492 + if protoimpl.UnsafeEnabled { 493 + mi := &file_query_proto_msgTypes[2] 494 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 495 + ms.StoreMessageInfo(mi) 496 + } 497 + } 498 + 499 + func (x *Regexp) String() string { 500 + return protoimpl.X.MessageStringOf(x) 501 + } 502 + 503 + func (*Regexp) ProtoMessage() {} 504 + 505 + func (x *Regexp) ProtoReflect() protoreflect.Message { 506 + mi := &file_query_proto_msgTypes[2] 507 + if protoimpl.UnsafeEnabled && x != nil { 508 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 509 + if ms.LoadMessageInfo() == nil { 510 + ms.StoreMessageInfo(mi) 511 + } 512 + return ms 513 + } 514 + return mi.MessageOf(x) 515 + } 516 + 517 + // Deprecated: Use Regexp.ProtoReflect.Descriptor instead. 518 + func (*Regexp) Descriptor() ([]byte, []int) { 519 + return file_query_proto_rawDescGZIP(), []int{2} 520 + } 521 + 522 + func (x *Regexp) GetRegexp() string { 523 + if x != nil { 524 + return x.Regexp 525 + } 526 + return "" 527 + } 528 + 529 + func (x *Regexp) GetFileName() bool { 530 + if x != nil { 531 + return x.FileName 532 + } 533 + return false 534 + } 535 + 536 + func (x *Regexp) GetContent() bool { 537 + if x != nil { 538 + return x.Content 539 + } 540 + return false 541 + } 542 + 543 + func (x *Regexp) GetCaseSensitive() bool { 544 + if x != nil { 545 + return x.CaseSensitive 546 + } 547 + return false 548 + } 549 + 550 + type Symbol struct { 551 + state protoimpl.MessageState 552 + sizeCache protoimpl.SizeCache 553 + unknownFields protoimpl.UnknownFields 554 + 555 + Expr *Q `protobuf:"bytes,1,opt,name=expr,proto3" json:"expr,omitempty"` 556 + } 557 + 558 + func (x *Symbol) Reset() { 559 + *x = Symbol{} 560 + if protoimpl.UnsafeEnabled { 561 + mi := &file_query_proto_msgTypes[3] 562 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 563 + ms.StoreMessageInfo(mi) 564 + } 565 + } 566 + 567 + func (x *Symbol) String() string { 568 + return protoimpl.X.MessageStringOf(x) 569 + } 570 + 571 + func (*Symbol) ProtoMessage() {} 572 + 573 + func (x *Symbol) ProtoReflect() protoreflect.Message { 574 + mi := &file_query_proto_msgTypes[3] 575 + if protoimpl.UnsafeEnabled && x != nil { 576 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 577 + if ms.LoadMessageInfo() == nil { 578 + ms.StoreMessageInfo(mi) 579 + } 580 + return ms 581 + } 582 + return mi.MessageOf(x) 583 + } 584 + 585 + // Deprecated: Use Symbol.ProtoReflect.Descriptor instead. 586 + func (*Symbol) Descriptor() ([]byte, []int) { 587 + return file_query_proto_rawDescGZIP(), []int{3} 588 + } 589 + 590 + func (x *Symbol) GetExpr() *Q { 591 + if x != nil { 592 + return x.Expr 593 + } 594 + return nil 595 + } 596 + 597 + type Language struct { 598 + state protoimpl.MessageState 599 + sizeCache protoimpl.SizeCache 600 + unknownFields protoimpl.UnknownFields 601 + 602 + Language string `protobuf:"bytes,1,opt,name=language,proto3" json:"language,omitempty"` 603 + } 604 + 605 + func (x *Language) Reset() { 606 + *x = Language{} 607 + if protoimpl.UnsafeEnabled { 608 + mi := &file_query_proto_msgTypes[4] 609 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 610 + ms.StoreMessageInfo(mi) 611 + } 612 + } 613 + 614 + func (x *Language) String() string { 615 + return protoimpl.X.MessageStringOf(x) 616 + } 617 + 618 + func (*Language) ProtoMessage() {} 619 + 620 + func (x *Language) ProtoReflect() protoreflect.Message { 621 + mi := &file_query_proto_msgTypes[4] 622 + if protoimpl.UnsafeEnabled && x != nil { 623 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 624 + if ms.LoadMessageInfo() == nil { 625 + ms.StoreMessageInfo(mi) 626 + } 627 + return ms 628 + } 629 + return mi.MessageOf(x) 630 + } 631 + 632 + // Deprecated: Use Language.ProtoReflect.Descriptor instead. 633 + func (*Language) Descriptor() ([]byte, []int) { 634 + return file_query_proto_rawDescGZIP(), []int{4} 635 + } 636 + 637 + func (x *Language) GetLanguage() string { 638 + if x != nil { 639 + return x.Language 640 + } 641 + return "" 642 + } 643 + 644 + type Repo struct { 645 + state protoimpl.MessageState 646 + sizeCache protoimpl.SizeCache 647 + unknownFields protoimpl.UnknownFields 648 + 649 + Regexp string `protobuf:"bytes,1,opt,name=regexp,proto3" json:"regexp,omitempty"` 650 + } 651 + 652 + func (x *Repo) Reset() { 653 + *x = Repo{} 654 + if protoimpl.UnsafeEnabled { 655 + mi := &file_query_proto_msgTypes[5] 656 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 657 + ms.StoreMessageInfo(mi) 658 + } 659 + } 660 + 661 + func (x *Repo) String() string { 662 + return protoimpl.X.MessageStringOf(x) 663 + } 664 + 665 + func (*Repo) ProtoMessage() {} 666 + 667 + func (x *Repo) ProtoReflect() protoreflect.Message { 668 + mi := &file_query_proto_msgTypes[5] 669 + if protoimpl.UnsafeEnabled && x != nil { 670 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 671 + if ms.LoadMessageInfo() == nil { 672 + ms.StoreMessageInfo(mi) 673 + } 674 + return ms 675 + } 676 + return mi.MessageOf(x) 677 + } 678 + 679 + // Deprecated: Use Repo.ProtoReflect.Descriptor instead. 680 + func (*Repo) Descriptor() ([]byte, []int) { 681 + return file_query_proto_rawDescGZIP(), []int{5} 682 + } 683 + 684 + func (x *Repo) GetRegexp() string { 685 + if x != nil { 686 + return x.Regexp 687 + } 688 + return "" 689 + } 690 + 691 + type RepoRegexp struct { 692 + state protoimpl.MessageState 693 + sizeCache protoimpl.SizeCache 694 + unknownFields protoimpl.UnknownFields 695 + 696 + Regexp string `protobuf:"bytes,1,opt,name=regexp,proto3" json:"regexp,omitempty"` 697 + } 698 + 699 + func (x *RepoRegexp) Reset() { 700 + *x = RepoRegexp{} 701 + if protoimpl.UnsafeEnabled { 702 + mi := &file_query_proto_msgTypes[6] 703 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 704 + ms.StoreMessageInfo(mi) 705 + } 706 + } 707 + 708 + func (x *RepoRegexp) String() string { 709 + return protoimpl.X.MessageStringOf(x) 710 + } 711 + 712 + func (*RepoRegexp) ProtoMessage() {} 713 + 714 + func (x *RepoRegexp) ProtoReflect() protoreflect.Message { 715 + mi := &file_query_proto_msgTypes[6] 716 + if protoimpl.UnsafeEnabled && x != nil { 717 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 718 + if ms.LoadMessageInfo() == nil { 719 + ms.StoreMessageInfo(mi) 720 + } 721 + return ms 722 + } 723 + return mi.MessageOf(x) 724 + } 725 + 726 + // Deprecated: Use RepoRegexp.ProtoReflect.Descriptor instead. 727 + func (*RepoRegexp) Descriptor() ([]byte, []int) { 728 + return file_query_proto_rawDescGZIP(), []int{6} 729 + } 730 + 731 + func (x *RepoRegexp) GetRegexp() string { 732 + if x != nil { 733 + return x.Regexp 734 + } 735 + return "" 736 + } 737 + 738 + // BranchesRepos is a slice of BranchRepos to match. 739 + type BranchesRepos struct { 740 + state protoimpl.MessageState 741 + sizeCache protoimpl.SizeCache 742 + unknownFields protoimpl.UnknownFields 743 + 744 + List []*BranchRepos `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` 745 + } 746 + 747 + func (x *BranchesRepos) Reset() { 748 + *x = BranchesRepos{} 749 + if protoimpl.UnsafeEnabled { 750 + mi := &file_query_proto_msgTypes[7] 751 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 752 + ms.StoreMessageInfo(mi) 753 + } 754 + } 755 + 756 + func (x *BranchesRepos) String() string { 757 + return protoimpl.X.MessageStringOf(x) 758 + } 759 + 760 + func (*BranchesRepos) ProtoMessage() {} 761 + 762 + func (x *BranchesRepos) ProtoReflect() protoreflect.Message { 763 + mi := &file_query_proto_msgTypes[7] 764 + if protoimpl.UnsafeEnabled && x != nil { 765 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 766 + if ms.LoadMessageInfo() == nil { 767 + ms.StoreMessageInfo(mi) 768 + } 769 + return ms 770 + } 771 + return mi.MessageOf(x) 772 + } 773 + 774 + // Deprecated: Use BranchesRepos.ProtoReflect.Descriptor instead. 775 + func (*BranchesRepos) Descriptor() ([]byte, []int) { 776 + return file_query_proto_rawDescGZIP(), []int{7} 777 + } 778 + 779 + func (x *BranchesRepos) GetList() []*BranchRepos { 780 + if x != nil { 781 + return x.List 782 + } 783 + return nil 784 + } 785 + 786 + // BranchRepos is a (branch, sourcegraph repo ids bitmap) tuple. It is a 787 + // Sourcegraph addition. 788 + type BranchRepos struct { 789 + state protoimpl.MessageState 790 + sizeCache protoimpl.SizeCache 791 + unknownFields protoimpl.UnknownFields 792 + 793 + Branch string `protobuf:"bytes,1,opt,name=branch,proto3" json:"branch,omitempty"` 794 + // a serialized roaring bitmap of the target repo ids 795 + Repos []byte `protobuf:"bytes,2,opt,name=repos,proto3" json:"repos,omitempty"` 796 + } 797 + 798 + func (x *BranchRepos) Reset() { 799 + *x = BranchRepos{} 800 + if protoimpl.UnsafeEnabled { 801 + mi := &file_query_proto_msgTypes[8] 802 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 803 + ms.StoreMessageInfo(mi) 804 + } 805 + } 806 + 807 + func (x *BranchRepos) String() string { 808 + return protoimpl.X.MessageStringOf(x) 809 + } 810 + 811 + func (*BranchRepos) ProtoMessage() {} 812 + 813 + func (x *BranchRepos) ProtoReflect() protoreflect.Message { 814 + mi := &file_query_proto_msgTypes[8] 815 + if protoimpl.UnsafeEnabled && x != nil { 816 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 817 + if ms.LoadMessageInfo() == nil { 818 + ms.StoreMessageInfo(mi) 819 + } 820 + return ms 821 + } 822 + return mi.MessageOf(x) 823 + } 824 + 825 + // Deprecated: Use BranchRepos.ProtoReflect.Descriptor instead. 826 + func (*BranchRepos) Descriptor() ([]byte, []int) { 827 + return file_query_proto_rawDescGZIP(), []int{8} 828 + } 829 + 830 + func (x *BranchRepos) GetBranch() string { 831 + if x != nil { 832 + return x.Branch 833 + } 834 + return "" 835 + } 836 + 837 + func (x *BranchRepos) GetRepos() []byte { 838 + if x != nil { 839 + return x.Repos 840 + } 841 + return nil 842 + } 843 + 844 + // Similar to BranchRepos but will be used to match only by repoid and 845 + // therefore matches all branches 846 + type RepoIds struct { 847 + state protoimpl.MessageState 848 + sizeCache protoimpl.SizeCache 849 + unknownFields protoimpl.UnknownFields 850 + 851 + // a serialized roaring bitmap of the target repo ids 852 + Repos []byte `protobuf:"bytes,1,opt,name=repos,proto3" json:"repos,omitempty"` 853 + } 854 + 855 + func (x *RepoIds) Reset() { 856 + *x = RepoIds{} 857 + if protoimpl.UnsafeEnabled { 858 + mi := &file_query_proto_msgTypes[9] 859 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 860 + ms.StoreMessageInfo(mi) 861 + } 862 + } 863 + 864 + func (x *RepoIds) String() string { 865 + return protoimpl.X.MessageStringOf(x) 866 + } 867 + 868 + func (*RepoIds) ProtoMessage() {} 869 + 870 + func (x *RepoIds) ProtoReflect() protoreflect.Message { 871 + mi := &file_query_proto_msgTypes[9] 872 + if protoimpl.UnsafeEnabled && x != nil { 873 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 874 + if ms.LoadMessageInfo() == nil { 875 + ms.StoreMessageInfo(mi) 876 + } 877 + return ms 878 + } 879 + return mi.MessageOf(x) 880 + } 881 + 882 + // Deprecated: Use RepoIds.ProtoReflect.Descriptor instead. 883 + func (*RepoIds) Descriptor() ([]byte, []int) { 884 + return file_query_proto_rawDescGZIP(), []int{9} 885 + } 886 + 887 + func (x *RepoIds) GetRepos() []byte { 888 + if x != nil { 889 + return x.Repos 890 + } 891 + return nil 892 + } 893 + 894 + // RepoSet is a list of repos to match. 895 + type RepoSet struct { 896 + state protoimpl.MessageState 897 + sizeCache protoimpl.SizeCache 898 + unknownFields protoimpl.UnknownFields 899 + 900 + Set map[string]bool `protobuf:"bytes,1,rep,name=set,proto3" json:"set,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` 901 + } 902 + 903 + func (x *RepoSet) Reset() { 904 + *x = RepoSet{} 905 + if protoimpl.UnsafeEnabled { 906 + mi := &file_query_proto_msgTypes[10] 907 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 908 + ms.StoreMessageInfo(mi) 909 + } 910 + } 911 + 912 + func (x *RepoSet) String() string { 913 + return protoimpl.X.MessageStringOf(x) 914 + } 915 + 916 + func (*RepoSet) ProtoMessage() {} 917 + 918 + func (x *RepoSet) ProtoReflect() protoreflect.Message { 919 + mi := &file_query_proto_msgTypes[10] 920 + if protoimpl.UnsafeEnabled && x != nil { 921 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 922 + if ms.LoadMessageInfo() == nil { 923 + ms.StoreMessageInfo(mi) 924 + } 925 + return ms 926 + } 927 + return mi.MessageOf(x) 928 + } 929 + 930 + // Deprecated: Use RepoSet.ProtoReflect.Descriptor instead. 931 + func (*RepoSet) Descriptor() ([]byte, []int) { 932 + return file_query_proto_rawDescGZIP(), []int{10} 933 + } 934 + 935 + func (x *RepoSet) GetSet() map[string]bool { 936 + if x != nil { 937 + return x.Set 938 + } 939 + return nil 940 + } 941 + 942 + // FileNameSet is a list of file names to match. 943 + type FileNameSet struct { 944 + state protoimpl.MessageState 945 + sizeCache protoimpl.SizeCache 946 + unknownFields protoimpl.UnknownFields 947 + 948 + Set []string `protobuf:"bytes,1,rep,name=set,proto3" json:"set,omitempty"` 949 + } 950 + 951 + func (x *FileNameSet) Reset() { 952 + *x = FileNameSet{} 953 + if protoimpl.UnsafeEnabled { 954 + mi := &file_query_proto_msgTypes[11] 955 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 956 + ms.StoreMessageInfo(mi) 957 + } 958 + } 959 + 960 + func (x *FileNameSet) String() string { 961 + return protoimpl.X.MessageStringOf(x) 962 + } 963 + 964 + func (*FileNameSet) ProtoMessage() {} 965 + 966 + func (x *FileNameSet) ProtoReflect() protoreflect.Message { 967 + mi := &file_query_proto_msgTypes[11] 968 + if protoimpl.UnsafeEnabled && x != nil { 969 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 970 + if ms.LoadMessageInfo() == nil { 971 + ms.StoreMessageInfo(mi) 972 + } 973 + return ms 974 + } 975 + return mi.MessageOf(x) 976 + } 977 + 978 + // Deprecated: Use FileNameSet.ProtoReflect.Descriptor instead. 979 + func (*FileNameSet) Descriptor() ([]byte, []int) { 980 + return file_query_proto_rawDescGZIP(), []int{11} 981 + } 982 + 983 + func (x *FileNameSet) GetSet() []string { 984 + if x != nil { 985 + return x.Set 986 + } 987 + return nil 988 + } 989 + 990 + // Type changes the result type returned. 991 + type Type struct { 992 + state protoimpl.MessageState 993 + sizeCache protoimpl.SizeCache 994 + unknownFields protoimpl.UnknownFields 995 + 996 + Child *Q `protobuf:"bytes,1,opt,name=child,proto3" json:"child,omitempty"` 997 + // TODO: type constants 998 + Type Type_Kind `protobuf:"varint,2,opt,name=type,proto3,enum=grpc.v1.Type_Kind" json:"type,omitempty"` 999 + } 1000 + 1001 + func (x *Type) Reset() { 1002 + *x = Type{} 1003 + if protoimpl.UnsafeEnabled { 1004 + mi := &file_query_proto_msgTypes[12] 1005 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1006 + ms.StoreMessageInfo(mi) 1007 + } 1008 + } 1009 + 1010 + func (x *Type) String() string { 1011 + return protoimpl.X.MessageStringOf(x) 1012 + } 1013 + 1014 + func (*Type) ProtoMessage() {} 1015 + 1016 + func (x *Type) ProtoReflect() protoreflect.Message { 1017 + mi := &file_query_proto_msgTypes[12] 1018 + if protoimpl.UnsafeEnabled && x != nil { 1019 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1020 + if ms.LoadMessageInfo() == nil { 1021 + ms.StoreMessageInfo(mi) 1022 + } 1023 + return ms 1024 + } 1025 + return mi.MessageOf(x) 1026 + } 1027 + 1028 + // Deprecated: Use Type.ProtoReflect.Descriptor instead. 1029 + func (*Type) Descriptor() ([]byte, []int) { 1030 + return file_query_proto_rawDescGZIP(), []int{12} 1031 + } 1032 + 1033 + func (x *Type) GetChild() *Q { 1034 + if x != nil { 1035 + return x.Child 1036 + } 1037 + return nil 1038 + } 1039 + 1040 + func (x *Type) GetType() Type_Kind { 1041 + if x != nil { 1042 + return x.Type 1043 + } 1044 + return Type_UNKNOWN 1045 + } 1046 + 1047 + type Substring struct { 1048 + state protoimpl.MessageState 1049 + sizeCache protoimpl.SizeCache 1050 + unknownFields protoimpl.UnknownFields 1051 + 1052 + Pattern string `protobuf:"bytes,1,opt,name=pattern,proto3" json:"pattern,omitempty"` 1053 + CaseSensitive bool `protobuf:"varint,2,opt,name=case_sensitive,json=caseSensitive,proto3" json:"case_sensitive,omitempty"` 1054 + // Match only filename 1055 + FileName bool `protobuf:"varint,3,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` 1056 + // Match only content 1057 + Content bool `protobuf:"varint,4,opt,name=content,proto3" json:"content,omitempty"` 1058 + } 1059 + 1060 + func (x *Substring) Reset() { 1061 + *x = Substring{} 1062 + if protoimpl.UnsafeEnabled { 1063 + mi := &file_query_proto_msgTypes[13] 1064 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1065 + ms.StoreMessageInfo(mi) 1066 + } 1067 + } 1068 + 1069 + func (x *Substring) String() string { 1070 + return protoimpl.X.MessageStringOf(x) 1071 + } 1072 + 1073 + func (*Substring) ProtoMessage() {} 1074 + 1075 + func (x *Substring) ProtoReflect() protoreflect.Message { 1076 + mi := &file_query_proto_msgTypes[13] 1077 + if protoimpl.UnsafeEnabled && x != nil { 1078 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1079 + if ms.LoadMessageInfo() == nil { 1080 + ms.StoreMessageInfo(mi) 1081 + } 1082 + return ms 1083 + } 1084 + return mi.MessageOf(x) 1085 + } 1086 + 1087 + // Deprecated: Use Substring.ProtoReflect.Descriptor instead. 1088 + func (*Substring) Descriptor() ([]byte, []int) { 1089 + return file_query_proto_rawDescGZIP(), []int{13} 1090 + } 1091 + 1092 + func (x *Substring) GetPattern() string { 1093 + if x != nil { 1094 + return x.Pattern 1095 + } 1096 + return "" 1097 + } 1098 + 1099 + func (x *Substring) GetCaseSensitive() bool { 1100 + if x != nil { 1101 + return x.CaseSensitive 1102 + } 1103 + return false 1104 + } 1105 + 1106 + func (x *Substring) GetFileName() bool { 1107 + if x != nil { 1108 + return x.FileName 1109 + } 1110 + return false 1111 + } 1112 + 1113 + func (x *Substring) GetContent() bool { 1114 + if x != nil { 1115 + return x.Content 1116 + } 1117 + return false 1118 + } 1119 + 1120 + // And is matched when all its children are. 1121 + type And struct { 1122 + state protoimpl.MessageState 1123 + sizeCache protoimpl.SizeCache 1124 + unknownFields protoimpl.UnknownFields 1125 + 1126 + Children []*Q `protobuf:"bytes,1,rep,name=children,proto3" json:"children,omitempty"` 1127 + } 1128 + 1129 + func (x *And) Reset() { 1130 + *x = And{} 1131 + if protoimpl.UnsafeEnabled { 1132 + mi := &file_query_proto_msgTypes[14] 1133 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1134 + ms.StoreMessageInfo(mi) 1135 + } 1136 + } 1137 + 1138 + func (x *And) String() string { 1139 + return protoimpl.X.MessageStringOf(x) 1140 + } 1141 + 1142 + func (*And) ProtoMessage() {} 1143 + 1144 + func (x *And) ProtoReflect() protoreflect.Message { 1145 + mi := &file_query_proto_msgTypes[14] 1146 + if protoimpl.UnsafeEnabled && x != nil { 1147 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1148 + if ms.LoadMessageInfo() == nil { 1149 + ms.StoreMessageInfo(mi) 1150 + } 1151 + return ms 1152 + } 1153 + return mi.MessageOf(x) 1154 + } 1155 + 1156 + // Deprecated: Use And.ProtoReflect.Descriptor instead. 1157 + func (*And) Descriptor() ([]byte, []int) { 1158 + return file_query_proto_rawDescGZIP(), []int{14} 1159 + } 1160 + 1161 + func (x *And) GetChildren() []*Q { 1162 + if x != nil { 1163 + return x.Children 1164 + } 1165 + return nil 1166 + } 1167 + 1168 + // Or is matched when any of its children is matched. 1169 + type Or struct { 1170 + state protoimpl.MessageState 1171 + sizeCache protoimpl.SizeCache 1172 + unknownFields protoimpl.UnknownFields 1173 + 1174 + Children []*Q `protobuf:"bytes,1,rep,name=children,proto3" json:"children,omitempty"` 1175 + } 1176 + 1177 + func (x *Or) Reset() { 1178 + *x = Or{} 1179 + if protoimpl.UnsafeEnabled { 1180 + mi := &file_query_proto_msgTypes[15] 1181 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1182 + ms.StoreMessageInfo(mi) 1183 + } 1184 + } 1185 + 1186 + func (x *Or) String() string { 1187 + return protoimpl.X.MessageStringOf(x) 1188 + } 1189 + 1190 + func (*Or) ProtoMessage() {} 1191 + 1192 + func (x *Or) ProtoReflect() protoreflect.Message { 1193 + mi := &file_query_proto_msgTypes[15] 1194 + if protoimpl.UnsafeEnabled && x != nil { 1195 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1196 + if ms.LoadMessageInfo() == nil { 1197 + ms.StoreMessageInfo(mi) 1198 + } 1199 + return ms 1200 + } 1201 + return mi.MessageOf(x) 1202 + } 1203 + 1204 + // Deprecated: Use Or.ProtoReflect.Descriptor instead. 1205 + func (*Or) Descriptor() ([]byte, []int) { 1206 + return file_query_proto_rawDescGZIP(), []int{15} 1207 + } 1208 + 1209 + func (x *Or) GetChildren() []*Q { 1210 + if x != nil { 1211 + return x.Children 1212 + } 1213 + return nil 1214 + } 1215 + 1216 + // Not inverts the meaning of its child. 1217 + type Not struct { 1218 + state protoimpl.MessageState 1219 + sizeCache protoimpl.SizeCache 1220 + unknownFields protoimpl.UnknownFields 1221 + 1222 + Child *Q `protobuf:"bytes,1,opt,name=child,proto3" json:"child,omitempty"` 1223 + } 1224 + 1225 + func (x *Not) Reset() { 1226 + *x = Not{} 1227 + if protoimpl.UnsafeEnabled { 1228 + mi := &file_query_proto_msgTypes[16] 1229 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1230 + ms.StoreMessageInfo(mi) 1231 + } 1232 + } 1233 + 1234 + func (x *Not) String() string { 1235 + return protoimpl.X.MessageStringOf(x) 1236 + } 1237 + 1238 + func (*Not) ProtoMessage() {} 1239 + 1240 + func (x *Not) ProtoReflect() protoreflect.Message { 1241 + mi := &file_query_proto_msgTypes[16] 1242 + if protoimpl.UnsafeEnabled && x != nil { 1243 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1244 + if ms.LoadMessageInfo() == nil { 1245 + ms.StoreMessageInfo(mi) 1246 + } 1247 + return ms 1248 + } 1249 + return mi.MessageOf(x) 1250 + } 1251 + 1252 + // Deprecated: Use Not.ProtoReflect.Descriptor instead. 1253 + func (*Not) Descriptor() ([]byte, []int) { 1254 + return file_query_proto_rawDescGZIP(), []int{16} 1255 + } 1256 + 1257 + func (x *Not) GetChild() *Q { 1258 + if x != nil { 1259 + return x.Child 1260 + } 1261 + return nil 1262 + } 1263 + 1264 + // Branch limits search to a specific branch. 1265 + type Branch struct { 1266 + state protoimpl.MessageState 1267 + sizeCache protoimpl.SizeCache 1268 + unknownFields protoimpl.UnknownFields 1269 + 1270 + Pattern string `protobuf:"bytes,1,opt,name=pattern,proto3" json:"pattern,omitempty"` 1271 + // exact is true if we want to Pattern to equal branch. 1272 + Exact bool `protobuf:"varint,2,opt,name=exact,proto3" json:"exact,omitempty"` 1273 + } 1274 + 1275 + func (x *Branch) Reset() { 1276 + *x = Branch{} 1277 + if protoimpl.UnsafeEnabled { 1278 + mi := &file_query_proto_msgTypes[17] 1279 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1280 + ms.StoreMessageInfo(mi) 1281 + } 1282 + } 1283 + 1284 + func (x *Branch) String() string { 1285 + return protoimpl.X.MessageStringOf(x) 1286 + } 1287 + 1288 + func (*Branch) ProtoMessage() {} 1289 + 1290 + func (x *Branch) ProtoReflect() protoreflect.Message { 1291 + mi := &file_query_proto_msgTypes[17] 1292 + if protoimpl.UnsafeEnabled && x != nil { 1293 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1294 + if ms.LoadMessageInfo() == nil { 1295 + ms.StoreMessageInfo(mi) 1296 + } 1297 + return ms 1298 + } 1299 + return mi.MessageOf(x) 1300 + } 1301 + 1302 + // Deprecated: Use Branch.ProtoReflect.Descriptor instead. 1303 + func (*Branch) Descriptor() ([]byte, []int) { 1304 + return file_query_proto_rawDescGZIP(), []int{17} 1305 + } 1306 + 1307 + func (x *Branch) GetPattern() string { 1308 + if x != nil { 1309 + return x.Pattern 1310 + } 1311 + return "" 1312 + } 1313 + 1314 + func (x *Branch) GetExact() bool { 1315 + if x != nil { 1316 + return x.Exact 1317 + } 1318 + return false 1319 + } 1320 + 1321 + var File_query_proto protoreflect.FileDescriptor 1322 + 1323 + var file_query_proto_rawDesc = []byte{ 1324 + 0x0a, 0x0b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x67, 1325 + 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 1326 + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 1327 + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 1328 + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 1329 + 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 1330 + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 1331 + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xff, 0x05, 0x0a, 0x01, 0x51, 0x12, 0x33, 0x0a, 0x0a, 0x72, 0x61, 1332 + 0x77, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 1333 + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x77, 0x43, 0x6f, 0x6e, 0x66, 1334 + 0x69, 0x67, 0x48, 0x00, 0x52, 0x09, 0x72, 0x61, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 1335 + 0x29, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 1336 + 0x0f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x65, 0x78, 0x70, 1337 + 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x67, 0x65, 0x78, 0x70, 0x12, 0x29, 0x0a, 0x06, 0x73, 0x79, 1338 + 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x67, 0x72, 0x70, 1339 + 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x48, 0x00, 0x52, 0x06, 0x73, 1340 + 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x2f, 0x0a, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 1341 + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 1342 + 0x31, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x08, 0x6c, 0x61, 1343 + 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x05, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x18, 1344 + 0x05, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x05, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x12, 0x23, 1345 + 0x0a, 0x04, 0x72, 0x65, 0x70, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x67, 1346 + 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x48, 0x00, 0x52, 0x04, 0x72, 1347 + 0x65, 0x70, 0x6f, 0x12, 0x36, 0x0a, 0x0b, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x72, 0x65, 0x67, 0x65, 1348 + 0x78, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 1349 + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x67, 0x65, 0x78, 0x70, 0x48, 0x00, 0x52, 1350 + 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x67, 0x65, 0x78, 0x70, 0x12, 0x3f, 0x0a, 0x0e, 0x62, 1351 + 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x18, 0x08, 0x20, 1352 + 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 1353 + 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x48, 0x00, 0x52, 0x0d, 0x62, 1354 + 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x12, 0x2d, 0x0a, 0x08, 1355 + 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 1356 + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x49, 0x64, 0x73, 1357 + 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x49, 0x64, 0x73, 0x12, 0x2d, 0x0a, 0x08, 0x72, 1358 + 0x65, 0x70, 0x6f, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 1359 + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x53, 0x65, 0x74, 0x48, 1360 + 0x00, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x53, 0x65, 0x74, 0x12, 0x3a, 0x0a, 0x0d, 0x66, 0x69, 1361 + 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 1362 + 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x65, 1363 + 0x4e, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x66, 0x69, 0x6c, 0x65, 0x4e, 1364 + 0x61, 0x6d, 0x65, 0x53, 0x65, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 1365 + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x54, 1366 + 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x73, 1367 + 0x75, 0x62, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 1368 + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x74, 0x72, 0x69, 1369 + 0x6e, 0x67, 0x48, 0x00, 0x52, 0x09, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 1370 + 0x20, 0x0a, 0x03, 0x61, 0x6e, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x67, 1371 + 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x03, 0x61, 0x6e, 1372 + 0x64, 0x12, 0x1d, 0x0a, 0x02, 0x6f, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 1373 + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x48, 0x00, 0x52, 0x02, 0x6f, 0x72, 1374 + 0x12, 0x20, 0x0a, 0x03, 0x6e, 0x6f, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 1375 + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x74, 0x48, 0x00, 0x52, 0x03, 0x6e, 1376 + 0x6f, 0x74, 0x12, 0x29, 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x11, 0x20, 0x01, 1377 + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x61, 1378 + 0x6e, 0x63, 0x68, 0x48, 0x00, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x42, 0x07, 0x0a, 1379 + 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0xb4, 0x01, 0x0a, 0x09, 0x52, 0x61, 0x77, 0x43, 0x6f, 1380 + 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2d, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x01, 0x20, 1381 + 0x03, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 1382 + 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x05, 0x66, 0x6c, 1383 + 0x61, 0x67, 0x73, 0x22, 0x78, 0x0a, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x0b, 0x0a, 0x07, 0x55, 1384 + 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x4e, 0x4c, 0x59, 1385 + 0x5f, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x4e, 0x4c, 1386 + 0x59, 0x5f, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 1387 + 0x4e, 0x4c, 0x59, 0x5f, 0x46, 0x4f, 0x52, 0x4b, 0x53, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x4e, 1388 + 0x4f, 0x5f, 0x46, 0x4f, 0x52, 0x4b, 0x53, 0x10, 0x08, 0x12, 0x11, 0x0a, 0x0d, 0x4f, 0x4e, 0x4c, 1389 + 0x59, 0x5f, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, 0x45, 0x44, 0x10, 0x10, 0x12, 0x0f, 0x0a, 0x0b, 1390 + 0x4e, 0x4f, 0x5f, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, 0x45, 0x44, 0x10, 0x20, 0x22, 0x7e, 0x0a, 1391 + 0x06, 0x52, 0x65, 0x67, 0x65, 0x78, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x65, 0x78, 1392 + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x65, 0x78, 0x70, 0x12, 1393 + 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 1394 + 0x28, 0x08, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 1395 + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x63, 1396 + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x61, 0x73, 0x65, 0x5f, 0x73, 1397 + 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 1398 + 0x63, 0x61, 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x22, 0x28, 0x0a, 1399 + 0x06, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x1e, 0x0a, 0x04, 0x65, 0x78, 0x70, 0x72, 0x18, 1400 + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 1401 + 0x51, 0x52, 0x04, 0x65, 0x78, 0x70, 0x72, 0x22, 0x26, 0x0a, 0x08, 0x4c, 0x61, 0x6e, 0x67, 0x75, 1402 + 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, 1403 + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x22, 1404 + 0x1e, 0x0a, 0x04, 0x52, 0x65, 0x70, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x65, 0x78, 1405 + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x65, 0x78, 0x70, 0x22, 1406 + 0x24, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x67, 0x65, 0x78, 0x70, 0x12, 0x16, 0x0a, 1407 + 0x06, 0x72, 0x65, 0x67, 0x65, 0x78, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 1408 + 0x65, 0x67, 0x65, 0x78, 0x70, 0x22, 0x39, 0x0a, 0x0d, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 1409 + 0x73, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x12, 0x28, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 1410 + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x42, 1411 + 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 1412 + 0x22, 0x3b, 0x0a, 0x0b, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x12, 1413 + 0x16, 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 1414 + 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x70, 0x6f, 0x73, 1415 + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x22, 0x1f, 0x0a, 1416 + 0x07, 0x52, 0x65, 0x70, 0x6f, 0x49, 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x70, 0x6f, 1417 + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x22, 0x6e, 1418 + 0x0a, 0x07, 0x52, 0x65, 0x70, 0x6f, 0x53, 0x65, 0x74, 0x12, 0x2b, 0x0a, 0x03, 0x73, 0x65, 0x74, 1419 + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 1420 + 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x53, 0x65, 0x74, 0x2e, 0x53, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x72, 1421 + 0x79, 0x52, 0x03, 0x73, 0x65, 0x74, 0x1a, 0x36, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x45, 0x6e, 0x74, 1422 + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 1423 + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 1424 + 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x1f, 1425 + 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x74, 0x12, 0x10, 0x0a, 1426 + 0x03, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x73, 0x65, 0x74, 0x22, 1427 + 0x8e, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x05, 0x63, 0x68, 0x69, 0x6c, 1428 + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 1429 + 0x31, 0x2e, 0x51, 0x52, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x12, 0x26, 0x0a, 0x04, 0x74, 0x79, 1430 + 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 1431 + 0x76, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x74, 0x79, 1432 + 0x70, 0x65, 0x22, 0x3c, 0x0a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 1433 + 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x46, 0x49, 0x4c, 0x45, 0x5f, 1434 + 0x4d, 0x41, 0x54, 0x43, 0x48, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x46, 0x49, 0x4c, 0x45, 0x5f, 1435 + 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x52, 0x45, 0x50, 0x4f, 0x10, 0x03, 1436 + 0x22, 0x83, 0x01, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x18, 1437 + 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 1438 + 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x61, 0x73, 0x65, 1439 + 0x5f, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 1440 + 0x52, 0x0d, 0x63, 0x61, 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x12, 1441 + 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 1442 + 0x28, 0x08, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 1443 + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x63, 1444 + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x2d, 0x0a, 0x03, 0x41, 0x6e, 0x64, 0x12, 0x26, 0x0a, 1445 + 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 1446 + 0x0a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x52, 0x08, 0x63, 0x68, 0x69, 1447 + 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x22, 0x2c, 0x0a, 0x02, 0x4f, 0x72, 0x12, 0x26, 0x0a, 0x08, 0x63, 1448 + 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 1449 + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 1450 + 0x72, 0x65, 0x6e, 0x22, 0x27, 0x0a, 0x03, 0x4e, 0x6f, 0x74, 0x12, 0x20, 0x0a, 0x05, 0x63, 0x68, 1451 + 0x69, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x67, 0x72, 0x70, 0x63, 1452 + 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x52, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x22, 0x38, 0x0a, 0x06, 1453 + 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 1454 + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 1455 + 0x12, 0x14, 0x0a, 0x05, 0x65, 0x78, 0x61, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 1456 + 0x05, 0x65, 0x78, 0x61, 0x63, 0x74, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 1457 + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 1458 + 0x2f, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x62, 0x06, 1459 + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 1460 + } 1461 + 1462 + var ( 1463 + file_query_proto_rawDescOnce sync.Once 1464 + file_query_proto_rawDescData = file_query_proto_rawDesc 1465 + ) 1466 + 1467 + func file_query_proto_rawDescGZIP() []byte { 1468 + file_query_proto_rawDescOnce.Do(func() { 1469 + file_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_query_proto_rawDescData) 1470 + }) 1471 + return file_query_proto_rawDescData 1472 + } 1473 + 1474 + var file_query_proto_enumTypes = make([]protoimpl.EnumInfo, 2) 1475 + var file_query_proto_msgTypes = make([]protoimpl.MessageInfo, 19) 1476 + var file_query_proto_goTypes = []interface{}{ 1477 + (RawConfig_Flag)(0), // 0: grpc.v1.RawConfig.Flag 1478 + (Type_Kind)(0), // 1: grpc.v1.Type.Kind 1479 + (*Q)(nil), // 2: grpc.v1.Q 1480 + (*RawConfig)(nil), // 3: grpc.v1.RawConfig 1481 + (*Regexp)(nil), // 4: grpc.v1.Regexp 1482 + (*Symbol)(nil), // 5: grpc.v1.Symbol 1483 + (*Language)(nil), // 6: grpc.v1.Language 1484 + (*Repo)(nil), // 7: grpc.v1.Repo 1485 + (*RepoRegexp)(nil), // 8: grpc.v1.RepoRegexp 1486 + (*BranchesRepos)(nil), // 9: grpc.v1.BranchesRepos 1487 + (*BranchRepos)(nil), // 10: grpc.v1.BranchRepos 1488 + (*RepoIds)(nil), // 11: grpc.v1.RepoIds 1489 + (*RepoSet)(nil), // 12: grpc.v1.RepoSet 1490 + (*FileNameSet)(nil), // 13: grpc.v1.FileNameSet 1491 + (*Type)(nil), // 14: grpc.v1.Type 1492 + (*Substring)(nil), // 15: grpc.v1.Substring 1493 + (*And)(nil), // 16: grpc.v1.And 1494 + (*Or)(nil), // 17: grpc.v1.Or 1495 + (*Not)(nil), // 18: grpc.v1.Not 1496 + (*Branch)(nil), // 19: grpc.v1.Branch 1497 + nil, // 20: grpc.v1.RepoSet.SetEntry 1498 + } 1499 + var file_query_proto_depIdxs = []int32{ 1500 + 3, // 0: grpc.v1.Q.raw_config:type_name -> grpc.v1.RawConfig 1501 + 4, // 1: grpc.v1.Q.regexp:type_name -> grpc.v1.Regexp 1502 + 5, // 2: grpc.v1.Q.symbol:type_name -> grpc.v1.Symbol 1503 + 6, // 3: grpc.v1.Q.language:type_name -> grpc.v1.Language 1504 + 7, // 4: grpc.v1.Q.repo:type_name -> grpc.v1.Repo 1505 + 8, // 5: grpc.v1.Q.repo_regexp:type_name -> grpc.v1.RepoRegexp 1506 + 9, // 6: grpc.v1.Q.branches_repos:type_name -> grpc.v1.BranchesRepos 1507 + 11, // 7: grpc.v1.Q.repo_ids:type_name -> grpc.v1.RepoIds 1508 + 12, // 8: grpc.v1.Q.repo_set:type_name -> grpc.v1.RepoSet 1509 + 13, // 9: grpc.v1.Q.file_name_set:type_name -> grpc.v1.FileNameSet 1510 + 14, // 10: grpc.v1.Q.type:type_name -> grpc.v1.Type 1511 + 15, // 11: grpc.v1.Q.substring:type_name -> grpc.v1.Substring 1512 + 16, // 12: grpc.v1.Q.and:type_name -> grpc.v1.And 1513 + 17, // 13: grpc.v1.Q.or:type_name -> grpc.v1.Or 1514 + 18, // 14: grpc.v1.Q.not:type_name -> grpc.v1.Not 1515 + 19, // 15: grpc.v1.Q.branch:type_name -> grpc.v1.Branch 1516 + 0, // 16: grpc.v1.RawConfig.flags:type_name -> grpc.v1.RawConfig.Flag 1517 + 2, // 17: grpc.v1.Symbol.expr:type_name -> grpc.v1.Q 1518 + 10, // 18: grpc.v1.BranchesRepos.list:type_name -> grpc.v1.BranchRepos 1519 + 20, // 19: grpc.v1.RepoSet.set:type_name -> grpc.v1.RepoSet.SetEntry 1520 + 2, // 20: grpc.v1.Type.child:type_name -> grpc.v1.Q 1521 + 1, // 21: grpc.v1.Type.type:type_name -> grpc.v1.Type.Kind 1522 + 2, // 22: grpc.v1.And.children:type_name -> grpc.v1.Q 1523 + 2, // 23: grpc.v1.Or.children:type_name -> grpc.v1.Q 1524 + 2, // 24: grpc.v1.Not.child:type_name -> grpc.v1.Q 1525 + 25, // [25:25] is the sub-list for method output_type 1526 + 25, // [25:25] is the sub-list for method input_type 1527 + 25, // [25:25] is the sub-list for extension type_name 1528 + 25, // [25:25] is the sub-list for extension extendee 1529 + 0, // [0:25] is the sub-list for field type_name 1530 + } 1531 + 1532 + func init() { file_query_proto_init() } 1533 + func file_query_proto_init() { 1534 + if File_query_proto != nil { 1535 + return 1536 + } 1537 + if !protoimpl.UnsafeEnabled { 1538 + file_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 1539 + switch v := v.(*Q); i { 1540 + case 0: 1541 + return &v.state 1542 + case 1: 1543 + return &v.sizeCache 1544 + case 2: 1545 + return &v.unknownFields 1546 + default: 1547 + return nil 1548 + } 1549 + } 1550 + file_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 1551 + switch v := v.(*RawConfig); i { 1552 + case 0: 1553 + return &v.state 1554 + case 1: 1555 + return &v.sizeCache 1556 + case 2: 1557 + return &v.unknownFields 1558 + default: 1559 + return nil 1560 + } 1561 + } 1562 + file_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { 1563 + switch v := v.(*Regexp); i { 1564 + case 0: 1565 + return &v.state 1566 + case 1: 1567 + return &v.sizeCache 1568 + case 2: 1569 + return &v.unknownFields 1570 + default: 1571 + return nil 1572 + } 1573 + } 1574 + file_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { 1575 + switch v := v.(*Symbol); i { 1576 + case 0: 1577 + return &v.state 1578 + case 1: 1579 + return &v.sizeCache 1580 + case 2: 1581 + return &v.unknownFields 1582 + default: 1583 + return nil 1584 + } 1585 + } 1586 + file_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { 1587 + switch v := v.(*Language); i { 1588 + case 0: 1589 + return &v.state 1590 + case 1: 1591 + return &v.sizeCache 1592 + case 2: 1593 + return &v.unknownFields 1594 + default: 1595 + return nil 1596 + } 1597 + } 1598 + file_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { 1599 + switch v := v.(*Repo); i { 1600 + case 0: 1601 + return &v.state 1602 + case 1: 1603 + return &v.sizeCache 1604 + case 2: 1605 + return &v.unknownFields 1606 + default: 1607 + return nil 1608 + } 1609 + } 1610 + file_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { 1611 + switch v := v.(*RepoRegexp); i { 1612 + case 0: 1613 + return &v.state 1614 + case 1: 1615 + return &v.sizeCache 1616 + case 2: 1617 + return &v.unknownFields 1618 + default: 1619 + return nil 1620 + } 1621 + } 1622 + file_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { 1623 + switch v := v.(*BranchesRepos); i { 1624 + case 0: 1625 + return &v.state 1626 + case 1: 1627 + return &v.sizeCache 1628 + case 2: 1629 + return &v.unknownFields 1630 + default: 1631 + return nil 1632 + } 1633 + } 1634 + file_query_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { 1635 + switch v := v.(*BranchRepos); i { 1636 + case 0: 1637 + return &v.state 1638 + case 1: 1639 + return &v.sizeCache 1640 + case 2: 1641 + return &v.unknownFields 1642 + default: 1643 + return nil 1644 + } 1645 + } 1646 + file_query_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { 1647 + switch v := v.(*RepoIds); i { 1648 + case 0: 1649 + return &v.state 1650 + case 1: 1651 + return &v.sizeCache 1652 + case 2: 1653 + return &v.unknownFields 1654 + default: 1655 + return nil 1656 + } 1657 + } 1658 + file_query_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { 1659 + switch v := v.(*RepoSet); i { 1660 + case 0: 1661 + return &v.state 1662 + case 1: 1663 + return &v.sizeCache 1664 + case 2: 1665 + return &v.unknownFields 1666 + default: 1667 + return nil 1668 + } 1669 + } 1670 + file_query_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { 1671 + switch v := v.(*FileNameSet); i { 1672 + case 0: 1673 + return &v.state 1674 + case 1: 1675 + return &v.sizeCache 1676 + case 2: 1677 + return &v.unknownFields 1678 + default: 1679 + return nil 1680 + } 1681 + } 1682 + file_query_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { 1683 + switch v := v.(*Type); i { 1684 + case 0: 1685 + return &v.state 1686 + case 1: 1687 + return &v.sizeCache 1688 + case 2: 1689 + return &v.unknownFields 1690 + default: 1691 + return nil 1692 + } 1693 + } 1694 + file_query_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { 1695 + switch v := v.(*Substring); i { 1696 + case 0: 1697 + return &v.state 1698 + case 1: 1699 + return &v.sizeCache 1700 + case 2: 1701 + return &v.unknownFields 1702 + default: 1703 + return nil 1704 + } 1705 + } 1706 + file_query_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { 1707 + switch v := v.(*And); i { 1708 + case 0: 1709 + return &v.state 1710 + case 1: 1711 + return &v.sizeCache 1712 + case 2: 1713 + return &v.unknownFields 1714 + default: 1715 + return nil 1716 + } 1717 + } 1718 + file_query_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { 1719 + switch v := v.(*Or); i { 1720 + case 0: 1721 + return &v.state 1722 + case 1: 1723 + return &v.sizeCache 1724 + case 2: 1725 + return &v.unknownFields 1726 + default: 1727 + return nil 1728 + } 1729 + } 1730 + file_query_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { 1731 + switch v := v.(*Not); i { 1732 + case 0: 1733 + return &v.state 1734 + case 1: 1735 + return &v.sizeCache 1736 + case 2: 1737 + return &v.unknownFields 1738 + default: 1739 + return nil 1740 + } 1741 + } 1742 + file_query_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { 1743 + switch v := v.(*Branch); i { 1744 + case 0: 1745 + return &v.state 1746 + case 1: 1747 + return &v.sizeCache 1748 + case 2: 1749 + return &v.unknownFields 1750 + default: 1751 + return nil 1752 + } 1753 + } 1754 + } 1755 + file_query_proto_msgTypes[0].OneofWrappers = []interface{}{ 1756 + (*Q_RawConfig)(nil), 1757 + (*Q_Regexp)(nil), 1758 + (*Q_Symbol)(nil), 1759 + (*Q_Language)(nil), 1760 + (*Q_Const)(nil), 1761 + (*Q_Repo)(nil), 1762 + (*Q_RepoRegexp)(nil), 1763 + (*Q_BranchesRepos)(nil), 1764 + (*Q_RepoIds)(nil), 1765 + (*Q_RepoSet)(nil), 1766 + (*Q_FileNameSet)(nil), 1767 + (*Q_Type)(nil), 1768 + (*Q_Substring)(nil), 1769 + (*Q_And)(nil), 1770 + (*Q_Or)(nil), 1771 + (*Q_Not)(nil), 1772 + (*Q_Branch)(nil), 1773 + } 1774 + type x struct{} 1775 + out := protoimpl.TypeBuilder{ 1776 + File: protoimpl.DescBuilder{ 1777 + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 1778 + RawDescriptor: file_query_proto_rawDesc, 1779 + NumEnums: 2, 1780 + NumMessages: 19, 1781 + NumExtensions: 0, 1782 + NumServices: 0, 1783 + }, 1784 + GoTypes: file_query_proto_goTypes, 1785 + DependencyIndexes: file_query_proto_depIdxs, 1786 + EnumInfos: file_query_proto_enumTypes, 1787 + MessageInfos: file_query_proto_msgTypes, 1788 + }.Build() 1789 + File_query_proto = out.File 1790 + file_query_proto_rawDesc = nil 1791 + file_query_proto_goTypes = nil 1792 + file_query_proto_depIdxs = nil 1793 + }
+147
grpc/v1/query.proto
··· 1 + syntax = "proto3"; 2 + 3 + package grpc.v1; 4 + 5 + import "google/protobuf/duration.proto"; 6 + import "google/protobuf/empty.proto"; 7 + import "google/protobuf/timestamp.proto"; 8 + 9 + option go_package = "github.com/sourcegraph/zoekt/grpc/v1"; 10 + 11 + message Q { 12 + oneof query { 13 + RawConfig raw_config = 1; 14 + Regexp regexp = 2; 15 + Symbol symbol = 3; 16 + Language language = 4; 17 + bool const = 5; 18 + Repo repo = 6; 19 + RepoRegexp repo_regexp = 7; 20 + BranchesRepos branches_repos = 8; 21 + RepoIds repo_ids = 9; 22 + RepoSet repo_set = 10; 23 + FileNameSet file_name_set = 11; 24 + Type type = 12; 25 + Substring substring = 13; 26 + And and = 14; 27 + Or or = 15; 28 + Not not = 16; 29 + Branch branch = 17; 30 + } 31 + } 32 + 33 + // RawConfig filters repositories based on their encoded RawConfig map. 34 + message RawConfig { 35 + enum Flag { 36 + UNKNOWN = 0x00; 37 + ONLY_PUBLIC = 0x01; 38 + ONLY_PRIVATE = 0x02; 39 + ONLY_FORKS = 0x04; 40 + NO_FORKS = 0x08; 41 + ONLY_ARCHIVED = 0x10; 42 + NO_ARCHIVED = 0x20; 43 + } 44 + 45 + repeated Flag flags = 1; 46 + } 47 + 48 + // Regexp is a query looking for regular expressions matches. 49 + message Regexp { 50 + string regexp = 1; 51 + bool file_name = 2; 52 + bool content = 3; 53 + bool case_sensitive = 4; 54 + } 55 + 56 + message Symbol { 57 + Q expr = 1; 58 + } 59 + 60 + message Language { 61 + string language = 1; 62 + } 63 + 64 + message Repo { 65 + string regexp = 1; 66 + } 67 + 68 + message RepoRegexp { 69 + string regexp = 1; 70 + } 71 + 72 + // BranchesRepos is a slice of BranchRepos to match. 73 + message BranchesRepos { 74 + repeated BranchRepos list = 1; 75 + } 76 + 77 + // BranchRepos is a (branch, sourcegraph repo ids bitmap) tuple. It is a 78 + // Sourcegraph addition. 79 + message BranchRepos { 80 + string branch = 1; 81 + // a serialized roaring bitmap of the target repo ids 82 + bytes repos = 2; 83 + } 84 + 85 + // Similar to BranchRepos but will be used to match only by repoid and 86 + // therefore matches all branches 87 + message RepoIds { 88 + // a serialized roaring bitmap of the target repo ids 89 + bytes repos = 1; 90 + } 91 + 92 + // RepoSet is a list of repos to match. 93 + message RepoSet { 94 + map<string, bool> set = 1; 95 + } 96 + 97 + // FileNameSet is a list of file names to match. 98 + message FileNameSet { 99 + repeated string set = 1; 100 + } 101 + 102 + // Type changes the result type returned. 103 + message Type { 104 + enum Kind { 105 + UNKNOWN = 0; 106 + FILE_MATCH = 1; 107 + FILE_NAME = 2; 108 + REPO = 3; 109 + } 110 + 111 + Q child = 1; 112 + // TODO: type constants 113 + Kind type = 2; 114 + } 115 + 116 + message Substring { 117 + string pattern = 1; 118 + bool case_sensitive = 2; 119 + 120 + // Match only filename 121 + bool file_name = 3; 122 + 123 + // Match only content 124 + bool content = 4; 125 + } 126 + 127 + // And is matched when all its children are. 128 + message And { 129 + repeated Q children = 1; 130 + } 131 + 132 + // Or is matched when any of its children is matched. 133 + message Or { 134 + repeated Q children = 1; 135 + } 136 + 137 + // Not inverts the meaning of its child. 138 + message Not { 139 + Q child = 1; 140 + } 141 + 142 + // Branch limits search to a specific branch. 143 + message Branch { 144 + string pattern = 1; 145 + // exact is true if we want to Pattern to equal branch. 146 + bool exact = 2; 147 + }
+3020
grpc/v1/webserver.pb.go
··· 1 + // Code generated by protoc-gen-go. DO NOT EDIT. 2 + // versions: 3 + // protoc-gen-go v1.29.1 4 + // protoc (unknown) 5 + // source: webserver.proto 6 + 7 + package v1 8 + 9 + import ( 10 + protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 + protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 + durationpb "google.golang.org/protobuf/types/known/durationpb" 13 + _ "google.golang.org/protobuf/types/known/emptypb" 14 + timestamppb "google.golang.org/protobuf/types/known/timestamppb" 15 + reflect "reflect" 16 + sync "sync" 17 + ) 18 + 19 + const ( 20 + // Verify that this generated code is sufficiently up-to-date. 21 + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 22 + // Verify that runtime/protoimpl is sufficiently up-to-date. 23 + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 24 + ) 25 + 26 + type FlushReason int32 27 + 28 + const ( 29 + FlushReason_UNKNOWN FlushReason = 0 30 + FlushReason_TIMER_EXPIRED FlushReason = 1 31 + FlushReason_FINAL_FLUSH FlushReason = 2 32 + FlushReason_MAX_SIZE FlushReason = 3 33 + ) 34 + 35 + // Enum value maps for FlushReason. 36 + var ( 37 + FlushReason_name = map[int32]string{ 38 + 0: "UNKNOWN", 39 + 1: "TIMER_EXPIRED", 40 + 2: "FINAL_FLUSH", 41 + 3: "MAX_SIZE", 42 + } 43 + FlushReason_value = map[string]int32{ 44 + "UNKNOWN": 0, 45 + "TIMER_EXPIRED": 1, 46 + "FINAL_FLUSH": 2, 47 + "MAX_SIZE": 3, 48 + } 49 + ) 50 + 51 + func (x FlushReason) Enum() *FlushReason { 52 + p := new(FlushReason) 53 + *p = x 54 + return p 55 + } 56 + 57 + func (x FlushReason) String() string { 58 + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) 59 + } 60 + 61 + func (FlushReason) Descriptor() protoreflect.EnumDescriptor { 62 + return file_webserver_proto_enumTypes[0].Descriptor() 63 + } 64 + 65 + func (FlushReason) Type() protoreflect.EnumType { 66 + return &file_webserver_proto_enumTypes[0] 67 + } 68 + 69 + func (x FlushReason) Number() protoreflect.EnumNumber { 70 + return protoreflect.EnumNumber(x) 71 + } 72 + 73 + // Deprecated: Use FlushReason.Descriptor instead. 74 + func (FlushReason) EnumDescriptor() ([]byte, []int) { 75 + return file_webserver_proto_rawDescGZIP(), []int{0} 76 + } 77 + 78 + type ListOptions_RepoListField int32 79 + 80 + const ( 81 + ListOptions_REPO_LIST_FIELD_UNKNOWN ListOptions_RepoListField = 0 82 + ListOptions_REPO_LIST_FIELD_REPOS ListOptions_RepoListField = 1 83 + ListOptions_REPO_LIST_FIELD_MINIMAL ListOptions_RepoListField = 2 84 + ListOptions_REPO_LIST_FIELD_REPOS_MAP ListOptions_RepoListField = 3 85 + ) 86 + 87 + // Enum value maps for ListOptions_RepoListField. 88 + var ( 89 + ListOptions_RepoListField_name = map[int32]string{ 90 + 0: "REPO_LIST_FIELD_UNKNOWN", 91 + 1: "REPO_LIST_FIELD_REPOS", 92 + 2: "REPO_LIST_FIELD_MINIMAL", 93 + 3: "REPO_LIST_FIELD_REPOS_MAP", 94 + } 95 + ListOptions_RepoListField_value = map[string]int32{ 96 + "REPO_LIST_FIELD_UNKNOWN": 0, 97 + "REPO_LIST_FIELD_REPOS": 1, 98 + "REPO_LIST_FIELD_MINIMAL": 2, 99 + "REPO_LIST_FIELD_REPOS_MAP": 3, 100 + } 101 + ) 102 + 103 + func (x ListOptions_RepoListField) Enum() *ListOptions_RepoListField { 104 + p := new(ListOptions_RepoListField) 105 + *p = x 106 + return p 107 + } 108 + 109 + func (x ListOptions_RepoListField) String() string { 110 + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) 111 + } 112 + 113 + func (ListOptions_RepoListField) Descriptor() protoreflect.EnumDescriptor { 114 + return file_webserver_proto_enumTypes[1].Descriptor() 115 + } 116 + 117 + func (ListOptions_RepoListField) Type() protoreflect.EnumType { 118 + return &file_webserver_proto_enumTypes[1] 119 + } 120 + 121 + func (x ListOptions_RepoListField) Number() protoreflect.EnumNumber { 122 + return protoreflect.EnumNumber(x) 123 + } 124 + 125 + // Deprecated: Use ListOptions_RepoListField.Descriptor instead. 126 + func (ListOptions_RepoListField) EnumDescriptor() ([]byte, []int) { 127 + return file_webserver_proto_rawDescGZIP(), []int{4, 0} 128 + } 129 + 130 + type SearchRequest struct { 131 + state protoimpl.MessageState 132 + sizeCache protoimpl.SizeCache 133 + unknownFields protoimpl.UnknownFields 134 + 135 + Query *Q `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` 136 + Opts *SearchOptions `protobuf:"bytes,2,opt,name=opts,proto3" json:"opts,omitempty"` 137 + } 138 + 139 + func (x *SearchRequest) Reset() { 140 + *x = SearchRequest{} 141 + if protoimpl.UnsafeEnabled { 142 + mi := &file_webserver_proto_msgTypes[0] 143 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 144 + ms.StoreMessageInfo(mi) 145 + } 146 + } 147 + 148 + func (x *SearchRequest) String() string { 149 + return protoimpl.X.MessageStringOf(x) 150 + } 151 + 152 + func (*SearchRequest) ProtoMessage() {} 153 + 154 + func (x *SearchRequest) ProtoReflect() protoreflect.Message { 155 + mi := &file_webserver_proto_msgTypes[0] 156 + if protoimpl.UnsafeEnabled && x != nil { 157 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 158 + if ms.LoadMessageInfo() == nil { 159 + ms.StoreMessageInfo(mi) 160 + } 161 + return ms 162 + } 163 + return mi.MessageOf(x) 164 + } 165 + 166 + // Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead. 167 + func (*SearchRequest) Descriptor() ([]byte, []int) { 168 + return file_webserver_proto_rawDescGZIP(), []int{0} 169 + } 170 + 171 + func (x *SearchRequest) GetQuery() *Q { 172 + if x != nil { 173 + return x.Query 174 + } 175 + return nil 176 + } 177 + 178 + func (x *SearchRequest) GetOpts() *SearchOptions { 179 + if x != nil { 180 + return x.Opts 181 + } 182 + return nil 183 + } 184 + 185 + type SearchResponse struct { 186 + state protoimpl.MessageState 187 + sizeCache protoimpl.SizeCache 188 + unknownFields protoimpl.UnknownFields 189 + 190 + Stats *Stats `protobuf:"bytes,1,opt,name=stats,proto3" json:"stats,omitempty"` 191 + Progress *Progress `protobuf:"bytes,2,opt,name=progress,proto3" json:"progress,omitempty"` 192 + Files []*FileMatch `protobuf:"bytes,3,rep,name=files,proto3" json:"files,omitempty"` 193 + // RepoURLs holds a repo => template string map. 194 + RepoUrls map[string]string `protobuf:"bytes,4,rep,name=repo_urls,json=repoUrls,proto3" json:"repo_urls,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 195 + // FragmentNames holds a repo => template string map, for 196 + // the line number fragment. 197 + LineFragments map[string]string `protobuf:"bytes,5,rep,name=line_fragments,json=lineFragments,proto3" json:"line_fragments,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 198 + } 199 + 200 + func (x *SearchResponse) Reset() { 201 + *x = SearchResponse{} 202 + if protoimpl.UnsafeEnabled { 203 + mi := &file_webserver_proto_msgTypes[1] 204 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 205 + ms.StoreMessageInfo(mi) 206 + } 207 + } 208 + 209 + func (x *SearchResponse) String() string { 210 + return protoimpl.X.MessageStringOf(x) 211 + } 212 + 213 + func (*SearchResponse) ProtoMessage() {} 214 + 215 + func (x *SearchResponse) ProtoReflect() protoreflect.Message { 216 + mi := &file_webserver_proto_msgTypes[1] 217 + if protoimpl.UnsafeEnabled && x != nil { 218 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 219 + if ms.LoadMessageInfo() == nil { 220 + ms.StoreMessageInfo(mi) 221 + } 222 + return ms 223 + } 224 + return mi.MessageOf(x) 225 + } 226 + 227 + // Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead. 228 + func (*SearchResponse) Descriptor() ([]byte, []int) { 229 + return file_webserver_proto_rawDescGZIP(), []int{1} 230 + } 231 + 232 + func (x *SearchResponse) GetStats() *Stats { 233 + if x != nil { 234 + return x.Stats 235 + } 236 + return nil 237 + } 238 + 239 + func (x *SearchResponse) GetProgress() *Progress { 240 + if x != nil { 241 + return x.Progress 242 + } 243 + return nil 244 + } 245 + 246 + func (x *SearchResponse) GetFiles() []*FileMatch { 247 + if x != nil { 248 + return x.Files 249 + } 250 + return nil 251 + } 252 + 253 + func (x *SearchResponse) GetRepoUrls() map[string]string { 254 + if x != nil { 255 + return x.RepoUrls 256 + } 257 + return nil 258 + } 259 + 260 + func (x *SearchResponse) GetLineFragments() map[string]string { 261 + if x != nil { 262 + return x.LineFragments 263 + } 264 + return nil 265 + } 266 + 267 + type SearchOptions struct { 268 + state protoimpl.MessageState 269 + sizeCache protoimpl.SizeCache 270 + unknownFields protoimpl.UnknownFields 271 + 272 + // Return an upper-bound estimate of eligible documents in 273 + // stats.ShardFilesConsidered. 274 + EstimateDocCount bool `protobuf:"varint,1,opt,name=estimate_doc_count,json=estimateDocCount,proto3" json:"estimate_doc_count,omitempty"` 275 + // Return the whole file. 276 + Whole bool `protobuf:"varint,2,opt,name=whole,proto3" json:"whole,omitempty"` 277 + // Maximum number of matches: skip all processing an index 278 + // shard after we found this many non-overlapping matches. 279 + ShardMaxMatchCount int64 `protobuf:"varint,3,opt,name=shard_max_match_count,json=shardMaxMatchCount,proto3" json:"shard_max_match_count,omitempty"` 280 + // Maximum number of matches: stop looking for more matches 281 + // once we have this many matches across shards. 282 + TotalMaxMatchCount int64 `protobuf:"varint,4,opt,name=total_max_match_count,json=totalMaxMatchCount,proto3" json:"total_max_match_count,omitempty"` 283 + // Maximum number of matches: skip processing documents for a repository in 284 + // a shard once we have found ShardRepoMaxMatchCount. 285 + // 286 + // A compound shard may contain multiple repositories. This will most often 287 + // be set to 1 to find all repositories containing a result. 288 + ShardRepoMaxMatchCount int64 `protobuf:"varint,5,opt,name=shard_repo_max_match_count,json=shardRepoMaxMatchCount,proto3" json:"shard_repo_max_match_count,omitempty"` 289 + // Abort the search after this much time has passed. 290 + MaxWallTime *durationpb.Duration `protobuf:"bytes,6,opt,name=max_wall_time,json=maxWallTime,proto3" json:"max_wall_time,omitempty"` 291 + // FlushWallTime if non-zero will stop streaming behaviour at first and 292 + // instead will collate and sort results. At FlushWallTime the results will 293 + // be sent and then the behaviour will revert to the normal streaming. 294 + FlushWallTime *durationpb.Duration `protobuf:"bytes,7,opt,name=flush_wall_time,json=flushWallTime,proto3" json:"flush_wall_time,omitempty"` 295 + // Trim the number of results after collating and sorting the 296 + // results 297 + MaxDocDisplayCount int64 `protobuf:"varint,8,opt,name=max_doc_display_count,json=maxDocDisplayCount,proto3" json:"max_doc_display_count,omitempty"` 298 + // If set to a number greater than zero then up to this many number 299 + // of context lines will be added before and after each matched line. 300 + // Note that the included context lines might contain matches and 301 + // it's up to the consumer of the result to remove those lines. 302 + NumContextLines int64 `protobuf:"varint,9,opt,name=num_context_lines,json=numContextLines,proto3" json:"num_context_lines,omitempty"` 303 + // If true, ChunkMatches will be returned in each FileMatch rather than LineMatches 304 + // EXPERIMENTAL: the behavior of this flag may be changed in future versions. 305 + ChunkMatches bool `protobuf:"varint,10,opt,name=chunk_matches,json=chunkMatches,proto3" json:"chunk_matches,omitempty"` 306 + // EXPERIMENTAL. If true, document ranks are used as additional input for 307 + // sorting matches. 308 + UseDocumentRanks bool `protobuf:"varint,11,opt,name=use_document_ranks,json=useDocumentRanks,proto3" json:"use_document_ranks,omitempty"` 309 + // EXPERIMENTAL. When UseDocumentRanks is enabled, this can be optionally set to adjust 310 + // their weight in the file match score. If the value is <= 0.0, the default weight value 311 + // will be used. This option is temporary and is only exposed for testing/ tuning purposes. 312 + DocumentRanksWeight float64 `protobuf:"fixed64,12,opt,name=document_ranks_weight,json=documentRanksWeight,proto3" json:"document_ranks_weight,omitempty"` 313 + // Trace turns on opentracing for this request if true and if the Jaeger address was provided as 314 + // a command-line flag 315 + Trace bool `protobuf:"varint,13,opt,name=trace,proto3" json:"trace,omitempty"` 316 + // If set, the search results will contain debug information for scoring. 317 + DebugScore bool `protobuf:"varint,14,opt,name=debug_score,json=debugScore,proto3" json:"debug_score,omitempty"` 318 + // EXPERIMENTAL. If true, use keyword-style scoring instead of the default scoring formula. 319 + // Currently, this treats each match in a file as a term and computes an approximation to BM25. 320 + // When enabled, all other scoring signals are ignored, including document ranks. 321 + UseKeywordScoring bool `protobuf:"varint,15,opt,name=use_keyword_scoring,json=useKeywordScoring,proto3" json:"use_keyword_scoring,omitempty"` 322 + } 323 + 324 + func (x *SearchOptions) Reset() { 325 + *x = SearchOptions{} 326 + if protoimpl.UnsafeEnabled { 327 + mi := &file_webserver_proto_msgTypes[2] 328 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 329 + ms.StoreMessageInfo(mi) 330 + } 331 + } 332 + 333 + func (x *SearchOptions) String() string { 334 + return protoimpl.X.MessageStringOf(x) 335 + } 336 + 337 + func (*SearchOptions) ProtoMessage() {} 338 + 339 + func (x *SearchOptions) ProtoReflect() protoreflect.Message { 340 + mi := &file_webserver_proto_msgTypes[2] 341 + if protoimpl.UnsafeEnabled && x != nil { 342 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 343 + if ms.LoadMessageInfo() == nil { 344 + ms.StoreMessageInfo(mi) 345 + } 346 + return ms 347 + } 348 + return mi.MessageOf(x) 349 + } 350 + 351 + // Deprecated: Use SearchOptions.ProtoReflect.Descriptor instead. 352 + func (*SearchOptions) Descriptor() ([]byte, []int) { 353 + return file_webserver_proto_rawDescGZIP(), []int{2} 354 + } 355 + 356 + func (x *SearchOptions) GetEstimateDocCount() bool { 357 + if x != nil { 358 + return x.EstimateDocCount 359 + } 360 + return false 361 + } 362 + 363 + func (x *SearchOptions) GetWhole() bool { 364 + if x != nil { 365 + return x.Whole 366 + } 367 + return false 368 + } 369 + 370 + func (x *SearchOptions) GetShardMaxMatchCount() int64 { 371 + if x != nil { 372 + return x.ShardMaxMatchCount 373 + } 374 + return 0 375 + } 376 + 377 + func (x *SearchOptions) GetTotalMaxMatchCount() int64 { 378 + if x != nil { 379 + return x.TotalMaxMatchCount 380 + } 381 + return 0 382 + } 383 + 384 + func (x *SearchOptions) GetShardRepoMaxMatchCount() int64 { 385 + if x != nil { 386 + return x.ShardRepoMaxMatchCount 387 + } 388 + return 0 389 + } 390 + 391 + func (x *SearchOptions) GetMaxWallTime() *durationpb.Duration { 392 + if x != nil { 393 + return x.MaxWallTime 394 + } 395 + return nil 396 + } 397 + 398 + func (x *SearchOptions) GetFlushWallTime() *durationpb.Duration { 399 + if x != nil { 400 + return x.FlushWallTime 401 + } 402 + return nil 403 + } 404 + 405 + func (x *SearchOptions) GetMaxDocDisplayCount() int64 { 406 + if x != nil { 407 + return x.MaxDocDisplayCount 408 + } 409 + return 0 410 + } 411 + 412 + func (x *SearchOptions) GetNumContextLines() int64 { 413 + if x != nil { 414 + return x.NumContextLines 415 + } 416 + return 0 417 + } 418 + 419 + func (x *SearchOptions) GetChunkMatches() bool { 420 + if x != nil { 421 + return x.ChunkMatches 422 + } 423 + return false 424 + } 425 + 426 + func (x *SearchOptions) GetUseDocumentRanks() bool { 427 + if x != nil { 428 + return x.UseDocumentRanks 429 + } 430 + return false 431 + } 432 + 433 + func (x *SearchOptions) GetDocumentRanksWeight() float64 { 434 + if x != nil { 435 + return x.DocumentRanksWeight 436 + } 437 + return 0 438 + } 439 + 440 + func (x *SearchOptions) GetTrace() bool { 441 + if x != nil { 442 + return x.Trace 443 + } 444 + return false 445 + } 446 + 447 + func (x *SearchOptions) GetDebugScore() bool { 448 + if x != nil { 449 + return x.DebugScore 450 + } 451 + return false 452 + } 453 + 454 + func (x *SearchOptions) GetUseKeywordScoring() bool { 455 + if x != nil { 456 + return x.UseKeywordScoring 457 + } 458 + return false 459 + } 460 + 461 + type ListRequest struct { 462 + state protoimpl.MessageState 463 + sizeCache protoimpl.SizeCache 464 + unknownFields protoimpl.UnknownFields 465 + 466 + Query *Q `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` 467 + Opts *ListOptions `protobuf:"bytes,2,opt,name=opts,proto3" json:"opts,omitempty"` 468 + } 469 + 470 + func (x *ListRequest) Reset() { 471 + *x = ListRequest{} 472 + if protoimpl.UnsafeEnabled { 473 + mi := &file_webserver_proto_msgTypes[3] 474 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 475 + ms.StoreMessageInfo(mi) 476 + } 477 + } 478 + 479 + func (x *ListRequest) String() string { 480 + return protoimpl.X.MessageStringOf(x) 481 + } 482 + 483 + func (*ListRequest) ProtoMessage() {} 484 + 485 + func (x *ListRequest) ProtoReflect() protoreflect.Message { 486 + mi := &file_webserver_proto_msgTypes[3] 487 + if protoimpl.UnsafeEnabled && x != nil { 488 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 489 + if ms.LoadMessageInfo() == nil { 490 + ms.StoreMessageInfo(mi) 491 + } 492 + return ms 493 + } 494 + return mi.MessageOf(x) 495 + } 496 + 497 + // Deprecated: Use ListRequest.ProtoReflect.Descriptor instead. 498 + func (*ListRequest) Descriptor() ([]byte, []int) { 499 + return file_webserver_proto_rawDescGZIP(), []int{3} 500 + } 501 + 502 + func (x *ListRequest) GetQuery() *Q { 503 + if x != nil { 504 + return x.Query 505 + } 506 + return nil 507 + } 508 + 509 + func (x *ListRequest) GetOpts() *ListOptions { 510 + if x != nil { 511 + return x.Opts 512 + } 513 + return nil 514 + } 515 + 516 + type ListOptions struct { 517 + state protoimpl.MessageState 518 + sizeCache protoimpl.SizeCache 519 + unknownFields protoimpl.UnknownFields 520 + 521 + // Field decides which field to populate in RepoList response. 522 + Field ListOptions_RepoListField `protobuf:"varint,1,opt,name=field,proto3,enum=grpc.v1.ListOptions_RepoListField" json:"field,omitempty"` 523 + // Return only Minimal data per repo that Sourcegraph frontend needs. 524 + // 525 + // Deprecated: use Field 526 + Minimal bool `protobuf:"varint,16,opt,name=minimal,proto3" json:"minimal,omitempty"` 527 + } 528 + 529 + func (x *ListOptions) Reset() { 530 + *x = ListOptions{} 531 + if protoimpl.UnsafeEnabled { 532 + mi := &file_webserver_proto_msgTypes[4] 533 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 534 + ms.StoreMessageInfo(mi) 535 + } 536 + } 537 + 538 + func (x *ListOptions) String() string { 539 + return protoimpl.X.MessageStringOf(x) 540 + } 541 + 542 + func (*ListOptions) ProtoMessage() {} 543 + 544 + func (x *ListOptions) ProtoReflect() protoreflect.Message { 545 + mi := &file_webserver_proto_msgTypes[4] 546 + if protoimpl.UnsafeEnabled && x != nil { 547 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 548 + if ms.LoadMessageInfo() == nil { 549 + ms.StoreMessageInfo(mi) 550 + } 551 + return ms 552 + } 553 + return mi.MessageOf(x) 554 + } 555 + 556 + // Deprecated: Use ListOptions.ProtoReflect.Descriptor instead. 557 + func (*ListOptions) Descriptor() ([]byte, []int) { 558 + return file_webserver_proto_rawDescGZIP(), []int{4} 559 + } 560 + 561 + func (x *ListOptions) GetField() ListOptions_RepoListField { 562 + if x != nil { 563 + return x.Field 564 + } 565 + return ListOptions_REPO_LIST_FIELD_UNKNOWN 566 + } 567 + 568 + func (x *ListOptions) GetMinimal() bool { 569 + if x != nil { 570 + return x.Minimal 571 + } 572 + return false 573 + } 574 + 575 + type ListResponse struct { 576 + state protoimpl.MessageState 577 + sizeCache protoimpl.SizeCache 578 + unknownFields protoimpl.UnknownFields 579 + 580 + // Returned when ListOptions.Field is RepoListFieldRepos. 581 + Repos []*RepoListEntry `protobuf:"bytes,1,rep,name=repos,proto3" json:"repos,omitempty"` 582 + // ReposMap is set when ListOptions.Field is RepoListFieldReposMap. 583 + ReposMap map[uint32]*MinimalRepoListEntry `protobuf:"bytes,2,rep,name=repos_map,json=reposMap,proto3" json:"repos_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 584 + Crashes int64 `protobuf:"varint,3,opt,name=crashes,proto3" json:"crashes,omitempty"` 585 + // Stats response to a List request. 586 + // This is the aggregate RepoStats of all repos matching the input query. 587 + Stats *RepoStats `protobuf:"bytes,4,opt,name=stats,proto3" json:"stats,omitempty"` 588 + // Returned when ListOptions.Field is RepoListFieldMinimal. 589 + // 590 + // Deprecated: use ReposMap. 591 + Minimal map[uint32]*MinimalRepoListEntry `protobuf:"bytes,5,rep,name=minimal,proto3" json:"minimal,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 592 + } 593 + 594 + func (x *ListResponse) Reset() { 595 + *x = ListResponse{} 596 + if protoimpl.UnsafeEnabled { 597 + mi := &file_webserver_proto_msgTypes[5] 598 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 599 + ms.StoreMessageInfo(mi) 600 + } 601 + } 602 + 603 + func (x *ListResponse) String() string { 604 + return protoimpl.X.MessageStringOf(x) 605 + } 606 + 607 + func (*ListResponse) ProtoMessage() {} 608 + 609 + func (x *ListResponse) ProtoReflect() protoreflect.Message { 610 + mi := &file_webserver_proto_msgTypes[5] 611 + if protoimpl.UnsafeEnabled && x != nil { 612 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 613 + if ms.LoadMessageInfo() == nil { 614 + ms.StoreMessageInfo(mi) 615 + } 616 + return ms 617 + } 618 + return mi.MessageOf(x) 619 + } 620 + 621 + // Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. 622 + func (*ListResponse) Descriptor() ([]byte, []int) { 623 + return file_webserver_proto_rawDescGZIP(), []int{5} 624 + } 625 + 626 + func (x *ListResponse) GetRepos() []*RepoListEntry { 627 + if x != nil { 628 + return x.Repos 629 + } 630 + return nil 631 + } 632 + 633 + func (x *ListResponse) GetReposMap() map[uint32]*MinimalRepoListEntry { 634 + if x != nil { 635 + return x.ReposMap 636 + } 637 + return nil 638 + } 639 + 640 + func (x *ListResponse) GetCrashes() int64 { 641 + if x != nil { 642 + return x.Crashes 643 + } 644 + return 0 645 + } 646 + 647 + func (x *ListResponse) GetStats() *RepoStats { 648 + if x != nil { 649 + return x.Stats 650 + } 651 + return nil 652 + } 653 + 654 + func (x *ListResponse) GetMinimal() map[uint32]*MinimalRepoListEntry { 655 + if x != nil { 656 + return x.Minimal 657 + } 658 + return nil 659 + } 660 + 661 + type RepoListEntry struct { 662 + state protoimpl.MessageState 663 + sizeCache protoimpl.SizeCache 664 + unknownFields protoimpl.UnknownFields 665 + 666 + Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` 667 + IndexMetadata *IndexMetadata `protobuf:"bytes,2,opt,name=index_metadata,json=indexMetadata,proto3" json:"index_metadata,omitempty"` 668 + Stats *RepoStats `protobuf:"bytes,3,opt,name=stats,proto3" json:"stats,omitempty"` 669 + } 670 + 671 + func (x *RepoListEntry) Reset() { 672 + *x = RepoListEntry{} 673 + if protoimpl.UnsafeEnabled { 674 + mi := &file_webserver_proto_msgTypes[6] 675 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 676 + ms.StoreMessageInfo(mi) 677 + } 678 + } 679 + 680 + func (x *RepoListEntry) String() string { 681 + return protoimpl.X.MessageStringOf(x) 682 + } 683 + 684 + func (*RepoListEntry) ProtoMessage() {} 685 + 686 + func (x *RepoListEntry) ProtoReflect() protoreflect.Message { 687 + mi := &file_webserver_proto_msgTypes[6] 688 + if protoimpl.UnsafeEnabled && x != nil { 689 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 690 + if ms.LoadMessageInfo() == nil { 691 + ms.StoreMessageInfo(mi) 692 + } 693 + return ms 694 + } 695 + return mi.MessageOf(x) 696 + } 697 + 698 + // Deprecated: Use RepoListEntry.ProtoReflect.Descriptor instead. 699 + func (*RepoListEntry) Descriptor() ([]byte, []int) { 700 + return file_webserver_proto_rawDescGZIP(), []int{6} 701 + } 702 + 703 + func (x *RepoListEntry) GetRepository() *Repository { 704 + if x != nil { 705 + return x.Repository 706 + } 707 + return nil 708 + } 709 + 710 + func (x *RepoListEntry) GetIndexMetadata() *IndexMetadata { 711 + if x != nil { 712 + return x.IndexMetadata 713 + } 714 + return nil 715 + } 716 + 717 + func (x *RepoListEntry) GetStats() *RepoStats { 718 + if x != nil { 719 + return x.Stats 720 + } 721 + return nil 722 + } 723 + 724 + type Repository struct { 725 + state protoimpl.MessageState 726 + sizeCache protoimpl.SizeCache 727 + unknownFields protoimpl.UnknownFields 728 + 729 + // Sourcegraph's repository ID 730 + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` 731 + // The repository name 732 + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` 733 + // The repository URL. 734 + Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` 735 + // The physical source where this repo came from, eg. full 736 + // path to the zip filename or git repository directory. This 737 + // will not be exposed in the UI, but can be used to detect 738 + // orphaned index shards. 739 + Source string `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty"` 740 + // The branches indexed in this repo. 741 + Branches []*RepositoryBranch `protobuf:"bytes,5,rep,name=branches,proto3" json:"branches,omitempty"` 742 + // Nil if this is not the super project. 743 + SubRepoMap map[string]*Repository `protobuf:"bytes,6,rep,name=sub_repo_map,json=subRepoMap,proto3" json:"sub_repo_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 744 + // URL template to link to the commit of a branch 745 + CommitUrlTemplate string `protobuf:"bytes,7,opt,name=commit_url_template,json=commitUrlTemplate,proto3" json:"commit_url_template,omitempty"` 746 + // The repository URL for getting to a file. Has access to 747 + // {{Branch}}, {{Path}} 748 + FileUrlTemplate string `protobuf:"bytes,8,opt,name=file_url_template,json=fileUrlTemplate,proto3" json:"file_url_template,omitempty"` 749 + // The URL fragment to add to a file URL for line numbers. has 750 + // access to {{LineNumber}}. The fragment should include the 751 + // separator, generally '#' or ';'. 752 + LineFragmentTemplate string `protobuf:"bytes,9,opt,name=line_fragment_template,json=lineFragmentTemplate,proto3" json:"line_fragment_template,omitempty"` 753 + // Perf optimization: priority is set when we load the shard. It corresponds to 754 + // the value of "priority" stored in RawConfig. 755 + Priority float64 `protobuf:"fixed64,10,opt,name=priority,proto3" json:"priority,omitempty"` 756 + // All zoekt.* configuration settings. 757 + RawConfig map[string]string `protobuf:"bytes,11,rep,name=raw_config,json=rawConfig,proto3" json:"raw_config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 758 + // Importance of the repository, bigger is more important 759 + Rank uint32 `protobuf:"varint,12,opt,name=rank,proto3" json:"rank,omitempty"` 760 + // index_options is a hash of the options used to create the index for the 761 + // repo. 762 + IndexOptions string `protobuf:"bytes,13,opt,name=index_options,json=indexOptions,proto3" json:"index_options,omitempty"` 763 + // has_symbols is true if this repository has indexed ctags 764 + // output. Sourcegraph specific: This field is more appropriate for 765 + // IndexMetadata. However, we store it here since the Sourcegraph frontend 766 + // can read this structure but not IndexMetadata. 767 + HasSymbols bool `protobuf:"varint,14,opt,name=has_symbols,json=hasSymbols,proto3" json:"has_symbols,omitempty"` 768 + // tombstone is true if we are not allowed to search this repo. 769 + Tombstone bool `protobuf:"varint,15,opt,name=tombstone,proto3" json:"tombstone,omitempty"` 770 + // latest_commit_date is the date of the latest commit among all indexed Branches. 771 + // The date might be time.Time's 0-value if the repository was last indexed 772 + // before this field was added. 773 + LatestCommitDate *timestamppb.Timestamp `protobuf:"bytes,16,opt,name=latest_commit_date,json=latestCommitDate,proto3" json:"latest_commit_date,omitempty"` 774 + // file_tombstones is a set of file paths that should be ignored across all branches 775 + // in this shard. 776 + FileTombstones []string `protobuf:"bytes,17,rep,name=FileTombstones,proto3" json:"FileTombstones,omitempty"` 777 + } 778 + 779 + func (x *Repository) Reset() { 780 + *x = Repository{} 781 + if protoimpl.UnsafeEnabled { 782 + mi := &file_webserver_proto_msgTypes[7] 783 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 784 + ms.StoreMessageInfo(mi) 785 + } 786 + } 787 + 788 + func (x *Repository) String() string { 789 + return protoimpl.X.MessageStringOf(x) 790 + } 791 + 792 + func (*Repository) ProtoMessage() {} 793 + 794 + func (x *Repository) ProtoReflect() protoreflect.Message { 795 + mi := &file_webserver_proto_msgTypes[7] 796 + if protoimpl.UnsafeEnabled && x != nil { 797 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 798 + if ms.LoadMessageInfo() == nil { 799 + ms.StoreMessageInfo(mi) 800 + } 801 + return ms 802 + } 803 + return mi.MessageOf(x) 804 + } 805 + 806 + // Deprecated: Use Repository.ProtoReflect.Descriptor instead. 807 + func (*Repository) Descriptor() ([]byte, []int) { 808 + return file_webserver_proto_rawDescGZIP(), []int{7} 809 + } 810 + 811 + func (x *Repository) GetId() uint32 { 812 + if x != nil { 813 + return x.Id 814 + } 815 + return 0 816 + } 817 + 818 + func (x *Repository) GetName() string { 819 + if x != nil { 820 + return x.Name 821 + } 822 + return "" 823 + } 824 + 825 + func (x *Repository) GetUrl() string { 826 + if x != nil { 827 + return x.Url 828 + } 829 + return "" 830 + } 831 + 832 + func (x *Repository) GetSource() string { 833 + if x != nil { 834 + return x.Source 835 + } 836 + return "" 837 + } 838 + 839 + func (x *Repository) GetBranches() []*RepositoryBranch { 840 + if x != nil { 841 + return x.Branches 842 + } 843 + return nil 844 + } 845 + 846 + func (x *Repository) GetSubRepoMap() map[string]*Repository { 847 + if x != nil { 848 + return x.SubRepoMap 849 + } 850 + return nil 851 + } 852 + 853 + func (x *Repository) GetCommitUrlTemplate() string { 854 + if x != nil { 855 + return x.CommitUrlTemplate 856 + } 857 + return "" 858 + } 859 + 860 + func (x *Repository) GetFileUrlTemplate() string { 861 + if x != nil { 862 + return x.FileUrlTemplate 863 + } 864 + return "" 865 + } 866 + 867 + func (x *Repository) GetLineFragmentTemplate() string { 868 + if x != nil { 869 + return x.LineFragmentTemplate 870 + } 871 + return "" 872 + } 873 + 874 + func (x *Repository) GetPriority() float64 { 875 + if x != nil { 876 + return x.Priority 877 + } 878 + return 0 879 + } 880 + 881 + func (x *Repository) GetRawConfig() map[string]string { 882 + if x != nil { 883 + return x.RawConfig 884 + } 885 + return nil 886 + } 887 + 888 + func (x *Repository) GetRank() uint32 { 889 + if x != nil { 890 + return x.Rank 891 + } 892 + return 0 893 + } 894 + 895 + func (x *Repository) GetIndexOptions() string { 896 + if x != nil { 897 + return x.IndexOptions 898 + } 899 + return "" 900 + } 901 + 902 + func (x *Repository) GetHasSymbols() bool { 903 + if x != nil { 904 + return x.HasSymbols 905 + } 906 + return false 907 + } 908 + 909 + func (x *Repository) GetTombstone() bool { 910 + if x != nil { 911 + return x.Tombstone 912 + } 913 + return false 914 + } 915 + 916 + func (x *Repository) GetLatestCommitDate() *timestamppb.Timestamp { 917 + if x != nil { 918 + return x.LatestCommitDate 919 + } 920 + return nil 921 + } 922 + 923 + func (x *Repository) GetFileTombstones() []string { 924 + if x != nil { 925 + return x.FileTombstones 926 + } 927 + return nil 928 + } 929 + 930 + type IndexMetadata struct { 931 + state protoimpl.MessageState 932 + sizeCache protoimpl.SizeCache 933 + unknownFields protoimpl.UnknownFields 934 + 935 + IndexFormatVersion int64 `protobuf:"varint,1,opt,name=index_format_version,json=indexFormatVersion,proto3" json:"index_format_version,omitempty"` 936 + IndexFeatureVersion int64 `protobuf:"varint,2,opt,name=index_feature_version,json=indexFeatureVersion,proto3" json:"index_feature_version,omitempty"` 937 + IndexMinReaderVersion int64 `protobuf:"varint,3,opt,name=index_min_reader_version,json=indexMinReaderVersion,proto3" json:"index_min_reader_version,omitempty"` 938 + IndexTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=index_time,json=indexTime,proto3" json:"index_time,omitempty"` 939 + PlainAscii bool `protobuf:"varint,5,opt,name=plain_ascii,json=plainAscii,proto3" json:"plain_ascii,omitempty"` 940 + LanguageMap map[string]uint32 `protobuf:"bytes,6,rep,name=language_map,json=languageMap,proto3" json:"language_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` 941 + ZoektVersion string `protobuf:"bytes,7,opt,name=zoekt_version,json=zoektVersion,proto3" json:"zoekt_version,omitempty"` 942 + Id string `protobuf:"bytes,8,opt,name=id,proto3" json:"id,omitempty"` 943 + } 944 + 945 + func (x *IndexMetadata) Reset() { 946 + *x = IndexMetadata{} 947 + if protoimpl.UnsafeEnabled { 948 + mi := &file_webserver_proto_msgTypes[8] 949 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 950 + ms.StoreMessageInfo(mi) 951 + } 952 + } 953 + 954 + func (x *IndexMetadata) String() string { 955 + return protoimpl.X.MessageStringOf(x) 956 + } 957 + 958 + func (*IndexMetadata) ProtoMessage() {} 959 + 960 + func (x *IndexMetadata) ProtoReflect() protoreflect.Message { 961 + mi := &file_webserver_proto_msgTypes[8] 962 + if protoimpl.UnsafeEnabled && x != nil { 963 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 964 + if ms.LoadMessageInfo() == nil { 965 + ms.StoreMessageInfo(mi) 966 + } 967 + return ms 968 + } 969 + return mi.MessageOf(x) 970 + } 971 + 972 + // Deprecated: Use IndexMetadata.ProtoReflect.Descriptor instead. 973 + func (*IndexMetadata) Descriptor() ([]byte, []int) { 974 + return file_webserver_proto_rawDescGZIP(), []int{8} 975 + } 976 + 977 + func (x *IndexMetadata) GetIndexFormatVersion() int64 { 978 + if x != nil { 979 + return x.IndexFormatVersion 980 + } 981 + return 0 982 + } 983 + 984 + func (x *IndexMetadata) GetIndexFeatureVersion() int64 { 985 + if x != nil { 986 + return x.IndexFeatureVersion 987 + } 988 + return 0 989 + } 990 + 991 + func (x *IndexMetadata) GetIndexMinReaderVersion() int64 { 992 + if x != nil { 993 + return x.IndexMinReaderVersion 994 + } 995 + return 0 996 + } 997 + 998 + func (x *IndexMetadata) GetIndexTime() *timestamppb.Timestamp { 999 + if x != nil { 1000 + return x.IndexTime 1001 + } 1002 + return nil 1003 + } 1004 + 1005 + func (x *IndexMetadata) GetPlainAscii() bool { 1006 + if x != nil { 1007 + return x.PlainAscii 1008 + } 1009 + return false 1010 + } 1011 + 1012 + func (x *IndexMetadata) GetLanguageMap() map[string]uint32 { 1013 + if x != nil { 1014 + return x.LanguageMap 1015 + } 1016 + return nil 1017 + } 1018 + 1019 + func (x *IndexMetadata) GetZoektVersion() string { 1020 + if x != nil { 1021 + return x.ZoektVersion 1022 + } 1023 + return "" 1024 + } 1025 + 1026 + func (x *IndexMetadata) GetId() string { 1027 + if x != nil { 1028 + return x.Id 1029 + } 1030 + return "" 1031 + } 1032 + 1033 + type MinimalRepoListEntry struct { 1034 + state protoimpl.MessageState 1035 + sizeCache protoimpl.SizeCache 1036 + unknownFields protoimpl.UnknownFields 1037 + 1038 + HasSymbols bool `protobuf:"varint,1,opt,name=has_symbols,json=hasSymbols,proto3" json:"has_symbols,omitempty"` 1039 + Branches []*RepositoryBranch `protobuf:"bytes,2,rep,name=branches,proto3" json:"branches,omitempty"` 1040 + } 1041 + 1042 + func (x *MinimalRepoListEntry) Reset() { 1043 + *x = MinimalRepoListEntry{} 1044 + if protoimpl.UnsafeEnabled { 1045 + mi := &file_webserver_proto_msgTypes[9] 1046 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1047 + ms.StoreMessageInfo(mi) 1048 + } 1049 + } 1050 + 1051 + func (x *MinimalRepoListEntry) String() string { 1052 + return protoimpl.X.MessageStringOf(x) 1053 + } 1054 + 1055 + func (*MinimalRepoListEntry) ProtoMessage() {} 1056 + 1057 + func (x *MinimalRepoListEntry) ProtoReflect() protoreflect.Message { 1058 + mi := &file_webserver_proto_msgTypes[9] 1059 + if protoimpl.UnsafeEnabled && x != nil { 1060 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1061 + if ms.LoadMessageInfo() == nil { 1062 + ms.StoreMessageInfo(mi) 1063 + } 1064 + return ms 1065 + } 1066 + return mi.MessageOf(x) 1067 + } 1068 + 1069 + // Deprecated: Use MinimalRepoListEntry.ProtoReflect.Descriptor instead. 1070 + func (*MinimalRepoListEntry) Descriptor() ([]byte, []int) { 1071 + return file_webserver_proto_rawDescGZIP(), []int{9} 1072 + } 1073 + 1074 + func (x *MinimalRepoListEntry) GetHasSymbols() bool { 1075 + if x != nil { 1076 + return x.HasSymbols 1077 + } 1078 + return false 1079 + } 1080 + 1081 + func (x *MinimalRepoListEntry) GetBranches() []*RepositoryBranch { 1082 + if x != nil { 1083 + return x.Branches 1084 + } 1085 + return nil 1086 + } 1087 + 1088 + // RepositoryBranch describes an indexed branch, which is a name 1089 + // combined with a version. 1090 + type RepositoryBranch struct { 1091 + state protoimpl.MessageState 1092 + sizeCache protoimpl.SizeCache 1093 + unknownFields protoimpl.UnknownFields 1094 + 1095 + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 1096 + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` 1097 + } 1098 + 1099 + func (x *RepositoryBranch) Reset() { 1100 + *x = RepositoryBranch{} 1101 + if protoimpl.UnsafeEnabled { 1102 + mi := &file_webserver_proto_msgTypes[10] 1103 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1104 + ms.StoreMessageInfo(mi) 1105 + } 1106 + } 1107 + 1108 + func (x *RepositoryBranch) String() string { 1109 + return protoimpl.X.MessageStringOf(x) 1110 + } 1111 + 1112 + func (*RepositoryBranch) ProtoMessage() {} 1113 + 1114 + func (x *RepositoryBranch) ProtoReflect() protoreflect.Message { 1115 + mi := &file_webserver_proto_msgTypes[10] 1116 + if protoimpl.UnsafeEnabled && x != nil { 1117 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1118 + if ms.LoadMessageInfo() == nil { 1119 + ms.StoreMessageInfo(mi) 1120 + } 1121 + return ms 1122 + } 1123 + return mi.MessageOf(x) 1124 + } 1125 + 1126 + // Deprecated: Use RepositoryBranch.ProtoReflect.Descriptor instead. 1127 + func (*RepositoryBranch) Descriptor() ([]byte, []int) { 1128 + return file_webserver_proto_rawDescGZIP(), []int{10} 1129 + } 1130 + 1131 + func (x *RepositoryBranch) GetName() string { 1132 + if x != nil { 1133 + return x.Name 1134 + } 1135 + return "" 1136 + } 1137 + 1138 + func (x *RepositoryBranch) GetVersion() string { 1139 + if x != nil { 1140 + return x.Version 1141 + } 1142 + return "" 1143 + } 1144 + 1145 + // RepoStats is a collection of statistics for a set of repositories. 1146 + type RepoStats struct { 1147 + state protoimpl.MessageState 1148 + sizeCache protoimpl.SizeCache 1149 + unknownFields protoimpl.UnknownFields 1150 + 1151 + // repos is used for aggregrating the number of repositories. 1152 + Repos int64 `protobuf:"varint,1,opt,name=repos,proto3" json:"repos,omitempty"` 1153 + // shards is the total number of search shards. 1154 + Shards int64 `protobuf:"varint,2,opt,name=shards,proto3" json:"shards,omitempty"` 1155 + // documents holds the number of documents or files. 1156 + Documents int64 `protobuf:"varint,3,opt,name=documents,proto3" json:"documents,omitempty"` 1157 + // index_bytes is the amount of RAM used for index overhead. 1158 + IndexBytes int64 `protobuf:"varint,4,opt,name=index_bytes,json=indexBytes,proto3" json:"index_bytes,omitempty"` 1159 + // content_bytes is the amount of RAM used for raw content. 1160 + ContentBytes int64 `protobuf:"varint,5,opt,name=content_bytes,json=contentBytes,proto3" json:"content_bytes,omitempty"` 1161 + // new_lines_count is the number of newlines "\n" that appear in the zoekt 1162 + // indexed documents. This is not exactly the same as line count, since it 1163 + // will not include lines not terminated by "\n" (eg a file with no "\n", or 1164 + // a final line without "\n"). Note: Zoekt deduplicates documents across 1165 + // branches, so if a path has the same contents on multiple branches, there 1166 + // is only one document for it. As such that document's newlines is only 1167 + // counted once. See DefaultBranchNewLinesCount and AllBranchesNewLinesCount 1168 + // for counts which do not deduplicate. 1169 + NewLinesCount uint64 `protobuf:"varint,6,opt,name=new_lines_count,json=newLinesCount,proto3" json:"new_lines_count,omitempty"` 1170 + // default_branch_new_lines_count is the number of newlines "\n" in the default 1171 + // branch. 1172 + DefaultBranchNewLinesCount uint64 `protobuf:"varint,7,opt,name=default_branch_new_lines_count,json=defaultBranchNewLinesCount,proto3" json:"default_branch_new_lines_count,omitempty"` 1173 + // other_branches_new_lines_count is the number of newlines "\n" in all branches 1174 + // except the default branch. 1175 + OtherBranchesNewLinesCount uint64 `protobuf:"varint,8,opt,name=other_branches_new_lines_count,json=otherBranchesNewLinesCount,proto3" json:"other_branches_new_lines_count,omitempty"` 1176 + } 1177 + 1178 + func (x *RepoStats) Reset() { 1179 + *x = RepoStats{} 1180 + if protoimpl.UnsafeEnabled { 1181 + mi := &file_webserver_proto_msgTypes[11] 1182 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1183 + ms.StoreMessageInfo(mi) 1184 + } 1185 + } 1186 + 1187 + func (x *RepoStats) String() string { 1188 + return protoimpl.X.MessageStringOf(x) 1189 + } 1190 + 1191 + func (*RepoStats) ProtoMessage() {} 1192 + 1193 + func (x *RepoStats) ProtoReflect() protoreflect.Message { 1194 + mi := &file_webserver_proto_msgTypes[11] 1195 + if protoimpl.UnsafeEnabled && x != nil { 1196 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1197 + if ms.LoadMessageInfo() == nil { 1198 + ms.StoreMessageInfo(mi) 1199 + } 1200 + return ms 1201 + } 1202 + return mi.MessageOf(x) 1203 + } 1204 + 1205 + // Deprecated: Use RepoStats.ProtoReflect.Descriptor instead. 1206 + func (*RepoStats) Descriptor() ([]byte, []int) { 1207 + return file_webserver_proto_rawDescGZIP(), []int{11} 1208 + } 1209 + 1210 + func (x *RepoStats) GetRepos() int64 { 1211 + if x != nil { 1212 + return x.Repos 1213 + } 1214 + return 0 1215 + } 1216 + 1217 + func (x *RepoStats) GetShards() int64 { 1218 + if x != nil { 1219 + return x.Shards 1220 + } 1221 + return 0 1222 + } 1223 + 1224 + func (x *RepoStats) GetDocuments() int64 { 1225 + if x != nil { 1226 + return x.Documents 1227 + } 1228 + return 0 1229 + } 1230 + 1231 + func (x *RepoStats) GetIndexBytes() int64 { 1232 + if x != nil { 1233 + return x.IndexBytes 1234 + } 1235 + return 0 1236 + } 1237 + 1238 + func (x *RepoStats) GetContentBytes() int64 { 1239 + if x != nil { 1240 + return x.ContentBytes 1241 + } 1242 + return 0 1243 + } 1244 + 1245 + func (x *RepoStats) GetNewLinesCount() uint64 { 1246 + if x != nil { 1247 + return x.NewLinesCount 1248 + } 1249 + return 0 1250 + } 1251 + 1252 + func (x *RepoStats) GetDefaultBranchNewLinesCount() uint64 { 1253 + if x != nil { 1254 + return x.DefaultBranchNewLinesCount 1255 + } 1256 + return 0 1257 + } 1258 + 1259 + func (x *RepoStats) GetOtherBranchesNewLinesCount() uint64 { 1260 + if x != nil { 1261 + return x.OtherBranchesNewLinesCount 1262 + } 1263 + return 0 1264 + } 1265 + 1266 + type Stats struct { 1267 + state protoimpl.MessageState 1268 + sizeCache protoimpl.SizeCache 1269 + unknownFields protoimpl.UnknownFields 1270 + 1271 + // Amount of I/O for reading contents. 1272 + ContentBytesLoaded int64 `protobuf:"varint,1,opt,name=content_bytes_loaded,json=contentBytesLoaded,proto3" json:"content_bytes_loaded,omitempty"` 1273 + // Amount of I/O for reading from index. 1274 + IndexBytesLoaded int64 `protobuf:"varint,2,opt,name=index_bytes_loaded,json=indexBytesLoaded,proto3" json:"index_bytes_loaded,omitempty"` 1275 + // Number of search shards that had a crash. 1276 + Crashes int64 `protobuf:"varint,3,opt,name=crashes,proto3" json:"crashes,omitempty"` 1277 + // Wall clock time for this search 1278 + Duration *durationpb.Duration `protobuf:"bytes,4,opt,name=duration,proto3" json:"duration,omitempty"` 1279 + // Number of files containing a match. 1280 + FileCount int64 `protobuf:"varint,5,opt,name=file_count,json=fileCount,proto3" json:"file_count,omitempty"` 1281 + // Number of files in shards that we considered. 1282 + ShardFilesConsidered int64 `protobuf:"varint,6,opt,name=shard_files_considered,json=shardFilesConsidered,proto3" json:"shard_files_considered,omitempty"` 1283 + // Files that we evaluated. Equivalent to files for which all 1284 + // atom matches (including negations) evaluated to true. 1285 + FilesConsidered int64 `protobuf:"varint,7,opt,name=files_considered,json=filesConsidered,proto3" json:"files_considered,omitempty"` 1286 + // Files for which we loaded file content to verify substring matches 1287 + FilesLoaded int64 `protobuf:"varint,8,opt,name=files_loaded,json=filesLoaded,proto3" json:"files_loaded,omitempty"` 1288 + // Candidate files whose contents weren't examined because we 1289 + // gathered enough matches. 1290 + FilesSkipped int64 `protobuf:"varint,9,opt,name=files_skipped,json=filesSkipped,proto3" json:"files_skipped,omitempty"` 1291 + // Shards that we scanned to find matches. 1292 + ShardsScanned int64 `protobuf:"varint,10,opt,name=shards_scanned,json=shardsScanned,proto3" json:"shards_scanned,omitempty"` 1293 + // Shards that we did not process because a query was canceled. 1294 + ShardsSkipped int64 `protobuf:"varint,11,opt,name=shards_skipped,json=shardsSkipped,proto3" json:"shards_skipped,omitempty"` 1295 + // Shards that we did not process because the query was rejected by the 1296 + // ngram filter indicating it had no matches. 1297 + ShardsSkippedFilter int64 `protobuf:"varint,12,opt,name=shards_skipped_filter,json=shardsSkippedFilter,proto3" json:"shards_skipped_filter,omitempty"` 1298 + // Number of non-overlapping matches 1299 + MatchCount int64 `protobuf:"varint,13,opt,name=match_count,json=matchCount,proto3" json:"match_count,omitempty"` 1300 + // Number of candidate matches as a result of searching ngrams. 1301 + NgramMatches int64 `protobuf:"varint,14,opt,name=ngram_matches,json=ngramMatches,proto3" json:"ngram_matches,omitempty"` 1302 + // Wall clock time for queued search. 1303 + Wait *durationpb.Duration `protobuf:"bytes,15,opt,name=wait,proto3" json:"wait,omitempty"` 1304 + // Number of times regexp was called on files that we evaluated. 1305 + RegexpsConsidered int64 `protobuf:"varint,16,opt,name=regexps_considered,json=regexpsConsidered,proto3" json:"regexps_considered,omitempty"` 1306 + // FlushReason explains why results were flushed. 1307 + FlushReason FlushReason `protobuf:"varint,17,opt,name=flush_reason,json=flushReason,proto3,enum=grpc.v1.FlushReason" json:"flush_reason,omitempty"` 1308 + } 1309 + 1310 + func (x *Stats) Reset() { 1311 + *x = Stats{} 1312 + if protoimpl.UnsafeEnabled { 1313 + mi := &file_webserver_proto_msgTypes[12] 1314 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1315 + ms.StoreMessageInfo(mi) 1316 + } 1317 + } 1318 + 1319 + func (x *Stats) String() string { 1320 + return protoimpl.X.MessageStringOf(x) 1321 + } 1322 + 1323 + func (*Stats) ProtoMessage() {} 1324 + 1325 + func (x *Stats) ProtoReflect() protoreflect.Message { 1326 + mi := &file_webserver_proto_msgTypes[12] 1327 + if protoimpl.UnsafeEnabled && x != nil { 1328 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1329 + if ms.LoadMessageInfo() == nil { 1330 + ms.StoreMessageInfo(mi) 1331 + } 1332 + return ms 1333 + } 1334 + return mi.MessageOf(x) 1335 + } 1336 + 1337 + // Deprecated: Use Stats.ProtoReflect.Descriptor instead. 1338 + func (*Stats) Descriptor() ([]byte, []int) { 1339 + return file_webserver_proto_rawDescGZIP(), []int{12} 1340 + } 1341 + 1342 + func (x *Stats) GetContentBytesLoaded() int64 { 1343 + if x != nil { 1344 + return x.ContentBytesLoaded 1345 + } 1346 + return 0 1347 + } 1348 + 1349 + func (x *Stats) GetIndexBytesLoaded() int64 { 1350 + if x != nil { 1351 + return x.IndexBytesLoaded 1352 + } 1353 + return 0 1354 + } 1355 + 1356 + func (x *Stats) GetCrashes() int64 { 1357 + if x != nil { 1358 + return x.Crashes 1359 + } 1360 + return 0 1361 + } 1362 + 1363 + func (x *Stats) GetDuration() *durationpb.Duration { 1364 + if x != nil { 1365 + return x.Duration 1366 + } 1367 + return nil 1368 + } 1369 + 1370 + func (x *Stats) GetFileCount() int64 { 1371 + if x != nil { 1372 + return x.FileCount 1373 + } 1374 + return 0 1375 + } 1376 + 1377 + func (x *Stats) GetShardFilesConsidered() int64 { 1378 + if x != nil { 1379 + return x.ShardFilesConsidered 1380 + } 1381 + return 0 1382 + } 1383 + 1384 + func (x *Stats) GetFilesConsidered() int64 { 1385 + if x != nil { 1386 + return x.FilesConsidered 1387 + } 1388 + return 0 1389 + } 1390 + 1391 + func (x *Stats) GetFilesLoaded() int64 { 1392 + if x != nil { 1393 + return x.FilesLoaded 1394 + } 1395 + return 0 1396 + } 1397 + 1398 + func (x *Stats) GetFilesSkipped() int64 { 1399 + if x != nil { 1400 + return x.FilesSkipped 1401 + } 1402 + return 0 1403 + } 1404 + 1405 + func (x *Stats) GetShardsScanned() int64 { 1406 + if x != nil { 1407 + return x.ShardsScanned 1408 + } 1409 + return 0 1410 + } 1411 + 1412 + func (x *Stats) GetShardsSkipped() int64 { 1413 + if x != nil { 1414 + return x.ShardsSkipped 1415 + } 1416 + return 0 1417 + } 1418 + 1419 + func (x *Stats) GetShardsSkippedFilter() int64 { 1420 + if x != nil { 1421 + return x.ShardsSkippedFilter 1422 + } 1423 + return 0 1424 + } 1425 + 1426 + func (x *Stats) GetMatchCount() int64 { 1427 + if x != nil { 1428 + return x.MatchCount 1429 + } 1430 + return 0 1431 + } 1432 + 1433 + func (x *Stats) GetNgramMatches() int64 { 1434 + if x != nil { 1435 + return x.NgramMatches 1436 + } 1437 + return 0 1438 + } 1439 + 1440 + func (x *Stats) GetWait() *durationpb.Duration { 1441 + if x != nil { 1442 + return x.Wait 1443 + } 1444 + return nil 1445 + } 1446 + 1447 + func (x *Stats) GetRegexpsConsidered() int64 { 1448 + if x != nil { 1449 + return x.RegexpsConsidered 1450 + } 1451 + return 0 1452 + } 1453 + 1454 + func (x *Stats) GetFlushReason() FlushReason { 1455 + if x != nil { 1456 + return x.FlushReason 1457 + } 1458 + return FlushReason_UNKNOWN 1459 + } 1460 + 1461 + // Progress contains information about the global progress of the running search query. 1462 + // This is used by the frontend to reorder results and emit them when stable. 1463 + // Sourcegraph specific: this is used when querying multiple zoekt-webserver instances. 1464 + type Progress struct { 1465 + state protoimpl.MessageState 1466 + sizeCache protoimpl.SizeCache 1467 + unknownFields protoimpl.UnknownFields 1468 + 1469 + // Priority of the shard that was searched. 1470 + Priority float64 `protobuf:"fixed64,1,opt,name=priority,proto3" json:"priority,omitempty"` 1471 + // max_pending_priority is the maximum priority of pending result that is being searched in parallel. 1472 + // This is used to reorder results when the result set is known to be stable-- that is, when a result's 1473 + // Priority is greater than the max(MaxPendingPriority) from the latest results of each backend, it can be returned to the user. 1474 + // 1475 + // max_pending_priority decreases monotonically in each SearchResult. 1476 + MaxPendingPriority float64 `protobuf:"fixed64,2,opt,name=max_pending_priority,json=maxPendingPriority,proto3" json:"max_pending_priority,omitempty"` 1477 + } 1478 + 1479 + func (x *Progress) Reset() { 1480 + *x = Progress{} 1481 + if protoimpl.UnsafeEnabled { 1482 + mi := &file_webserver_proto_msgTypes[13] 1483 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1484 + ms.StoreMessageInfo(mi) 1485 + } 1486 + } 1487 + 1488 + func (x *Progress) String() string { 1489 + return protoimpl.X.MessageStringOf(x) 1490 + } 1491 + 1492 + func (*Progress) ProtoMessage() {} 1493 + 1494 + func (x *Progress) ProtoReflect() protoreflect.Message { 1495 + mi := &file_webserver_proto_msgTypes[13] 1496 + if protoimpl.UnsafeEnabled && x != nil { 1497 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1498 + if ms.LoadMessageInfo() == nil { 1499 + ms.StoreMessageInfo(mi) 1500 + } 1501 + return ms 1502 + } 1503 + return mi.MessageOf(x) 1504 + } 1505 + 1506 + // Deprecated: Use Progress.ProtoReflect.Descriptor instead. 1507 + func (*Progress) Descriptor() ([]byte, []int) { 1508 + return file_webserver_proto_rawDescGZIP(), []int{13} 1509 + } 1510 + 1511 + func (x *Progress) GetPriority() float64 { 1512 + if x != nil { 1513 + return x.Priority 1514 + } 1515 + return 0 1516 + } 1517 + 1518 + func (x *Progress) GetMaxPendingPriority() float64 { 1519 + if x != nil { 1520 + return x.MaxPendingPriority 1521 + } 1522 + return 0 1523 + } 1524 + 1525 + // FileMatch contains all the matches within a file. 1526 + type FileMatch struct { 1527 + state protoimpl.MessageState 1528 + sizeCache protoimpl.SizeCache 1529 + unknownFields protoimpl.UnknownFields 1530 + 1531 + // Ranking; the higher, the better. 1532 + Score float64 `protobuf:"fixed64,1,opt,name=score,proto3" json:"score,omitempty"` 1533 + // For debugging. Needs DebugScore set, but public so tests in 1534 + // other packages can print some diagnostics. 1535 + Debug string `protobuf:"bytes,2,opt,name=debug,proto3" json:"debug,omitempty"` 1536 + FileName string `protobuf:"bytes,3,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` 1537 + // Repository is the globally unique name of the repo of the 1538 + // match 1539 + Repository string `protobuf:"bytes,4,opt,name=repository,proto3" json:"repository,omitempty"` 1540 + Branches []string `protobuf:"bytes,5,rep,name=branches,proto3" json:"branches,omitempty"` 1541 + // One of line_matches or chunk_matches will be returned depending on whether 1542 + // the SearchOptions.ChunkMatches is set. 1543 + LineMatches []*LineMatch `protobuf:"bytes,6,rep,name=line_matches,json=lineMatches,proto3" json:"line_matches,omitempty"` 1544 + ChunkMatches []*ChunkMatch `protobuf:"bytes,7,rep,name=chunk_matches,json=chunkMatches,proto3" json:"chunk_matches,omitempty"` 1545 + // repository_id is a Sourcegraph extension. This is the ID of Repository in 1546 + // Sourcegraph. 1547 + RepositoryId uint32 `protobuf:"varint,8,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` 1548 + RepositoryPriority float64 `protobuf:"fixed64,9,opt,name=repository_priority,json=repositoryPriority,proto3" json:"repository_priority,omitempty"` 1549 + // Only set if requested 1550 + Content []byte `protobuf:"bytes,10,opt,name=content,proto3" json:"content,omitempty"` 1551 + // Checksum of the content. 1552 + Checksum []byte `protobuf:"bytes,11,opt,name=checksum,proto3" json:"checksum,omitempty"` 1553 + // Detected language of the result. 1554 + Language string `protobuf:"bytes,12,opt,name=language,proto3" json:"language,omitempty"` 1555 + // sub_repository_name is the globally unique name of the repo, 1556 + // if it came from a subrepository 1557 + SubRepositoryName string `protobuf:"bytes,13,opt,name=sub_repository_name,json=subRepositoryName,proto3" json:"sub_repository_name,omitempty"` 1558 + // sub_repository_path holds the prefix where the subrepository 1559 + // was mounted. 1560 + SubRepositoryPath string `protobuf:"bytes,14,opt,name=sub_repository_path,json=subRepositoryPath,proto3" json:"sub_repository_path,omitempty"` 1561 + // Commit SHA1 (hex) of the (sub)repo holding the file. 1562 + Version string `protobuf:"bytes,15,opt,name=version,proto3" json:"version,omitempty"` 1563 + } 1564 + 1565 + func (x *FileMatch) Reset() { 1566 + *x = FileMatch{} 1567 + if protoimpl.UnsafeEnabled { 1568 + mi := &file_webserver_proto_msgTypes[14] 1569 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1570 + ms.StoreMessageInfo(mi) 1571 + } 1572 + } 1573 + 1574 + func (x *FileMatch) String() string { 1575 + return protoimpl.X.MessageStringOf(x) 1576 + } 1577 + 1578 + func (*FileMatch) ProtoMessage() {} 1579 + 1580 + func (x *FileMatch) ProtoReflect() protoreflect.Message { 1581 + mi := &file_webserver_proto_msgTypes[14] 1582 + if protoimpl.UnsafeEnabled && x != nil { 1583 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1584 + if ms.LoadMessageInfo() == nil { 1585 + ms.StoreMessageInfo(mi) 1586 + } 1587 + return ms 1588 + } 1589 + return mi.MessageOf(x) 1590 + } 1591 + 1592 + // Deprecated: Use FileMatch.ProtoReflect.Descriptor instead. 1593 + func (*FileMatch) Descriptor() ([]byte, []int) { 1594 + return file_webserver_proto_rawDescGZIP(), []int{14} 1595 + } 1596 + 1597 + func (x *FileMatch) GetScore() float64 { 1598 + if x != nil { 1599 + return x.Score 1600 + } 1601 + return 0 1602 + } 1603 + 1604 + func (x *FileMatch) GetDebug() string { 1605 + if x != nil { 1606 + return x.Debug 1607 + } 1608 + return "" 1609 + } 1610 + 1611 + func (x *FileMatch) GetFileName() string { 1612 + if x != nil { 1613 + return x.FileName 1614 + } 1615 + return "" 1616 + } 1617 + 1618 + func (x *FileMatch) GetRepository() string { 1619 + if x != nil { 1620 + return x.Repository 1621 + } 1622 + return "" 1623 + } 1624 + 1625 + func (x *FileMatch) GetBranches() []string { 1626 + if x != nil { 1627 + return x.Branches 1628 + } 1629 + return nil 1630 + } 1631 + 1632 + func (x *FileMatch) GetLineMatches() []*LineMatch { 1633 + if x != nil { 1634 + return x.LineMatches 1635 + } 1636 + return nil 1637 + } 1638 + 1639 + func (x *FileMatch) GetChunkMatches() []*ChunkMatch { 1640 + if x != nil { 1641 + return x.ChunkMatches 1642 + } 1643 + return nil 1644 + } 1645 + 1646 + func (x *FileMatch) GetRepositoryId() uint32 { 1647 + if x != nil { 1648 + return x.RepositoryId 1649 + } 1650 + return 0 1651 + } 1652 + 1653 + func (x *FileMatch) GetRepositoryPriority() float64 { 1654 + if x != nil { 1655 + return x.RepositoryPriority 1656 + } 1657 + return 0 1658 + } 1659 + 1660 + func (x *FileMatch) GetContent() []byte { 1661 + if x != nil { 1662 + return x.Content 1663 + } 1664 + return nil 1665 + } 1666 + 1667 + func (x *FileMatch) GetChecksum() []byte { 1668 + if x != nil { 1669 + return x.Checksum 1670 + } 1671 + return nil 1672 + } 1673 + 1674 + func (x *FileMatch) GetLanguage() string { 1675 + if x != nil { 1676 + return x.Language 1677 + } 1678 + return "" 1679 + } 1680 + 1681 + func (x *FileMatch) GetSubRepositoryName() string { 1682 + if x != nil { 1683 + return x.SubRepositoryName 1684 + } 1685 + return "" 1686 + } 1687 + 1688 + func (x *FileMatch) GetSubRepositoryPath() string { 1689 + if x != nil { 1690 + return x.SubRepositoryPath 1691 + } 1692 + return "" 1693 + } 1694 + 1695 + func (x *FileMatch) GetVersion() string { 1696 + if x != nil { 1697 + return x.Version 1698 + } 1699 + return "" 1700 + } 1701 + 1702 + type LineMatch struct { 1703 + state protoimpl.MessageState 1704 + sizeCache protoimpl.SizeCache 1705 + unknownFields protoimpl.UnknownFields 1706 + 1707 + Line []byte `protobuf:"bytes,1,opt,name=line,proto3" json:"line,omitempty"` 1708 + LineStart int64 `protobuf:"varint,2,opt,name=line_start,json=lineStart,proto3" json:"line_start,omitempty"` 1709 + LineEnd int64 `protobuf:"varint,3,opt,name=line_end,json=lineEnd,proto3" json:"line_end,omitempty"` 1710 + LineNumber int64 `protobuf:"varint,4,opt,name=line_number,json=lineNumber,proto3" json:"line_number,omitempty"` 1711 + // before and after are only set when SearchOptions.NumContextLines is > 0 1712 + Before []byte `protobuf:"bytes,5,opt,name=before,proto3" json:"before,omitempty"` 1713 + After []byte `protobuf:"bytes,6,opt,name=after,proto3" json:"after,omitempty"` 1714 + // If set, this was a match on the filename. 1715 + FileName bool `protobuf:"varint,7,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` 1716 + // The higher the better. Only ranks the quality of the match 1717 + // within the file, does not take rank of file into account 1718 + Score float64 `protobuf:"fixed64,8,opt,name=score,proto3" json:"score,omitempty"` 1719 + DebugScore string `protobuf:"bytes,9,opt,name=debug_score,json=debugScore,proto3" json:"debug_score,omitempty"` 1720 + LineFragments []*LineFragmentMatch `protobuf:"bytes,10,rep,name=line_fragments,json=lineFragments,proto3" json:"line_fragments,omitempty"` 1721 + } 1722 + 1723 + func (x *LineMatch) Reset() { 1724 + *x = LineMatch{} 1725 + if protoimpl.UnsafeEnabled { 1726 + mi := &file_webserver_proto_msgTypes[15] 1727 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1728 + ms.StoreMessageInfo(mi) 1729 + } 1730 + } 1731 + 1732 + func (x *LineMatch) String() string { 1733 + return protoimpl.X.MessageStringOf(x) 1734 + } 1735 + 1736 + func (*LineMatch) ProtoMessage() {} 1737 + 1738 + func (x *LineMatch) ProtoReflect() protoreflect.Message { 1739 + mi := &file_webserver_proto_msgTypes[15] 1740 + if protoimpl.UnsafeEnabled && x != nil { 1741 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1742 + if ms.LoadMessageInfo() == nil { 1743 + ms.StoreMessageInfo(mi) 1744 + } 1745 + return ms 1746 + } 1747 + return mi.MessageOf(x) 1748 + } 1749 + 1750 + // Deprecated: Use LineMatch.ProtoReflect.Descriptor instead. 1751 + func (*LineMatch) Descriptor() ([]byte, []int) { 1752 + return file_webserver_proto_rawDescGZIP(), []int{15} 1753 + } 1754 + 1755 + func (x *LineMatch) GetLine() []byte { 1756 + if x != nil { 1757 + return x.Line 1758 + } 1759 + return nil 1760 + } 1761 + 1762 + func (x *LineMatch) GetLineStart() int64 { 1763 + if x != nil { 1764 + return x.LineStart 1765 + } 1766 + return 0 1767 + } 1768 + 1769 + func (x *LineMatch) GetLineEnd() int64 { 1770 + if x != nil { 1771 + return x.LineEnd 1772 + } 1773 + return 0 1774 + } 1775 + 1776 + func (x *LineMatch) GetLineNumber() int64 { 1777 + if x != nil { 1778 + return x.LineNumber 1779 + } 1780 + return 0 1781 + } 1782 + 1783 + func (x *LineMatch) GetBefore() []byte { 1784 + if x != nil { 1785 + return x.Before 1786 + } 1787 + return nil 1788 + } 1789 + 1790 + func (x *LineMatch) GetAfter() []byte { 1791 + if x != nil { 1792 + return x.After 1793 + } 1794 + return nil 1795 + } 1796 + 1797 + func (x *LineMatch) GetFileName() bool { 1798 + if x != nil { 1799 + return x.FileName 1800 + } 1801 + return false 1802 + } 1803 + 1804 + func (x *LineMatch) GetScore() float64 { 1805 + if x != nil { 1806 + return x.Score 1807 + } 1808 + return 0 1809 + } 1810 + 1811 + func (x *LineMatch) GetDebugScore() string { 1812 + if x != nil { 1813 + return x.DebugScore 1814 + } 1815 + return "" 1816 + } 1817 + 1818 + func (x *LineMatch) GetLineFragments() []*LineFragmentMatch { 1819 + if x != nil { 1820 + return x.LineFragments 1821 + } 1822 + return nil 1823 + } 1824 + 1825 + type LineFragmentMatch struct { 1826 + state protoimpl.MessageState 1827 + sizeCache protoimpl.SizeCache 1828 + unknownFields protoimpl.UnknownFields 1829 + 1830 + // Offset within the line, in bytes. 1831 + LineOffset int64 `protobuf:"varint,1,opt,name=line_offset,json=lineOffset,proto3" json:"line_offset,omitempty"` 1832 + // Offset from file start, in bytes. 1833 + Offset uint32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` 1834 + // Number bytes that match. 1835 + MatchLength int64 `protobuf:"varint,3,opt,name=match_length,json=matchLength,proto3" json:"match_length,omitempty"` 1836 + SymbolInfo *SymbolInfo `protobuf:"bytes,4,opt,name=symbol_info,json=symbolInfo,proto3,oneof" json:"symbol_info,omitempty"` 1837 + } 1838 + 1839 + func (x *LineFragmentMatch) Reset() { 1840 + *x = LineFragmentMatch{} 1841 + if protoimpl.UnsafeEnabled { 1842 + mi := &file_webserver_proto_msgTypes[16] 1843 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1844 + ms.StoreMessageInfo(mi) 1845 + } 1846 + } 1847 + 1848 + func (x *LineFragmentMatch) String() string { 1849 + return protoimpl.X.MessageStringOf(x) 1850 + } 1851 + 1852 + func (*LineFragmentMatch) ProtoMessage() {} 1853 + 1854 + func (x *LineFragmentMatch) ProtoReflect() protoreflect.Message { 1855 + mi := &file_webserver_proto_msgTypes[16] 1856 + if protoimpl.UnsafeEnabled && x != nil { 1857 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1858 + if ms.LoadMessageInfo() == nil { 1859 + ms.StoreMessageInfo(mi) 1860 + } 1861 + return ms 1862 + } 1863 + return mi.MessageOf(x) 1864 + } 1865 + 1866 + // Deprecated: Use LineFragmentMatch.ProtoReflect.Descriptor instead. 1867 + func (*LineFragmentMatch) Descriptor() ([]byte, []int) { 1868 + return file_webserver_proto_rawDescGZIP(), []int{16} 1869 + } 1870 + 1871 + func (x *LineFragmentMatch) GetLineOffset() int64 { 1872 + if x != nil { 1873 + return x.LineOffset 1874 + } 1875 + return 0 1876 + } 1877 + 1878 + func (x *LineFragmentMatch) GetOffset() uint32 { 1879 + if x != nil { 1880 + return x.Offset 1881 + } 1882 + return 0 1883 + } 1884 + 1885 + func (x *LineFragmentMatch) GetMatchLength() int64 { 1886 + if x != nil { 1887 + return x.MatchLength 1888 + } 1889 + return 0 1890 + } 1891 + 1892 + func (x *LineFragmentMatch) GetSymbolInfo() *SymbolInfo { 1893 + if x != nil { 1894 + return x.SymbolInfo 1895 + } 1896 + return nil 1897 + } 1898 + 1899 + type SymbolInfo struct { 1900 + state protoimpl.MessageState 1901 + sizeCache protoimpl.SizeCache 1902 + unknownFields protoimpl.UnknownFields 1903 + 1904 + Sym string `protobuf:"bytes,1,opt,name=sym,proto3" json:"sym,omitempty"` 1905 + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` 1906 + Parent string `protobuf:"bytes,3,opt,name=parent,proto3" json:"parent,omitempty"` 1907 + ParentKind string `protobuf:"bytes,4,opt,name=parent_kind,json=parentKind,proto3" json:"parent_kind,omitempty"` 1908 + } 1909 + 1910 + func (x *SymbolInfo) Reset() { 1911 + *x = SymbolInfo{} 1912 + if protoimpl.UnsafeEnabled { 1913 + mi := &file_webserver_proto_msgTypes[17] 1914 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1915 + ms.StoreMessageInfo(mi) 1916 + } 1917 + } 1918 + 1919 + func (x *SymbolInfo) String() string { 1920 + return protoimpl.X.MessageStringOf(x) 1921 + } 1922 + 1923 + func (*SymbolInfo) ProtoMessage() {} 1924 + 1925 + func (x *SymbolInfo) ProtoReflect() protoreflect.Message { 1926 + mi := &file_webserver_proto_msgTypes[17] 1927 + if protoimpl.UnsafeEnabled && x != nil { 1928 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1929 + if ms.LoadMessageInfo() == nil { 1930 + ms.StoreMessageInfo(mi) 1931 + } 1932 + return ms 1933 + } 1934 + return mi.MessageOf(x) 1935 + } 1936 + 1937 + // Deprecated: Use SymbolInfo.ProtoReflect.Descriptor instead. 1938 + func (*SymbolInfo) Descriptor() ([]byte, []int) { 1939 + return file_webserver_proto_rawDescGZIP(), []int{17} 1940 + } 1941 + 1942 + func (x *SymbolInfo) GetSym() string { 1943 + if x != nil { 1944 + return x.Sym 1945 + } 1946 + return "" 1947 + } 1948 + 1949 + func (x *SymbolInfo) GetKind() string { 1950 + if x != nil { 1951 + return x.Kind 1952 + } 1953 + return "" 1954 + } 1955 + 1956 + func (x *SymbolInfo) GetParent() string { 1957 + if x != nil { 1958 + return x.Parent 1959 + } 1960 + return "" 1961 + } 1962 + 1963 + func (x *SymbolInfo) GetParentKind() string { 1964 + if x != nil { 1965 + return x.ParentKind 1966 + } 1967 + return "" 1968 + } 1969 + 1970 + type ChunkMatch struct { 1971 + state protoimpl.MessageState 1972 + sizeCache protoimpl.SizeCache 1973 + unknownFields protoimpl.UnknownFields 1974 + 1975 + // A contiguous range of complete lines that fully contains Ranges. 1976 + Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` 1977 + // The location (inclusive) of the beginning of content 1978 + // relative to the beginning of the file. It will always be at the 1979 + // beginning of a line (Column will always be 1). 1980 + ContentStart *Location `protobuf:"bytes,2,opt,name=content_start,json=contentStart,proto3" json:"content_start,omitempty"` 1981 + // True if this match is a match on the file name, in 1982 + // which case Content will contain the file name. 1983 + FileName bool `protobuf:"varint,3,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` 1984 + // A set of matching ranges within this chunk. Each range is relative 1985 + // to the beginning of the file (not the beginning of Content). 1986 + Ranges []*Range `protobuf:"bytes,4,rep,name=ranges,proto3" json:"ranges,omitempty"` 1987 + // The symbol information associated with Ranges. If it is non-nil, 1988 + // its length will equal that of Ranges. Any of its elements may be nil. 1989 + SymbolInfo []*SymbolInfo `protobuf:"bytes,5,rep,name=symbol_info,json=symbolInfo,proto3" json:"symbol_info,omitempty"` 1990 + Score float64 `protobuf:"fixed64,6,opt,name=score,proto3" json:"score,omitempty"` 1991 + DebugScore string `protobuf:"bytes,7,opt,name=debug_score,json=debugScore,proto3" json:"debug_score,omitempty"` 1992 + } 1993 + 1994 + func (x *ChunkMatch) Reset() { 1995 + *x = ChunkMatch{} 1996 + if protoimpl.UnsafeEnabled { 1997 + mi := &file_webserver_proto_msgTypes[18] 1998 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 1999 + ms.StoreMessageInfo(mi) 2000 + } 2001 + } 2002 + 2003 + func (x *ChunkMatch) String() string { 2004 + return protoimpl.X.MessageStringOf(x) 2005 + } 2006 + 2007 + func (*ChunkMatch) ProtoMessage() {} 2008 + 2009 + func (x *ChunkMatch) ProtoReflect() protoreflect.Message { 2010 + mi := &file_webserver_proto_msgTypes[18] 2011 + if protoimpl.UnsafeEnabled && x != nil { 2012 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 2013 + if ms.LoadMessageInfo() == nil { 2014 + ms.StoreMessageInfo(mi) 2015 + } 2016 + return ms 2017 + } 2018 + return mi.MessageOf(x) 2019 + } 2020 + 2021 + // Deprecated: Use ChunkMatch.ProtoReflect.Descriptor instead. 2022 + func (*ChunkMatch) Descriptor() ([]byte, []int) { 2023 + return file_webserver_proto_rawDescGZIP(), []int{18} 2024 + } 2025 + 2026 + func (x *ChunkMatch) GetContent() []byte { 2027 + if x != nil { 2028 + return x.Content 2029 + } 2030 + return nil 2031 + } 2032 + 2033 + func (x *ChunkMatch) GetContentStart() *Location { 2034 + if x != nil { 2035 + return x.ContentStart 2036 + } 2037 + return nil 2038 + } 2039 + 2040 + func (x *ChunkMatch) GetFileName() bool { 2041 + if x != nil { 2042 + return x.FileName 2043 + } 2044 + return false 2045 + } 2046 + 2047 + func (x *ChunkMatch) GetRanges() []*Range { 2048 + if x != nil { 2049 + return x.Ranges 2050 + } 2051 + return nil 2052 + } 2053 + 2054 + func (x *ChunkMatch) GetSymbolInfo() []*SymbolInfo { 2055 + if x != nil { 2056 + return x.SymbolInfo 2057 + } 2058 + return nil 2059 + } 2060 + 2061 + func (x *ChunkMatch) GetScore() float64 { 2062 + if x != nil { 2063 + return x.Score 2064 + } 2065 + return 0 2066 + } 2067 + 2068 + func (x *ChunkMatch) GetDebugScore() string { 2069 + if x != nil { 2070 + return x.DebugScore 2071 + } 2072 + return "" 2073 + } 2074 + 2075 + type Range struct { 2076 + state protoimpl.MessageState 2077 + sizeCache protoimpl.SizeCache 2078 + unknownFields protoimpl.UnknownFields 2079 + 2080 + // The inclusive beginning of the range. 2081 + Start *Location `protobuf:"bytes,1,opt,name=start,proto3" json:"start,omitempty"` 2082 + // The exclusive end of the range. 2083 + End *Location `protobuf:"bytes,2,opt,name=end,proto3" json:"end,omitempty"` 2084 + } 2085 + 2086 + func (x *Range) Reset() { 2087 + *x = Range{} 2088 + if protoimpl.UnsafeEnabled { 2089 + mi := &file_webserver_proto_msgTypes[19] 2090 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 2091 + ms.StoreMessageInfo(mi) 2092 + } 2093 + } 2094 + 2095 + func (x *Range) String() string { 2096 + return protoimpl.X.MessageStringOf(x) 2097 + } 2098 + 2099 + func (*Range) ProtoMessage() {} 2100 + 2101 + func (x *Range) ProtoReflect() protoreflect.Message { 2102 + mi := &file_webserver_proto_msgTypes[19] 2103 + if protoimpl.UnsafeEnabled && x != nil { 2104 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 2105 + if ms.LoadMessageInfo() == nil { 2106 + ms.StoreMessageInfo(mi) 2107 + } 2108 + return ms 2109 + } 2110 + return mi.MessageOf(x) 2111 + } 2112 + 2113 + // Deprecated: Use Range.ProtoReflect.Descriptor instead. 2114 + func (*Range) Descriptor() ([]byte, []int) { 2115 + return file_webserver_proto_rawDescGZIP(), []int{19} 2116 + } 2117 + 2118 + func (x *Range) GetStart() *Location { 2119 + if x != nil { 2120 + return x.Start 2121 + } 2122 + return nil 2123 + } 2124 + 2125 + func (x *Range) GetEnd() *Location { 2126 + if x != nil { 2127 + return x.End 2128 + } 2129 + return nil 2130 + } 2131 + 2132 + type Location struct { 2133 + state protoimpl.MessageState 2134 + sizeCache protoimpl.SizeCache 2135 + unknownFields protoimpl.UnknownFields 2136 + 2137 + // 0-based byte offset from the beginning of the file 2138 + ByteOffset uint32 `protobuf:"varint,1,opt,name=byte_offset,json=byteOffset,proto3" json:"byte_offset,omitempty"` 2139 + // 1-based line number from the beginning of the file 2140 + LineNumber uint32 `protobuf:"varint,2,opt,name=line_number,json=lineNumber,proto3" json:"line_number,omitempty"` 2141 + // 1-based column number (in runes) from the beginning of line 2142 + Column uint32 `protobuf:"varint,3,opt,name=column,proto3" json:"column,omitempty"` 2143 + } 2144 + 2145 + func (x *Location) Reset() { 2146 + *x = Location{} 2147 + if protoimpl.UnsafeEnabled { 2148 + mi := &file_webserver_proto_msgTypes[20] 2149 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 2150 + ms.StoreMessageInfo(mi) 2151 + } 2152 + } 2153 + 2154 + func (x *Location) String() string { 2155 + return protoimpl.X.MessageStringOf(x) 2156 + } 2157 + 2158 + func (*Location) ProtoMessage() {} 2159 + 2160 + func (x *Location) ProtoReflect() protoreflect.Message { 2161 + mi := &file_webserver_proto_msgTypes[20] 2162 + if protoimpl.UnsafeEnabled && x != nil { 2163 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 2164 + if ms.LoadMessageInfo() == nil { 2165 + ms.StoreMessageInfo(mi) 2166 + } 2167 + return ms 2168 + } 2169 + return mi.MessageOf(x) 2170 + } 2171 + 2172 + // Deprecated: Use Location.ProtoReflect.Descriptor instead. 2173 + func (*Location) Descriptor() ([]byte, []int) { 2174 + return file_webserver_proto_rawDescGZIP(), []int{20} 2175 + } 2176 + 2177 + func (x *Location) GetByteOffset() uint32 { 2178 + if x != nil { 2179 + return x.ByteOffset 2180 + } 2181 + return 0 2182 + } 2183 + 2184 + func (x *Location) GetLineNumber() uint32 { 2185 + if x != nil { 2186 + return x.LineNumber 2187 + } 2188 + return 0 2189 + } 2190 + 2191 + func (x *Location) GetColumn() uint32 { 2192 + if x != nil { 2193 + return x.Column 2194 + } 2195 + return 0 2196 + } 2197 + 2198 + var File_webserver_proto protoreflect.FileDescriptor 2199 + 2200 + var file_webserver_proto_rawDesc = []byte{ 2201 + 0x0a, 0x0f, 0x77, 0x65, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 2202 + 0x6f, 0x12, 0x07, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 2203 + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 2204 + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 2205 + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 2206 + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 2207 + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 2208 + 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 2209 + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5d, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 2210 + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 2211 + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 2212 + 0x51, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2a, 0x0a, 0x04, 0x6f, 0x70, 0x74, 0x73, 2213 + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 2214 + 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x04, 2215 + 0x6f, 0x70, 0x74, 0x73, 0x22, 0xa5, 0x03, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 2216 + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 2217 + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 2218 + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x12, 0x2d, 0x0a, 2219 + 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 2220 + 0x11, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 2221 + 0x73, 0x73, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x28, 0x0a, 0x05, 2222 + 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 2223 + 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 2224 + 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 2225 + 0x72, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x72, 0x70, 0x63, 2226 + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 2227 + 0x73, 0x65, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x55, 0x72, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 2228 + 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x72, 0x6c, 0x73, 0x12, 0x51, 0x0a, 0x0e, 0x6c, 0x69, 2229 + 0x6e, 0x65, 0x5f, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 2230 + 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 2231 + 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4c, 0x69, 0x6e, 0x65, 2232 + 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 2233 + 0x6c, 0x69, 0x6e, 0x65, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x3b, 0x0a, 2234 + 0x0d, 0x52, 0x65, 0x70, 0x6f, 0x55, 0x72, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 2235 + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 2236 + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 2237 + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a, 0x12, 0x4c, 0x69, 2238 + 0x6e, 0x65, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 2239 + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 2240 + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 2241 + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc4, 0x05, 0x0a, 2242 + 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2c, 2243 + 0x0a, 0x12, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x5f, 0x64, 0x6f, 0x63, 0x5f, 0x63, 2244 + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x73, 0x74, 0x69, 2245 + 0x6d, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x63, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 2246 + 0x77, 0x68, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x77, 0x68, 0x6f, 2247 + 0x6c, 0x65, 0x12, 0x31, 0x0a, 0x15, 0x73, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 2248 + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 2249 + 0x03, 0x52, 0x12, 0x73, 0x68, 0x61, 0x72, 0x64, 0x4d, 0x61, 0x78, 0x4d, 0x61, 0x74, 0x63, 0x68, 2250 + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x15, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6d, 2251 + 0x61, 0x78, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 2252 + 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4d, 0x61, 0x78, 0x4d, 0x61, 2253 + 0x74, 0x63, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3a, 0x0a, 0x1a, 0x73, 0x68, 0x61, 0x72, 2254 + 0x64, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 2255 + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x16, 0x73, 0x68, 2256 + 0x61, 0x72, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x61, 0x78, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x43, 2257 + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x0d, 0x6d, 0x61, 0x78, 0x5f, 0x77, 0x61, 0x6c, 0x6c, 2258 + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 2259 + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 2260 + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x57, 0x61, 0x6c, 0x6c, 0x54, 2261 + 0x69, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x0f, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x5f, 0x77, 0x61, 0x6c, 2262 + 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 2263 + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 2264 + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x57, 0x61, 2265 + 0x6c, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x15, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x6f, 2266 + 0x63, 0x5f, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 2267 + 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x44, 0x6f, 0x63, 0x44, 0x69, 0x73, 2268 + 0x70, 0x6c, 0x61, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x6e, 0x75, 0x6d, 2269 + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x18, 0x09, 2270 + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6e, 0x75, 0x6d, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 2271 + 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x6d, 2272 + 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x63, 0x68, 2273 + 0x75, 0x6e, 0x6b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x75, 0x73, 2274 + 0x65, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x73, 2275 + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x75, 0x73, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 2276 + 0x65, 0x6e, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x64, 0x6f, 0x63, 0x75, 2277 + 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 2278 + 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x01, 0x52, 0x13, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 2279 + 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x73, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x14, 0x0a, 0x05, 2280 + 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x74, 0x72, 0x61, 2281 + 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x73, 0x63, 0x6f, 0x72, 2282 + 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x62, 0x75, 0x67, 0x53, 0x63, 2283 + 0x6f, 0x72, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x75, 0x73, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x77, 0x6f, 2284 + 0x72, 0x64, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 2285 + 0x52, 0x11, 0x75, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x53, 0x63, 0x6f, 0x72, 2286 + 0x69, 0x6e, 0x67, 0x22, 0x59, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 2287 + 0x73, 0x74, 0x12, 0x20, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 2288 + 0x0b, 0x32, 0x0a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x52, 0x05, 0x71, 2289 + 0x75, 0x65, 0x72, 0x79, 0x12, 0x28, 0x0a, 0x04, 0x6f, 0x70, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 2290 + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 2291 + 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x04, 0x6f, 0x70, 0x74, 0x73, 0x22, 0xe7, 2292 + 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x38, 2293 + 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 2294 + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 2295 + 0x6f, 0x6e, 0x73, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 2296 + 0x64, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 2297 + 0x6d, 0x61, 0x6c, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 2298 + 0x61, 0x6c, 0x22, 0x83, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x70, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x46, 2299 + 0x69, 0x65, 0x6c, 0x64, 0x12, 0x1b, 0x0a, 0x17, 0x52, 0x45, 0x50, 0x4f, 0x5f, 0x4c, 0x49, 0x53, 2300 + 0x54, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 2301 + 0x00, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x45, 0x50, 0x4f, 0x5f, 0x4c, 0x49, 0x53, 0x54, 0x5f, 0x46, 2302 + 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x52, 0x45, 0x50, 0x4f, 0x53, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 2303 + 0x52, 0x45, 0x50, 0x4f, 0x5f, 0x4c, 0x49, 0x53, 0x54, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 2304 + 0x4d, 0x49, 0x4e, 0x49, 0x4d, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x52, 0x45, 0x50, 2305 + 0x4f, 0x5f, 0x4c, 0x49, 0x53, 0x54, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x52, 0x45, 0x50, 2306 + 0x4f, 0x53, 0x5f, 0x4d, 0x41, 0x50, 0x10, 0x03, 0x22, 0xb7, 0x03, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 2307 + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x72, 0x65, 0x70, 2308 + 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 2309 + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 2310 + 0x52, 0x05, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x12, 0x40, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x73, 2311 + 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x72, 0x70, 2312 + 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 2313 + 0x65, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 2314 + 0x08, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x4d, 0x61, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x61, 2315 + 0x73, 0x68, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x72, 0x61, 0x73, 2316 + 0x68, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 2317 + 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, 2318 + 0x6f, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x12, 0x3c, 0x0a, 2319 + 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 2320 + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 2321 + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x45, 0x6e, 0x74, 2322 + 0x72, 0x79, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x1a, 0x5a, 0x0a, 0x0d, 0x52, 2323 + 0x65, 0x70, 0x6f, 0x73, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 2324 + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x33, 2325 + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 2326 + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x52, 2327 + 0x65, 0x70, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x76, 0x61, 2328 + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x59, 0x0a, 0x0c, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 2329 + 0x61, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 2330 + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x33, 0x0a, 0x05, 0x76, 0x61, 0x6c, 2331 + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 2332 + 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x4c, 0x69, 2333 + 0x73, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 2334 + 0x38, 0x01, 0x22, 0xad, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x70, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x45, 2335 + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x33, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 2336 + 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 2337 + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0a, 0x72, 2338 + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x3d, 0x0a, 0x0e, 0x69, 0x6e, 0x64, 2339 + 0x65, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 2340 + 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 2341 + 0x78, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0d, 0x69, 0x6e, 0x64, 0x65, 0x78, 2342 + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x28, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 2343 + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 2344 + 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 2345 + 0x74, 0x73, 0x22, 0xc5, 0x06, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 2346 + 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 2347 + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 2348 + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 2349 + 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 2350 + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 2351 + 0x35, 0x0a, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 2352 + 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 2353 + 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x08, 0x62, 0x72, 2354 + 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x12, 0x45, 0x0a, 0x0c, 0x73, 0x75, 0x62, 0x5f, 0x72, 0x65, 2355 + 0x70, 0x6f, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 2356 + 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 2357 + 0x79, 0x2e, 0x53, 0x75, 0x62, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 2358 + 0x79, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x61, 0x70, 0x12, 0x2e, 0x0a, 2359 + 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x5f, 0x74, 0x65, 0x6d, 0x70, 2360 + 0x6c, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x6d, 2361 + 0x69, 0x74, 0x55, 0x72, 0x6c, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x0a, 2362 + 0x11, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 2363 + 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x66, 0x69, 0x6c, 0x65, 0x55, 0x72, 2364 + 0x6c, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x34, 0x0a, 0x16, 0x6c, 0x69, 0x6e, 2365 + 0x65, 0x5f, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 2366 + 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x6c, 0x69, 0x6e, 0x65, 0x46, 2367 + 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 2368 + 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 2369 + 0x01, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x41, 0x0a, 0x0a, 0x72, 2370 + 0x61, 0x77, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 2371 + 0x22, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 2372 + 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x61, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 2373 + 0x74, 0x72, 0x79, 0x52, 0x09, 0x72, 0x61, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 2374 + 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x72, 0x61, 2375 + 0x6e, 0x6b, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6f, 0x70, 0x74, 0x69, 2376 + 0x6f, 0x6e, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x64, 0x65, 0x78, 2377 + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x68, 0x61, 0x73, 0x5f, 0x73, 2378 + 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x68, 0x61, 2379 + 0x73, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x6f, 0x6d, 0x62, 2380 + 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x74, 0x6f, 0x6d, 2381 + 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x12, 0x48, 0x0a, 0x12, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 2382 + 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x10, 0x20, 0x01, 2383 + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 2384 + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x10, 2385 + 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x61, 0x74, 0x65, 2386 + 0x12, 0x26, 0x0a, 0x0e, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 2387 + 0x65, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x6f, 2388 + 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x73, 0x1a, 0x52, 0x0a, 0x0f, 0x53, 0x75, 0x62, 0x52, 2389 + 0x65, 0x70, 0x6f, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 2390 + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x29, 0x0a, 2391 + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 2392 + 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 2393 + 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3c, 0x0a, 0x0e, 2394 + 0x52, 0x61, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 2395 + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 2396 + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 2397 + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xcb, 0x03, 0x0a, 0x0d, 0x49, 2398 + 0x6e, 0x64, 0x65, 0x78, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x30, 0x0a, 0x14, 2399 + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x5f, 0x76, 0x65, 0x72, 2400 + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x69, 0x6e, 0x64, 0x65, 2401 + 0x78, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 2402 + 0x0a, 0x15, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 2403 + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x69, 2404 + 0x6e, 0x64, 0x65, 0x78, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 2405 + 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x18, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 2406 + 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 2407 + 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4d, 0x69, 0x6e, 0x52, 0x65, 2408 + 0x61, 0x64, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x0a, 0x69, 2409 + 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 2410 + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 2411 + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x69, 0x6e, 0x64, 2412 + 0x65, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 2413 + 0x61, 0x73, 0x63, 0x69, 0x69, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x70, 0x6c, 0x61, 2414 + 0x69, 0x6e, 0x41, 0x73, 0x63, 0x69, 0x69, 0x12, 0x4a, 0x0a, 0x0c, 0x6c, 0x61, 0x6e, 0x67, 0x75, 2415 + 0x61, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 2416 + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4d, 0x65, 0x74, 2417 + 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x4d, 0x61, 2418 + 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 2419 + 0x4d, 0x61, 0x70, 0x12, 0x23, 0x0a, 0x0d, 0x7a, 0x6f, 0x65, 0x6b, 0x74, 0x5f, 0x76, 0x65, 0x72, 2420 + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x7a, 0x6f, 0x65, 0x6b, 2421 + 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x08, 2422 + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x1a, 0x3e, 0x0a, 0x10, 0x4c, 0x61, 0x6e, 0x67, 2423 + 0x75, 0x61, 0x67, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 2424 + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 2425 + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 2426 + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x6e, 0x0a, 0x14, 0x4d, 0x69, 0x6e, 0x69, 2427 + 0x6d, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 2428 + 0x12, 0x1f, 0x0a, 0x0b, 0x68, 0x61, 0x73, 0x5f, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x73, 0x18, 2429 + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x68, 0x61, 0x73, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 2430 + 0x73, 0x12, 0x35, 0x0a, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x18, 0x02, 0x20, 2431 + 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 2432 + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x08, 2433 + 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x22, 0x40, 0x0a, 0x10, 0x52, 0x65, 0x70, 0x6f, 2434 + 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x12, 0x0a, 0x04, 2435 + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 2436 + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 2437 + 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xcd, 0x02, 0x0a, 0x09, 0x52, 2438 + 0x65, 0x70, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x70, 0x6f, 2439 + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x12, 0x16, 2440 + 0x0a, 0x06, 0x73, 0x68, 0x61, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 2441 + 0x73, 0x68, 0x61, 0x72, 0x64, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 2442 + 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 2443 + 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x62, 0x79, 2444 + 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 2445 + 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 2446 + 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x6f, 2447 + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 2448 + 0x77, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 2449 + 0x01, 0x28, 0x04, 0x52, 0x0d, 0x6e, 0x65, 0x77, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x43, 0x6f, 0x75, 2450 + 0x6e, 0x74, 0x12, 0x42, 0x0a, 0x1e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x62, 0x72, 2451 + 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x6e, 0x65, 0x77, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x5f, 0x63, 2452 + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1a, 0x64, 0x65, 0x66, 0x61, 2453 + 0x75, 0x6c, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x65, 0x77, 0x4c, 0x69, 0x6e, 0x65, 2454 + 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x42, 0x0a, 0x1e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 2455 + 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x5f, 0x6e, 0x65, 0x77, 0x5f, 0x6c, 0x69, 0x6e, 2456 + 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1a, 2457 + 0x6f, 0x74, 0x68, 0x65, 0x72, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x4e, 0x65, 0x77, 2458 + 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xdf, 0x05, 0x0a, 0x05, 0x53, 2459 + 0x74, 0x61, 0x74, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 2460 + 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 2461 + 0x28, 0x03, 0x52, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 2462 + 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x12, 0x2c, 0x0a, 0x12, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 2463 + 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 2464 + 0x28, 0x03, 0x52, 0x10, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4c, 0x6f, 2465 + 0x61, 0x64, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 2466 + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x72, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x35, 2467 + 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 2468 + 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 2469 + 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x75, 0x72, 2470 + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 2471 + 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x43, 2472 + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x16, 0x73, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x66, 0x69, 2473 + 0x6c, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x65, 0x64, 0x18, 0x06, 2474 + 0x20, 0x01, 0x28, 0x03, 0x52, 0x14, 0x73, 0x68, 0x61, 0x72, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 2475 + 0x43, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x66, 0x69, 2476 + 0x6c, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x65, 0x64, 0x18, 0x07, 2477 + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x69, 2478 + 0x64, 0x65, 0x72, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x5f, 0x6c, 2479 + 0x6f, 0x61, 0x64, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x66, 0x69, 0x6c, 2480 + 0x65, 0x73, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x69, 0x6c, 0x65, 2481 + 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 2482 + 0x0c, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x12, 0x25, 0x0a, 2483 + 0x0e, 0x73, 0x68, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x73, 0x63, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x18, 2484 + 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x73, 0x68, 0x61, 0x72, 0x64, 0x73, 0x53, 0x63, 0x61, 2485 + 0x6e, 0x6e, 0x65, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x68, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x73, 2486 + 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x73, 0x68, 2487 + 0x61, 0x72, 0x64, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x73, 2488 + 0x68, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x66, 0x69, 2489 + 0x6c, 0x74, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x73, 0x68, 0x61, 0x72, 2490 + 0x64, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 2491 + 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0d, 2492 + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 2493 + 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x67, 0x72, 0x61, 0x6d, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 2494 + 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6e, 0x67, 0x72, 0x61, 0x6d, 0x4d, 0x61, 2495 + 0x74, 0x63, 0x68, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x04, 0x77, 0x61, 0x69, 0x74, 0x18, 0x0f, 0x20, 2496 + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 2497 + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 2498 + 0x77, 0x61, 0x69, 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x72, 0x65, 0x67, 0x65, 0x78, 0x70, 0x73, 0x5f, 2499 + 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 2500 + 0x52, 0x11, 0x72, 0x65, 0x67, 0x65, 0x78, 0x70, 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 2501 + 0x72, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x0c, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x5f, 0x72, 0x65, 0x61, 2502 + 0x73, 0x6f, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x67, 0x72, 0x70, 0x63, 2503 + 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 2504 + 0x0b, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x58, 0x0a, 0x08, 2505 + 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 2506 + 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 2507 + 0x72, 0x69, 0x74, 0x79, 0x12, 0x30, 0x0a, 0x14, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x65, 0x6e, 0x64, 2508 + 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 2509 + 0x28, 0x01, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x72, 2510 + 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0xa3, 0x04, 0x0a, 0x09, 0x46, 0x69, 0x6c, 0x65, 0x4d, 2511 + 0x61, 0x74, 0x63, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 2512 + 0x01, 0x28, 0x01, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 2513 + 0x62, 0x75, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 2514 + 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 2515 + 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 2516 + 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 2517 + 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, 2518 + 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 2519 + 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x0c, 0x6c, 0x69, 0x6e, 2520 + 0x65, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 2521 + 0x12, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x65, 0x4d, 0x61, 2522 + 0x74, 0x63, 0x68, 0x52, 0x0b, 0x6c, 0x69, 0x6e, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 2523 + 0x12, 0x38, 0x0a, 0x0d, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 2524 + 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 2525 + 0x31, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x0c, 0x63, 0x68, 2526 + 0x75, 0x6e, 0x6b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 2527 + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 2528 + 0x0d, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 2529 + 0x2f, 0x0a, 0x13, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x70, 0x72, 2530 + 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x01, 0x52, 0x12, 0x72, 0x65, 2531 + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 2532 + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 2533 + 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 2534 + 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x68, 2535 + 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 2536 + 0x67, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 2537 + 0x67, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x73, 0x75, 0x62, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 2538 + 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 2539 + 0x11, 0x73, 0x75, 0x62, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4e, 0x61, 2540 + 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x73, 0x75, 0x62, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 2541 + 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 2542 + 0x11, 0x73, 0x75, 0x62, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x50, 0x61, 2543 + 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0f, 0x20, 2544 + 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xbf, 0x02, 0x0a, 2545 + 0x09, 0x4c, 0x69, 0x6e, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 2546 + 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1d, 2547 + 0x0a, 0x0a, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 2548 + 0x28, 0x03, 0x52, 0x09, 0x6c, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x19, 0x0a, 2549 + 0x08, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 2550 + 0x07, 0x6c, 0x69, 0x6e, 0x65, 0x45, 0x6e, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x69, 0x6e, 0x65, 2551 + 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c, 2552 + 0x69, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x65, 0x66, 2553 + 0x6f, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x62, 0x65, 0x66, 0x6f, 0x72, 2554 + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 2555 + 0x52, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 2556 + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 2557 + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x08, 0x20, 2558 + 0x01, 0x28, 0x01, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x65, 2559 + 0x62, 0x75, 0x67, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 2560 + 0x0a, 0x64, 0x65, 0x62, 0x75, 0x67, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x41, 0x0a, 0x0e, 0x6c, 2561 + 0x69, 0x6e, 0x65, 0x5f, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0a, 0x20, 2562 + 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 2563 + 0x6e, 0x65, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 2564 + 0x0d, 0x6c, 0x69, 0x6e, 0x65, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xba, 2565 + 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x6e, 0x65, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 2566 + 0x61, 0x74, 0x63, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x66, 0x66, 2567 + 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c, 0x69, 0x6e, 0x65, 0x4f, 2568 + 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 2569 + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x21, 0x0a, 2570 + 0x0c, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x03, 0x20, 2571 + 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 2572 + 0x12, 0x39, 0x0a, 0x0b, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 2573 + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 2574 + 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x0a, 0x73, 0x79, 2575 + 0x6d, 0x62, 0x6f, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 2576 + 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x6b, 0x0a, 0x0a, 0x53, 2577 + 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x79, 0x6d, 2578 + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x79, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6b, 2579 + 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 2580 + 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 2581 + 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 2582 + 0x74, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 2583 + 0x72, 0x65, 0x6e, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x22, 0x90, 0x02, 0x0a, 0x0a, 0x43, 0x68, 0x75, 2584 + 0x6e, 0x6b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 2585 + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 2586 + 0x74, 0x12, 0x36, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 2587 + 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 2588 + 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 2589 + 0x74, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 2590 + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, 0x69, 2591 + 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 2592 + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 2593 + 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x34, 2594 + 0x0a, 0x0b, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x05, 0x20, 2595 + 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 2596 + 0x6d, 0x62, 0x6f, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 2597 + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x06, 0x20, 2598 + 0x01, 0x28, 0x01, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x65, 2599 + 0x62, 0x75, 0x67, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 2600 + 0x0a, 0x64, 0x65, 0x62, 0x75, 0x67, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x55, 0x0a, 0x05, 0x52, 2601 + 0x61, 0x6e, 0x67, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 2602 + 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 2603 + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x23, 0x0a, 2604 + 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x72, 0x70, 2605 + 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x65, 2606 + 0x6e, 0x64, 0x22, 0x64, 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 2607 + 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 2608 + 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 2609 + 0x1f, 0x0a, 0x0b, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 2610 + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 2611 + 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 2612 + 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x2a, 0x4c, 0x0a, 0x0b, 0x46, 0x6c, 0x75, 0x73, 2613 + 0x68, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 2614 + 0x57, 0x4e, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x49, 0x4d, 0x45, 0x52, 0x5f, 0x45, 0x58, 2615 + 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x46, 0x49, 0x4e, 0x41, 0x4c, 2616 + 0x5f, 0x46, 0x4c, 0x55, 0x53, 0x48, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x41, 0x58, 0x5f, 2617 + 0x53, 0x49, 0x5a, 0x45, 0x10, 0x03, 0x32, 0xcb, 0x01, 0x0a, 0x10, 0x57, 0x65, 0x62, 0x73, 0x65, 2618 + 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x06, 0x53, 2619 + 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x16, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 2620 + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 2621 + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 2622 + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0c, 0x53, 0x74, 0x72, 0x65, 2623 + 0x61, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x16, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 2624 + 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 2625 + 0x1a, 0x17, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 2626 + 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x35, 0x0a, 2627 + 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 2628 + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x67, 0x72, 2629 + 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 2630 + 0x73, 0x65, 0x22, 0x00, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 2631 + 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2f, 0x7a, 2632 + 0x6f, 0x65, 0x6b, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 2633 + 0x6f, 0x74, 0x6f, 0x33, 2634 + } 2635 + 2636 + var ( 2637 + file_webserver_proto_rawDescOnce sync.Once 2638 + file_webserver_proto_rawDescData = file_webserver_proto_rawDesc 2639 + ) 2640 + 2641 + func file_webserver_proto_rawDescGZIP() []byte { 2642 + file_webserver_proto_rawDescOnce.Do(func() { 2643 + file_webserver_proto_rawDescData = protoimpl.X.CompressGZIP(file_webserver_proto_rawDescData) 2644 + }) 2645 + return file_webserver_proto_rawDescData 2646 + } 2647 + 2648 + var file_webserver_proto_enumTypes = make([]protoimpl.EnumInfo, 2) 2649 + var file_webserver_proto_msgTypes = make([]protoimpl.MessageInfo, 28) 2650 + var file_webserver_proto_goTypes = []interface{}{ 2651 + (FlushReason)(0), // 0: grpc.v1.FlushReason 2652 + (ListOptions_RepoListField)(0), // 1: grpc.v1.ListOptions.RepoListField 2653 + (*SearchRequest)(nil), // 2: grpc.v1.SearchRequest 2654 + (*SearchResponse)(nil), // 3: grpc.v1.SearchResponse 2655 + (*SearchOptions)(nil), // 4: grpc.v1.SearchOptions 2656 + (*ListRequest)(nil), // 5: grpc.v1.ListRequest 2657 + (*ListOptions)(nil), // 6: grpc.v1.ListOptions 2658 + (*ListResponse)(nil), // 7: grpc.v1.ListResponse 2659 + (*RepoListEntry)(nil), // 8: grpc.v1.RepoListEntry 2660 + (*Repository)(nil), // 9: grpc.v1.Repository 2661 + (*IndexMetadata)(nil), // 10: grpc.v1.IndexMetadata 2662 + (*MinimalRepoListEntry)(nil), // 11: grpc.v1.MinimalRepoListEntry 2663 + (*RepositoryBranch)(nil), // 12: grpc.v1.RepositoryBranch 2664 + (*RepoStats)(nil), // 13: grpc.v1.RepoStats 2665 + (*Stats)(nil), // 14: grpc.v1.Stats 2666 + (*Progress)(nil), // 15: grpc.v1.Progress 2667 + (*FileMatch)(nil), // 16: grpc.v1.FileMatch 2668 + (*LineMatch)(nil), // 17: grpc.v1.LineMatch 2669 + (*LineFragmentMatch)(nil), // 18: grpc.v1.LineFragmentMatch 2670 + (*SymbolInfo)(nil), // 19: grpc.v1.SymbolInfo 2671 + (*ChunkMatch)(nil), // 20: grpc.v1.ChunkMatch 2672 + (*Range)(nil), // 21: grpc.v1.Range 2673 + (*Location)(nil), // 22: grpc.v1.Location 2674 + nil, // 23: grpc.v1.SearchResponse.RepoUrlsEntry 2675 + nil, // 24: grpc.v1.SearchResponse.LineFragmentsEntry 2676 + nil, // 25: grpc.v1.ListResponse.ReposMapEntry 2677 + nil, // 26: grpc.v1.ListResponse.MinimalEntry 2678 + nil, // 27: grpc.v1.Repository.SubRepoMapEntry 2679 + nil, // 28: grpc.v1.Repository.RawConfigEntry 2680 + nil, // 29: grpc.v1.IndexMetadata.LanguageMapEntry 2681 + (*Q)(nil), // 30: grpc.v1.Q 2682 + (*durationpb.Duration)(nil), // 31: google.protobuf.Duration 2683 + (*timestamppb.Timestamp)(nil), // 32: google.protobuf.Timestamp 2684 + } 2685 + var file_webserver_proto_depIdxs = []int32{ 2686 + 30, // 0: grpc.v1.SearchRequest.query:type_name -> grpc.v1.Q 2687 + 4, // 1: grpc.v1.SearchRequest.opts:type_name -> grpc.v1.SearchOptions 2688 + 14, // 2: grpc.v1.SearchResponse.stats:type_name -> grpc.v1.Stats 2689 + 15, // 3: grpc.v1.SearchResponse.progress:type_name -> grpc.v1.Progress 2690 + 16, // 4: grpc.v1.SearchResponse.files:type_name -> grpc.v1.FileMatch 2691 + 23, // 5: grpc.v1.SearchResponse.repo_urls:type_name -> grpc.v1.SearchResponse.RepoUrlsEntry 2692 + 24, // 6: grpc.v1.SearchResponse.line_fragments:type_name -> grpc.v1.SearchResponse.LineFragmentsEntry 2693 + 31, // 7: grpc.v1.SearchOptions.max_wall_time:type_name -> google.protobuf.Duration 2694 + 31, // 8: grpc.v1.SearchOptions.flush_wall_time:type_name -> google.protobuf.Duration 2695 + 30, // 9: grpc.v1.ListRequest.query:type_name -> grpc.v1.Q 2696 + 6, // 10: grpc.v1.ListRequest.opts:type_name -> grpc.v1.ListOptions 2697 + 1, // 11: grpc.v1.ListOptions.field:type_name -> grpc.v1.ListOptions.RepoListField 2698 + 8, // 12: grpc.v1.ListResponse.repos:type_name -> grpc.v1.RepoListEntry 2699 + 25, // 13: grpc.v1.ListResponse.repos_map:type_name -> grpc.v1.ListResponse.ReposMapEntry 2700 + 13, // 14: grpc.v1.ListResponse.stats:type_name -> grpc.v1.RepoStats 2701 + 26, // 15: grpc.v1.ListResponse.minimal:type_name -> grpc.v1.ListResponse.MinimalEntry 2702 + 9, // 16: grpc.v1.RepoListEntry.repository:type_name -> grpc.v1.Repository 2703 + 10, // 17: grpc.v1.RepoListEntry.index_metadata:type_name -> grpc.v1.IndexMetadata 2704 + 13, // 18: grpc.v1.RepoListEntry.stats:type_name -> grpc.v1.RepoStats 2705 + 12, // 19: grpc.v1.Repository.branches:type_name -> grpc.v1.RepositoryBranch 2706 + 27, // 20: grpc.v1.Repository.sub_repo_map:type_name -> grpc.v1.Repository.SubRepoMapEntry 2707 + 28, // 21: grpc.v1.Repository.raw_config:type_name -> grpc.v1.Repository.RawConfigEntry 2708 + 32, // 22: grpc.v1.Repository.latest_commit_date:type_name -> google.protobuf.Timestamp 2709 + 32, // 23: grpc.v1.IndexMetadata.index_time:type_name -> google.protobuf.Timestamp 2710 + 29, // 24: grpc.v1.IndexMetadata.language_map:type_name -> grpc.v1.IndexMetadata.LanguageMapEntry 2711 + 12, // 25: grpc.v1.MinimalRepoListEntry.branches:type_name -> grpc.v1.RepositoryBranch 2712 + 31, // 26: grpc.v1.Stats.duration:type_name -> google.protobuf.Duration 2713 + 31, // 27: grpc.v1.Stats.wait:type_name -> google.protobuf.Duration 2714 + 0, // 28: grpc.v1.Stats.flush_reason:type_name -> grpc.v1.FlushReason 2715 + 17, // 29: grpc.v1.FileMatch.line_matches:type_name -> grpc.v1.LineMatch 2716 + 20, // 30: grpc.v1.FileMatch.chunk_matches:type_name -> grpc.v1.ChunkMatch 2717 + 18, // 31: grpc.v1.LineMatch.line_fragments:type_name -> grpc.v1.LineFragmentMatch 2718 + 19, // 32: grpc.v1.LineFragmentMatch.symbol_info:type_name -> grpc.v1.SymbolInfo 2719 + 22, // 33: grpc.v1.ChunkMatch.content_start:type_name -> grpc.v1.Location 2720 + 21, // 34: grpc.v1.ChunkMatch.ranges:type_name -> grpc.v1.Range 2721 + 19, // 35: grpc.v1.ChunkMatch.symbol_info:type_name -> grpc.v1.SymbolInfo 2722 + 22, // 36: grpc.v1.Range.start:type_name -> grpc.v1.Location 2723 + 22, // 37: grpc.v1.Range.end:type_name -> grpc.v1.Location 2724 + 11, // 38: grpc.v1.ListResponse.ReposMapEntry.value:type_name -> grpc.v1.MinimalRepoListEntry 2725 + 11, // 39: grpc.v1.ListResponse.MinimalEntry.value:type_name -> grpc.v1.MinimalRepoListEntry 2726 + 9, // 40: grpc.v1.Repository.SubRepoMapEntry.value:type_name -> grpc.v1.Repository 2727 + 2, // 41: grpc.v1.WebserverService.Search:input_type -> grpc.v1.SearchRequest 2728 + 2, // 42: grpc.v1.WebserverService.StreamSearch:input_type -> grpc.v1.SearchRequest 2729 + 5, // 43: grpc.v1.WebserverService.List:input_type -> grpc.v1.ListRequest 2730 + 3, // 44: grpc.v1.WebserverService.Search:output_type -> grpc.v1.SearchResponse 2731 + 3, // 45: grpc.v1.WebserverService.StreamSearch:output_type -> grpc.v1.SearchResponse 2732 + 7, // 46: grpc.v1.WebserverService.List:output_type -> grpc.v1.ListResponse 2733 + 44, // [44:47] is the sub-list for method output_type 2734 + 41, // [41:44] is the sub-list for method input_type 2735 + 41, // [41:41] is the sub-list for extension type_name 2736 + 41, // [41:41] is the sub-list for extension extendee 2737 + 0, // [0:41] is the sub-list for field type_name 2738 + } 2739 + 2740 + func init() { file_webserver_proto_init() } 2741 + func file_webserver_proto_init() { 2742 + if File_webserver_proto != nil { 2743 + return 2744 + } 2745 + file_query_proto_init() 2746 + if !protoimpl.UnsafeEnabled { 2747 + file_webserver_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 2748 + switch v := v.(*SearchRequest); i { 2749 + case 0: 2750 + return &v.state 2751 + case 1: 2752 + return &v.sizeCache 2753 + case 2: 2754 + return &v.unknownFields 2755 + default: 2756 + return nil 2757 + } 2758 + } 2759 + file_webserver_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 2760 + switch v := v.(*SearchResponse); i { 2761 + case 0: 2762 + return &v.state 2763 + case 1: 2764 + return &v.sizeCache 2765 + case 2: 2766 + return &v.unknownFields 2767 + default: 2768 + return nil 2769 + } 2770 + } 2771 + file_webserver_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { 2772 + switch v := v.(*SearchOptions); i { 2773 + case 0: 2774 + return &v.state 2775 + case 1: 2776 + return &v.sizeCache 2777 + case 2: 2778 + return &v.unknownFields 2779 + default: 2780 + return nil 2781 + } 2782 + } 2783 + file_webserver_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { 2784 + switch v := v.(*ListRequest); i { 2785 + case 0: 2786 + return &v.state 2787 + case 1: 2788 + return &v.sizeCache 2789 + case 2: 2790 + return &v.unknownFields 2791 + default: 2792 + return nil 2793 + } 2794 + } 2795 + file_webserver_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { 2796 + switch v := v.(*ListOptions); i { 2797 + case 0: 2798 + return &v.state 2799 + case 1: 2800 + return &v.sizeCache 2801 + case 2: 2802 + return &v.unknownFields 2803 + default: 2804 + return nil 2805 + } 2806 + } 2807 + file_webserver_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { 2808 + switch v := v.(*ListResponse); i { 2809 + case 0: 2810 + return &v.state 2811 + case 1: 2812 + return &v.sizeCache 2813 + case 2: 2814 + return &v.unknownFields 2815 + default: 2816 + return nil 2817 + } 2818 + } 2819 + file_webserver_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { 2820 + switch v := v.(*RepoListEntry); i { 2821 + case 0: 2822 + return &v.state 2823 + case 1: 2824 + return &v.sizeCache 2825 + case 2: 2826 + return &v.unknownFields 2827 + default: 2828 + return nil 2829 + } 2830 + } 2831 + file_webserver_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { 2832 + switch v := v.(*Repository); i { 2833 + case 0: 2834 + return &v.state 2835 + case 1: 2836 + return &v.sizeCache 2837 + case 2: 2838 + return &v.unknownFields 2839 + default: 2840 + return nil 2841 + } 2842 + } 2843 + file_webserver_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { 2844 + switch v := v.(*IndexMetadata); i { 2845 + case 0: 2846 + return &v.state 2847 + case 1: 2848 + return &v.sizeCache 2849 + case 2: 2850 + return &v.unknownFields 2851 + default: 2852 + return nil 2853 + } 2854 + } 2855 + file_webserver_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { 2856 + switch v := v.(*MinimalRepoListEntry); i { 2857 + case 0: 2858 + return &v.state 2859 + case 1: 2860 + return &v.sizeCache 2861 + case 2: 2862 + return &v.unknownFields 2863 + default: 2864 + return nil 2865 + } 2866 + } 2867 + file_webserver_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { 2868 + switch v := v.(*RepositoryBranch); i { 2869 + case 0: 2870 + return &v.state 2871 + case 1: 2872 + return &v.sizeCache 2873 + case 2: 2874 + return &v.unknownFields 2875 + default: 2876 + return nil 2877 + } 2878 + } 2879 + file_webserver_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { 2880 + switch v := v.(*RepoStats); i { 2881 + case 0: 2882 + return &v.state 2883 + case 1: 2884 + return &v.sizeCache 2885 + case 2: 2886 + return &v.unknownFields 2887 + default: 2888 + return nil 2889 + } 2890 + } 2891 + file_webserver_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { 2892 + switch v := v.(*Stats); i { 2893 + case 0: 2894 + return &v.state 2895 + case 1: 2896 + return &v.sizeCache 2897 + case 2: 2898 + return &v.unknownFields 2899 + default: 2900 + return nil 2901 + } 2902 + } 2903 + file_webserver_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { 2904 + switch v := v.(*Progress); i { 2905 + case 0: 2906 + return &v.state 2907 + case 1: 2908 + return &v.sizeCache 2909 + case 2: 2910 + return &v.unknownFields 2911 + default: 2912 + return nil 2913 + } 2914 + } 2915 + file_webserver_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { 2916 + switch v := v.(*FileMatch); i { 2917 + case 0: 2918 + return &v.state 2919 + case 1: 2920 + return &v.sizeCache 2921 + case 2: 2922 + return &v.unknownFields 2923 + default: 2924 + return nil 2925 + } 2926 + } 2927 + file_webserver_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { 2928 + switch v := v.(*LineMatch); i { 2929 + case 0: 2930 + return &v.state 2931 + case 1: 2932 + return &v.sizeCache 2933 + case 2: 2934 + return &v.unknownFields 2935 + default: 2936 + return nil 2937 + } 2938 + } 2939 + file_webserver_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { 2940 + switch v := v.(*LineFragmentMatch); i { 2941 + case 0: 2942 + return &v.state 2943 + case 1: 2944 + return &v.sizeCache 2945 + case 2: 2946 + return &v.unknownFields 2947 + default: 2948 + return nil 2949 + } 2950 + } 2951 + file_webserver_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { 2952 + switch v := v.(*SymbolInfo); i { 2953 + case 0: 2954 + return &v.state 2955 + case 1: 2956 + return &v.sizeCache 2957 + case 2: 2958 + return &v.unknownFields 2959 + default: 2960 + return nil 2961 + } 2962 + } 2963 + file_webserver_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { 2964 + switch v := v.(*ChunkMatch); i { 2965 + case 0: 2966 + return &v.state 2967 + case 1: 2968 + return &v.sizeCache 2969 + case 2: 2970 + return &v.unknownFields 2971 + default: 2972 + return nil 2973 + } 2974 + } 2975 + file_webserver_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { 2976 + switch v := v.(*Range); i { 2977 + case 0: 2978 + return &v.state 2979 + case 1: 2980 + return &v.sizeCache 2981 + case 2: 2982 + return &v.unknownFields 2983 + default: 2984 + return nil 2985 + } 2986 + } 2987 + file_webserver_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { 2988 + switch v := v.(*Location); i { 2989 + case 0: 2990 + return &v.state 2991 + case 1: 2992 + return &v.sizeCache 2993 + case 2: 2994 + return &v.unknownFields 2995 + default: 2996 + return nil 2997 + } 2998 + } 2999 + } 3000 + file_webserver_proto_msgTypes[16].OneofWrappers = []interface{}{} 3001 + type x struct{} 3002 + out := protoimpl.TypeBuilder{ 3003 + File: protoimpl.DescBuilder{ 3004 + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 3005 + RawDescriptor: file_webserver_proto_rawDesc, 3006 + NumEnums: 2, 3007 + NumMessages: 28, 3008 + NumExtensions: 0, 3009 + NumServices: 1, 3010 + }, 3011 + GoTypes: file_webserver_proto_goTypes, 3012 + DependencyIndexes: file_webserver_proto_depIdxs, 3013 + EnumInfos: file_webserver_proto_enumTypes, 3014 + MessageInfos: file_webserver_proto_msgTypes, 3015 + }.Build() 3016 + File_webserver_proto = out.File 3017 + file_webserver_proto_rawDesc = nil 3018 + file_webserver_proto_goTypes = nil 3019 + file_webserver_proto_depIdxs = nil 3020 + }
+491
grpc/v1/webserver.proto
··· 1 + syntax = "proto3"; 2 + 3 + package grpc.v1; 4 + 5 + import "google/protobuf/duration.proto"; 6 + import "google/protobuf/empty.proto"; 7 + import "google/protobuf/timestamp.proto"; 8 + import "query.proto"; 9 + 10 + option go_package = "github.com/sourcegraph/zoekt/grpc/v1"; 11 + 12 + service WebserverService { 13 + rpc Search(SearchRequest) returns (SearchResponse) {} 14 + 15 + rpc StreamSearch(SearchRequest) returns (stream SearchResponse) {} 16 + 17 + // List lists repositories. The query `q` can only contain 18 + // query.Repo atoms. 19 + rpc List(ListRequest) returns (ListResponse) {} 20 + } 21 + 22 + message SearchRequest { 23 + Q query = 1; 24 + SearchOptions opts = 2; 25 + } 26 + 27 + message SearchResponse { 28 + Stats stats = 1; 29 + Progress progress = 2; 30 + 31 + repeated FileMatch files = 3; 32 + 33 + // RepoURLs holds a repo => template string map. 34 + map<string, string> repo_urls = 4; 35 + 36 + // FragmentNames holds a repo => template string map, for 37 + // the line number fragment. 38 + map<string, string> line_fragments = 5; 39 + } 40 + 41 + message SearchOptions { 42 + // Return an upper-bound estimate of eligible documents in 43 + // stats.ShardFilesConsidered. 44 + bool estimate_doc_count = 1; 45 + 46 + // Return the whole file. 47 + bool whole = 2; 48 + 49 + // Maximum number of matches: skip all processing an index 50 + // shard after we found this many non-overlapping matches. 51 + int64 shard_max_match_count = 3; 52 + 53 + // Maximum number of matches: stop looking for more matches 54 + // once we have this many matches across shards. 55 + int64 total_max_match_count = 4; 56 + 57 + // Maximum number of matches: skip processing documents for a repository in 58 + // a shard once we have found ShardRepoMaxMatchCount. 59 + // 60 + // A compound shard may contain multiple repositories. This will most often 61 + // be set to 1 to find all repositories containing a result. 62 + int64 shard_repo_max_match_count = 5; 63 + 64 + // Abort the search after this much time has passed. 65 + google.protobuf.Duration max_wall_time = 6; 66 + 67 + // FlushWallTime if non-zero will stop streaming behaviour at first and 68 + // instead will collate and sort results. At FlushWallTime the results will 69 + // be sent and then the behaviour will revert to the normal streaming. 70 + google.protobuf.Duration flush_wall_time = 7; 71 + 72 + // Trim the number of results after collating and sorting the 73 + // results 74 + int64 max_doc_display_count = 8; 75 + 76 + // If set to a number greater than zero then up to this many number 77 + // of context lines will be added before and after each matched line. 78 + // Note that the included context lines might contain matches and 79 + // it's up to the consumer of the result to remove those lines. 80 + int64 num_context_lines = 9; 81 + 82 + // If true, ChunkMatches will be returned in each FileMatch rather than LineMatches 83 + // EXPERIMENTAL: the behavior of this flag may be changed in future versions. 84 + bool chunk_matches = 10; 85 + 86 + // EXPERIMENTAL. If true, document ranks are used as additional input for 87 + // sorting matches. 88 + bool use_document_ranks = 11; 89 + 90 + // EXPERIMENTAL. When UseDocumentRanks is enabled, this can be optionally set to adjust 91 + // their weight in the file match score. If the value is <= 0.0, the default weight value 92 + // will be used. This option is temporary and is only exposed for testing/ tuning purposes. 93 + double document_ranks_weight = 12; 94 + 95 + // Trace turns on opentracing for this request if true and if the Jaeger address was provided as 96 + // a command-line flag 97 + bool trace = 13; 98 + 99 + // If set, the search results will contain debug information for scoring. 100 + bool debug_score = 14; 101 + 102 + // EXPERIMENTAL. If true, use keyword-style scoring instead of the default scoring formula. 103 + // Currently, this treats each match in a file as a term and computes an approximation to BM25. 104 + // When enabled, all other scoring signals are ignored, including document ranks. 105 + bool use_keyword_scoring = 15; 106 + } 107 + 108 + message ListRequest { 109 + Q query = 1; 110 + ListOptions opts = 2; 111 + } 112 + 113 + message ListOptions { 114 + enum RepoListField { 115 + REPO_LIST_FIELD_UNKNOWN = 0; 116 + REPO_LIST_FIELD_REPOS = 1; 117 + REPO_LIST_FIELD_MINIMAL = 2; 118 + REPO_LIST_FIELD_REPOS_MAP = 3; 119 + } 120 + 121 + // Field decides which field to populate in RepoList response. 122 + RepoListField field = 1; 123 + 124 + // Return only Minimal data per repo that Sourcegraph frontend needs. 125 + // 126 + // Deprecated: use Field 127 + bool minimal = 16; 128 + } 129 + 130 + message ListResponse { 131 + // Returned when ListOptions.Field is RepoListFieldRepos. 132 + repeated RepoListEntry repos = 1; 133 + 134 + // ReposMap is set when ListOptions.Field is RepoListFieldReposMap. 135 + map<uint32, MinimalRepoListEntry> repos_map = 2; 136 + 137 + int64 crashes = 3; 138 + 139 + // Stats response to a List request. 140 + // This is the aggregate RepoStats of all repos matching the input query. 141 + RepoStats stats = 4; 142 + 143 + // Returned when ListOptions.Field is RepoListFieldMinimal. 144 + // 145 + // Deprecated: use ReposMap. 146 + map<uint32, MinimalRepoListEntry> minimal = 5; 147 + } 148 + 149 + message RepoListEntry { 150 + Repository repository = 1; 151 + IndexMetadata index_metadata = 2; 152 + RepoStats stats = 3; 153 + } 154 + 155 + message Repository { 156 + // Sourcegraph's repository ID 157 + uint32 id = 1; 158 + 159 + // The repository name 160 + string name = 2; 161 + 162 + // The repository URL. 163 + string url = 3; 164 + 165 + // The physical source where this repo came from, eg. full 166 + // path to the zip filename or git repository directory. This 167 + // will not be exposed in the UI, but can be used to detect 168 + // orphaned index shards. 169 + string source = 4; 170 + 171 + // The branches indexed in this repo. 172 + repeated RepositoryBranch branches = 5; 173 + 174 + // Nil if this is not the super project. 175 + map<string, Repository> sub_repo_map = 6; 176 + 177 + // URL template to link to the commit of a branch 178 + string commit_url_template = 7; 179 + 180 + // The repository URL for getting to a file. Has access to 181 + // {{Branch}}, {{Path}} 182 + string file_url_template = 8; 183 + 184 + // The URL fragment to add to a file URL for line numbers. has 185 + // access to {{LineNumber}}. The fragment should include the 186 + // separator, generally '#' or ';'. 187 + string line_fragment_template = 9; 188 + 189 + // Perf optimization: priority is set when we load the shard. It corresponds to 190 + // the value of "priority" stored in RawConfig. 191 + double priority = 10; 192 + 193 + // All zoekt.* configuration settings. 194 + map<string, string> raw_config = 11; 195 + 196 + // Importance of the repository, bigger is more important 197 + uint32 rank = 12; 198 + 199 + // index_options is a hash of the options used to create the index for the 200 + // repo. 201 + string index_options = 13; 202 + 203 + // has_symbols is true if this repository has indexed ctags 204 + // output. Sourcegraph specific: This field is more appropriate for 205 + // IndexMetadata. However, we store it here since the Sourcegraph frontend 206 + // can read this structure but not IndexMetadata. 207 + bool has_symbols = 14; 208 + 209 + // tombstone is true if we are not allowed to search this repo. 210 + bool tombstone = 15; 211 + 212 + // latest_commit_date is the date of the latest commit among all indexed Branches. 213 + // The date might be time.Time's 0-value if the repository was last indexed 214 + // before this field was added. 215 + google.protobuf.Timestamp latest_commit_date = 16; 216 + 217 + // file_tombstones is a set of file paths that should be ignored across all branches 218 + // in this shard. 219 + repeated string FileTombstones = 17; 220 + } 221 + 222 + message IndexMetadata { 223 + int64 index_format_version = 1; 224 + int64 index_feature_version = 2; 225 + int64 index_min_reader_version = 3; 226 + google.protobuf.Timestamp index_time = 4; 227 + bool plain_ascii = 5; 228 + map<string, uint32> language_map = 6; 229 + string zoekt_version = 7; 230 + string id = 8; 231 + } 232 + 233 + message MinimalRepoListEntry { 234 + bool has_symbols = 1; 235 + repeated RepositoryBranch branches = 2; 236 + } 237 + 238 + // RepositoryBranch describes an indexed branch, which is a name 239 + // combined with a version. 240 + message RepositoryBranch { 241 + string name = 1; 242 + string version = 2; 243 + } 244 + 245 + // RepoStats is a collection of statistics for a set of repositories. 246 + message RepoStats { 247 + // repos is used for aggregrating the number of repositories. 248 + int64 repos = 1; 249 + 250 + // shards is the total number of search shards. 251 + int64 shards = 2; 252 + 253 + // documents holds the number of documents or files. 254 + int64 documents = 3; 255 + 256 + // index_bytes is the amount of RAM used for index overhead. 257 + int64 index_bytes = 4; 258 + 259 + // content_bytes is the amount of RAM used for raw content. 260 + int64 content_bytes = 5; 261 + 262 + // Sourcegraph specific stats below. These are not as efficient to calculate 263 + // as the above statistics. We experimentally measured about a 10% slower 264 + // shard load time. However, we find these values very useful to track and 265 + // computing them outside of load time introduces a lot of complexity. 266 + 267 + // new_lines_count is the number of newlines "\n" that appear in the zoekt 268 + // indexed documents. This is not exactly the same as line count, since it 269 + // will not include lines not terminated by "\n" (eg a file with no "\n", or 270 + // a final line without "\n"). Note: Zoekt deduplicates documents across 271 + // branches, so if a path has the same contents on multiple branches, there 272 + // is only one document for it. As such that document's newlines is only 273 + // counted once. See DefaultBranchNewLinesCount and AllBranchesNewLinesCount 274 + // for counts which do not deduplicate. 275 + uint64 new_lines_count = 6; 276 + 277 + // default_branch_new_lines_count is the number of newlines "\n" in the default 278 + // branch. 279 + uint64 default_branch_new_lines_count = 7; 280 + 281 + // other_branches_new_lines_count is the number of newlines "\n" in all branches 282 + // except the default branch. 283 + uint64 other_branches_new_lines_count = 8; 284 + } 285 + 286 + message Stats { 287 + // Amount of I/O for reading contents. 288 + int64 content_bytes_loaded = 1; 289 + 290 + // Amount of I/O for reading from index. 291 + int64 index_bytes_loaded = 2; 292 + 293 + // Number of search shards that had a crash. 294 + int64 crashes = 3; 295 + 296 + // Wall clock time for this search 297 + google.protobuf.Duration duration = 4; 298 + 299 + // Number of files containing a match. 300 + int64 file_count = 5; 301 + 302 + // Number of files in shards that we considered. 303 + int64 shard_files_considered = 6; 304 + 305 + // Files that we evaluated. Equivalent to files for which all 306 + // atom matches (including negations) evaluated to true. 307 + int64 files_considered = 7; 308 + 309 + // Files for which we loaded file content to verify substring matches 310 + int64 files_loaded = 8; 311 + 312 + // Candidate files whose contents weren't examined because we 313 + // gathered enough matches. 314 + int64 files_skipped = 9; 315 + 316 + // Shards that we scanned to find matches. 317 + int64 shards_scanned = 10; 318 + 319 + // Shards that we did not process because a query was canceled. 320 + int64 shards_skipped = 11; 321 + 322 + // Shards that we did not process because the query was rejected by the 323 + // ngram filter indicating it had no matches. 324 + int64 shards_skipped_filter = 12; 325 + 326 + // Number of non-overlapping matches 327 + int64 match_count = 13; 328 + 329 + // Number of candidate matches as a result of searching ngrams. 330 + int64 ngram_matches = 14; 331 + 332 + // Wall clock time for queued search. 333 + google.protobuf.Duration wait = 15; 334 + 335 + // Number of times regexp was called on files that we evaluated. 336 + int64 regexps_considered = 16; 337 + 338 + // FlushReason explains why results were flushed. 339 + FlushReason flush_reason = 17; 340 + } 341 + 342 + enum FlushReason { 343 + UNKNOWN = 0; 344 + TIMER_EXPIRED = 1; 345 + FINAL_FLUSH = 2; 346 + MAX_SIZE = 3; 347 + } 348 + 349 + // Progress contains information about the global progress of the running search query. 350 + // This is used by the frontend to reorder results and emit them when stable. 351 + // Sourcegraph specific: this is used when querying multiple zoekt-webserver instances. 352 + message Progress { 353 + // Priority of the shard that was searched. 354 + double priority = 1; 355 + 356 + // max_pending_priority is the maximum priority of pending result that is being searched in parallel. 357 + // This is used to reorder results when the result set is known to be stable-- that is, when a result's 358 + // Priority is greater than the max(MaxPendingPriority) from the latest results of each backend, it can be returned to the user. 359 + // 360 + // max_pending_priority decreases monotonically in each SearchResult. 361 + double max_pending_priority = 2; 362 + } 363 + 364 + // FileMatch contains all the matches within a file. 365 + message FileMatch { 366 + // Ranking; the higher, the better. 367 + double score = 1; 368 + 369 + // For debugging. Needs DebugScore set, but public so tests in 370 + // other packages can print some diagnostics. 371 + string debug = 2; 372 + 373 + string file_name = 3; 374 + 375 + // Repository is the globally unique name of the repo of the 376 + // match 377 + string repository = 4; 378 + repeated string branches = 5; 379 + 380 + // One of line_matches or chunk_matches will be returned depending on whether 381 + // the SearchOptions.ChunkMatches is set. 382 + repeated LineMatch line_matches = 6; 383 + repeated ChunkMatch chunk_matches = 7; 384 + 385 + // repository_id is a Sourcegraph extension. This is the ID of Repository in 386 + // Sourcegraph. 387 + uint32 repository_id = 8; 388 + 389 + double repository_priority = 9; 390 + 391 + // Only set if requested 392 + bytes content = 10; 393 + 394 + // Checksum of the content. 395 + bytes checksum = 11; 396 + 397 + // Detected language of the result. 398 + string language = 12; 399 + 400 + // sub_repository_name is the globally unique name of the repo, 401 + // if it came from a subrepository 402 + string sub_repository_name = 13; 403 + 404 + // sub_repository_path holds the prefix where the subrepository 405 + // was mounted. 406 + string sub_repository_path = 14; 407 + 408 + // Commit SHA1 (hex) of the (sub)repo holding the file. 409 + string version = 15; 410 + } 411 + 412 + message LineMatch { 413 + bytes line = 1; 414 + int64 line_start = 2; 415 + int64 line_end = 3; 416 + int64 line_number = 4; 417 + 418 + // before and after are only set when SearchOptions.NumContextLines is > 0 419 + bytes before = 5; 420 + bytes after = 6; 421 + 422 + // If set, this was a match on the filename. 423 + bool file_name = 7; 424 + 425 + // The higher the better. Only ranks the quality of the match 426 + // within the file, does not take rank of file into account 427 + double score = 8; 428 + string debug_score = 9; 429 + 430 + repeated LineFragmentMatch line_fragments = 10; 431 + } 432 + 433 + message LineFragmentMatch { 434 + // Offset within the line, in bytes. 435 + int64 line_offset = 1; 436 + 437 + // Offset from file start, in bytes. 438 + uint32 offset = 2; 439 + 440 + // Number bytes that match. 441 + int64 match_length = 3; 442 + 443 + optional SymbolInfo symbol_info = 4; 444 + } 445 + 446 + message SymbolInfo { 447 + string sym = 1; 448 + string kind = 2; 449 + string parent = 3; 450 + string parent_kind = 4; 451 + } 452 + 453 + message ChunkMatch { 454 + // A contiguous range of complete lines that fully contains Ranges. 455 + bytes content = 1; 456 + // The location (inclusive) of the beginning of content 457 + // relative to the beginning of the file. It will always be at the 458 + // beginning of a line (Column will always be 1). 459 + Location content_start = 2; 460 + 461 + // True if this match is a match on the file name, in 462 + // which case Content will contain the file name. 463 + bool file_name = 3; 464 + 465 + // A set of matching ranges within this chunk. Each range is relative 466 + // to the beginning of the file (not the beginning of Content). 467 + repeated Range ranges = 4; 468 + 469 + // The symbol information associated with Ranges. If it is non-nil, 470 + // its length will equal that of Ranges. Any of its elements may be nil. 471 + repeated SymbolInfo symbol_info = 5; 472 + 473 + double score = 6; 474 + string debug_score = 7; 475 + } 476 + 477 + message Range { 478 + // The inclusive beginning of the range. 479 + Location start = 1; 480 + // The exclusive end of the range. 481 + Location end = 2; 482 + } 483 + 484 + message Location { 485 + // 0-based byte offset from the beginning of the file 486 + uint32 byte_offset = 1; 487 + // 1-based line number from the beginning of the file 488 + uint32 line_number = 2; 489 + // 1-based column number (in runes) from the beginning of line 490 + uint32 column = 3; 491 + }
+215
grpc/v1/webserver_grpc.pb.go
··· 1 + // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 + // versions: 3 + // - protoc-gen-go-grpc v1.3.0 4 + // - protoc (unknown) 5 + // source: webserver.proto 6 + 7 + package v1 8 + 9 + import ( 10 + context "context" 11 + grpc "google.golang.org/grpc" 12 + codes "google.golang.org/grpc/codes" 13 + status "google.golang.org/grpc/status" 14 + ) 15 + 16 + // This is a compile-time assertion to ensure that this generated file 17 + // is compatible with the grpc package it is being compiled against. 18 + // Requires gRPC-Go v1.32.0 or later. 19 + const _ = grpc.SupportPackageIsVersion7 20 + 21 + const ( 22 + WebserverService_Search_FullMethodName = "/grpc.v1.WebserverService/Search" 23 + WebserverService_StreamSearch_FullMethodName = "/grpc.v1.WebserverService/StreamSearch" 24 + WebserverService_List_FullMethodName = "/grpc.v1.WebserverService/List" 25 + ) 26 + 27 + // WebserverServiceClient is the client API for WebserverService service. 28 + // 29 + // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 30 + type WebserverServiceClient interface { 31 + Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) 32 + StreamSearch(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (WebserverService_StreamSearchClient, error) 33 + // List lists repositories. The query `q` can only contain 34 + // query.Repo atoms. 35 + List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) 36 + } 37 + 38 + type webserverServiceClient struct { 39 + cc grpc.ClientConnInterface 40 + } 41 + 42 + func NewWebserverServiceClient(cc grpc.ClientConnInterface) WebserverServiceClient { 43 + return &webserverServiceClient{cc} 44 + } 45 + 46 + func (c *webserverServiceClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) { 47 + out := new(SearchResponse) 48 + err := c.cc.Invoke(ctx, WebserverService_Search_FullMethodName, in, out, opts...) 49 + if err != nil { 50 + return nil, err 51 + } 52 + return out, nil 53 + } 54 + 55 + func (c *webserverServiceClient) StreamSearch(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (WebserverService_StreamSearchClient, error) { 56 + stream, err := c.cc.NewStream(ctx, &WebserverService_ServiceDesc.Streams[0], WebserverService_StreamSearch_FullMethodName, opts...) 57 + if err != nil { 58 + return nil, err 59 + } 60 + x := &webserverServiceStreamSearchClient{stream} 61 + if err := x.ClientStream.SendMsg(in); err != nil { 62 + return nil, err 63 + } 64 + if err := x.ClientStream.CloseSend(); err != nil { 65 + return nil, err 66 + } 67 + return x, nil 68 + } 69 + 70 + type WebserverService_StreamSearchClient interface { 71 + Recv() (*SearchResponse, error) 72 + grpc.ClientStream 73 + } 74 + 75 + type webserverServiceStreamSearchClient struct { 76 + grpc.ClientStream 77 + } 78 + 79 + func (x *webserverServiceStreamSearchClient) Recv() (*SearchResponse, error) { 80 + m := new(SearchResponse) 81 + if err := x.ClientStream.RecvMsg(m); err != nil { 82 + return nil, err 83 + } 84 + return m, nil 85 + } 86 + 87 + func (c *webserverServiceClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) { 88 + out := new(ListResponse) 89 + err := c.cc.Invoke(ctx, WebserverService_List_FullMethodName, in, out, opts...) 90 + if err != nil { 91 + return nil, err 92 + } 93 + return out, nil 94 + } 95 + 96 + // WebserverServiceServer is the server API for WebserverService service. 97 + // All implementations must embed UnimplementedWebserverServiceServer 98 + // for forward compatibility 99 + type WebserverServiceServer interface { 100 + Search(context.Context, *SearchRequest) (*SearchResponse, error) 101 + StreamSearch(*SearchRequest, WebserverService_StreamSearchServer) error 102 + // List lists repositories. The query `q` can only contain 103 + // query.Repo atoms. 104 + List(context.Context, *ListRequest) (*ListResponse, error) 105 + mustEmbedUnimplementedWebserverServiceServer() 106 + } 107 + 108 + // UnimplementedWebserverServiceServer must be embedded to have forward compatible implementations. 109 + type UnimplementedWebserverServiceServer struct { 110 + } 111 + 112 + func (UnimplementedWebserverServiceServer) Search(context.Context, *SearchRequest) (*SearchResponse, error) { 113 + return nil, status.Errorf(codes.Unimplemented, "method Search not implemented") 114 + } 115 + func (UnimplementedWebserverServiceServer) StreamSearch(*SearchRequest, WebserverService_StreamSearchServer) error { 116 + return status.Errorf(codes.Unimplemented, "method StreamSearch not implemented") 117 + } 118 + func (UnimplementedWebserverServiceServer) List(context.Context, *ListRequest) (*ListResponse, error) { 119 + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") 120 + } 121 + func (UnimplementedWebserverServiceServer) mustEmbedUnimplementedWebserverServiceServer() {} 122 + 123 + // UnsafeWebserverServiceServer may be embedded to opt out of forward compatibility for this service. 124 + // Use of this interface is not recommended, as added methods to WebserverServiceServer will 125 + // result in compilation errors. 126 + type UnsafeWebserverServiceServer interface { 127 + mustEmbedUnimplementedWebserverServiceServer() 128 + } 129 + 130 + func RegisterWebserverServiceServer(s grpc.ServiceRegistrar, srv WebserverServiceServer) { 131 + s.RegisterService(&WebserverService_ServiceDesc, srv) 132 + } 133 + 134 + func _WebserverService_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 135 + in := new(SearchRequest) 136 + if err := dec(in); err != nil { 137 + return nil, err 138 + } 139 + if interceptor == nil { 140 + return srv.(WebserverServiceServer).Search(ctx, in) 141 + } 142 + info := &grpc.UnaryServerInfo{ 143 + Server: srv, 144 + FullMethod: WebserverService_Search_FullMethodName, 145 + } 146 + handler := func(ctx context.Context, req interface{}) (interface{}, error) { 147 + return srv.(WebserverServiceServer).Search(ctx, req.(*SearchRequest)) 148 + } 149 + return interceptor(ctx, in, info, handler) 150 + } 151 + 152 + func _WebserverService_StreamSearch_Handler(srv interface{}, stream grpc.ServerStream) error { 153 + m := new(SearchRequest) 154 + if err := stream.RecvMsg(m); err != nil { 155 + return err 156 + } 157 + return srv.(WebserverServiceServer).StreamSearch(m, &webserverServiceStreamSearchServer{stream}) 158 + } 159 + 160 + type WebserverService_StreamSearchServer interface { 161 + Send(*SearchResponse) error 162 + grpc.ServerStream 163 + } 164 + 165 + type webserverServiceStreamSearchServer struct { 166 + grpc.ServerStream 167 + } 168 + 169 + func (x *webserverServiceStreamSearchServer) Send(m *SearchResponse) error { 170 + return x.ServerStream.SendMsg(m) 171 + } 172 + 173 + func _WebserverService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 174 + in := new(ListRequest) 175 + if err := dec(in); err != nil { 176 + return nil, err 177 + } 178 + if interceptor == nil { 179 + return srv.(WebserverServiceServer).List(ctx, in) 180 + } 181 + info := &grpc.UnaryServerInfo{ 182 + Server: srv, 183 + FullMethod: WebserverService_List_FullMethodName, 184 + } 185 + handler := func(ctx context.Context, req interface{}) (interface{}, error) { 186 + return srv.(WebserverServiceServer).List(ctx, req.(*ListRequest)) 187 + } 188 + return interceptor(ctx, in, info, handler) 189 + } 190 + 191 + // WebserverService_ServiceDesc is the grpc.ServiceDesc for WebserverService service. 192 + // It's only intended for direct use with grpc.RegisterService, 193 + // and not to be introspected or modified (even as a copy) 194 + var WebserverService_ServiceDesc = grpc.ServiceDesc{ 195 + ServiceName: "grpc.v1.WebserverService", 196 + HandlerType: (*WebserverServiceServer)(nil), 197 + Methods: []grpc.MethodDesc{ 198 + { 199 + MethodName: "Search", 200 + Handler: _WebserverService_Search_Handler, 201 + }, 202 + { 203 + MethodName: "List", 204 + Handler: _WebserverService_List_Handler, 205 + }, 206 + }, 207 + Streams: []grpc.StreamDesc{ 208 + { 209 + StreamName: "StreamSearch", 210 + Handler: _WebserverService_StreamSearch_Handler, 211 + ServerStreams: true, 212 + }, 213 + }, 214 + Metadata: "webserver.proto", 215 + }
+3
query/BUILD.bazel
··· 7 7 "marshal.go", 8 8 "parse.go", 9 9 "query.go", 10 + "query_proto.go", 10 11 "regexp.go", 11 12 ], 12 13 importpath = "github.com/sourcegraph/zoekt/query", 13 14 visibility = ["//visibility:public"], 14 15 deps = [ 16 + "//grpc/v1:grpc", 15 17 "@com_github_go_enry_go_enry_v2//:go-enry", 16 18 "@com_github_grafana_regexp//:regexp", 17 19 "@com_github_roaringbitmap_roaring//:roaring", ··· 23 25 srcs = [ 24 26 "marshal_test.go", 25 27 "parse_test.go", 28 + "query_proto_test.go", 26 29 "query_test.go", 27 30 "regexp_test.go", 28 31 ],
+458
query/query_proto.go
··· 1 + package query 2 + 3 + import ( 4 + "fmt" 5 + "regexp/syntax" 6 + 7 + "github.com/RoaringBitmap/roaring" 8 + "github.com/grafana/regexp" 9 + v1 "github.com/sourcegraph/zoekt/grpc/v1" 10 + ) 11 + 12 + func QToProto(q Q) *v1.Q { 13 + switch v := q.(type) { 14 + case RawConfig: 15 + return &v1.Q{Query: &v1.Q_RawConfig{RawConfig: v.ToProto()}} 16 + case *Regexp: 17 + return &v1.Q{Query: &v1.Q_Regexp{Regexp: v.ToProto()}} 18 + case *Symbol: 19 + return &v1.Q{Query: &v1.Q_Symbol{Symbol: v.ToProto()}} 20 + case *Language: 21 + return &v1.Q{Query: &v1.Q_Language{Language: v.ToProto()}} 22 + case *Const: 23 + return &v1.Q{Query: &v1.Q_Const{Const: v.Value}} 24 + case *Repo: 25 + return &v1.Q{Query: &v1.Q_Repo{Repo: v.ToProto()}} 26 + case *RepoRegexp: 27 + return &v1.Q{Query: &v1.Q_RepoRegexp{RepoRegexp: v.ToProto()}} 28 + case *BranchesRepos: 29 + return &v1.Q{Query: &v1.Q_BranchesRepos{BranchesRepos: v.ToProto()}} 30 + case *RepoIDs: 31 + return &v1.Q{Query: &v1.Q_RepoIds{RepoIds: v.ToProto()}} 32 + case *RepoSet: 33 + return &v1.Q{Query: &v1.Q_RepoSet{RepoSet: v.ToProto()}} 34 + case *FileNameSet: 35 + return &v1.Q{Query: &v1.Q_FileNameSet{FileNameSet: v.ToProto()}} 36 + case *Type: 37 + return &v1.Q{Query: &v1.Q_Type{Type: v.ToProto()}} 38 + case *Substring: 39 + return &v1.Q{Query: &v1.Q_Substring{Substring: v.ToProto()}} 40 + case *And: 41 + return &v1.Q{Query: &v1.Q_And{And: v.ToProto()}} 42 + case *Or: 43 + return &v1.Q{Query: &v1.Q_Or{Or: v.ToProto()}} 44 + case *Not: 45 + return &v1.Q{Query: &v1.Q_Not{Not: v.ToProto()}} 46 + case *Branch: 47 + return &v1.Q{Query: &v1.Q_Branch{Branch: v.ToProto()}} 48 + default: 49 + // The following nodes do not have a proto representation: 50 + // - GobCache: only needed for Gob encoding 51 + // - caseQ: only used internally, not by the RPC layer 52 + panic(fmt.Sprintf("unknown query node %T", v)) 53 + } 54 + } 55 + 56 + func QFromProto(p *v1.Q) (Q, error) { 57 + switch v := p.Query.(type) { 58 + case *v1.Q_RawConfig: 59 + return RawConfigFromProto(v.RawConfig), nil 60 + case *v1.Q_Regexp: 61 + return RegexpFromProto(v.Regexp) 62 + case *v1.Q_Symbol: 63 + return SymbolFromProto(v.Symbol) 64 + case *v1.Q_Language: 65 + return LanguageFromProto(v.Language), nil 66 + case *v1.Q_Const: 67 + return &Const{Value: v.Const}, nil 68 + case *v1.Q_Repo: 69 + return RepoFromProto(v.Repo) 70 + case *v1.Q_RepoRegexp: 71 + return RepoRegexpFromProto(v.RepoRegexp) 72 + case *v1.Q_BranchesRepos: 73 + return BranchesReposFromProto(v.BranchesRepos) 74 + case *v1.Q_RepoIds: 75 + return RepoIDsFromProto(v.RepoIds) 76 + case *v1.Q_RepoSet: 77 + return RepoSetFromProto(v.RepoSet), nil 78 + case *v1.Q_FileNameSet: 79 + return FileNameSetFromProto(v.FileNameSet), nil 80 + case *v1.Q_Type: 81 + return TypeFromProto(v.Type) 82 + case *v1.Q_Substring: 83 + return SubstringFromProto(v.Substring), nil 84 + case *v1.Q_And: 85 + return AndFromProto(v.And) 86 + case *v1.Q_Or: 87 + return OrFromProto(v.Or) 88 + case *v1.Q_Not: 89 + return NotFromProto(v.Not) 90 + case *v1.Q_Branch: 91 + return BranchFromProto(v.Branch), nil 92 + default: 93 + panic(fmt.Sprintf("unknown query node %T", p.Query)) 94 + } 95 + } 96 + 97 + func RegexpFromProto(p *v1.Regexp) (*Regexp, error) { 98 + parsed, err := syntax.Parse(p.GetRegexp(), regexpFlags) 99 + if err != nil { 100 + return nil, err 101 + } 102 + return &Regexp{ 103 + Regexp: parsed, 104 + FileName: p.GetFileName(), 105 + Content: p.GetContent(), 106 + CaseSensitive: p.GetCaseSensitive(), 107 + }, nil 108 + } 109 + 110 + func (r *Regexp) ToProto() *v1.Regexp { 111 + return &v1.Regexp{ 112 + Regexp: r.Regexp.String(), 113 + FileName: r.FileName, 114 + Content: r.Content, 115 + CaseSensitive: r.CaseSensitive, 116 + } 117 + } 118 + 119 + func SymbolFromProto(p *v1.Symbol) (*Symbol, error) { 120 + expr, err := QFromProto(p.GetExpr()) 121 + if err != nil { 122 + return nil, err 123 + } 124 + 125 + return &Symbol{ 126 + Expr: expr, 127 + }, nil 128 + } 129 + 130 + func (s *Symbol) ToProto() *v1.Symbol { 131 + return &v1.Symbol{ 132 + Expr: QToProto(s.Expr), 133 + } 134 + } 135 + 136 + func LanguageFromProto(p *v1.Language) *Language { 137 + return &Language{ 138 + Language: p.GetLanguage(), 139 + } 140 + } 141 + 142 + func (l *Language) ToProto() *v1.Language { 143 + return &v1.Language{Language: l.Language} 144 + } 145 + 146 + func RepoFromProto(p *v1.Repo) (*Repo, error) { 147 + r, err := regexp.Compile(p.GetRegexp()) 148 + if err != nil { 149 + return nil, err 150 + } 151 + return &Repo{ 152 + Regexp: r, 153 + }, nil 154 + } 155 + 156 + func (q *Repo) ToProto() *v1.Repo { 157 + return &v1.Repo{ 158 + Regexp: q.Regexp.String(), 159 + } 160 + } 161 + 162 + func RepoRegexpFromProto(p *v1.RepoRegexp) (*RepoRegexp, error) { 163 + r, err := regexp.Compile(p.GetRegexp()) 164 + if err != nil { 165 + return nil, err 166 + } 167 + return &RepoRegexp{ 168 + Regexp: r, 169 + }, nil 170 + } 171 + 172 + func (q *RepoRegexp) ToProto() *v1.RepoRegexp { 173 + return &v1.RepoRegexp{ 174 + Regexp: q.Regexp.String(), 175 + } 176 + } 177 + 178 + func BranchesReposFromProto(p *v1.BranchesRepos) (*BranchesRepos, error) { 179 + brs := make([]BranchRepos, len(p.GetList())) 180 + for i, br := range p.GetList() { 181 + branchRepos, err := BranchReposFromProto(br) 182 + if err != nil { 183 + return nil, err 184 + } 185 + brs[i] = branchRepos 186 + } 187 + return &BranchesRepos{ 188 + List: brs, 189 + }, nil 190 + } 191 + 192 + func (br *BranchesRepos) ToProto() *v1.BranchesRepos { 193 + list := make([]*v1.BranchRepos, len(br.List)) 194 + for i, branchRepo := range br.List { 195 + list[i] = branchRepo.ToProto() 196 + } 197 + 198 + return &v1.BranchesRepos{ 199 + List: list, 200 + } 201 + } 202 + 203 + func RepoIDsFromProto(p *v1.RepoIds) (*RepoIDs, error) { 204 + bm := roaring.NewBitmap() 205 + err := bm.UnmarshalBinary(p.GetRepos()) 206 + if err != nil { 207 + return nil, err 208 + } 209 + 210 + return &RepoIDs{ 211 + Repos: bm, 212 + }, nil 213 + } 214 + 215 + func (q *RepoIDs) ToProto() *v1.RepoIds { 216 + b, err := q.Repos.ToBytes() 217 + if err != nil { 218 + panic("unexpected error marshalling bitmap: " + err.Error()) 219 + } 220 + return &v1.RepoIds{ 221 + Repos: b, 222 + } 223 + } 224 + 225 + func BranchReposFromProto(p *v1.BranchRepos) (BranchRepos, error) { 226 + bm := roaring.NewBitmap() 227 + err := bm.UnmarshalBinary(p.GetRepos()) 228 + if err != nil { 229 + return BranchRepos{}, err 230 + } 231 + return BranchRepos{ 232 + Branch: p.GetBranch(), 233 + Repos: bm, 234 + }, nil 235 + } 236 + 237 + func (br *BranchRepos) ToProto() *v1.BranchRepos { 238 + b, err := br.Repos.ToBytes() 239 + if err != nil { 240 + panic("unexpected error marshalling bitmap: " + err.Error()) 241 + } 242 + 243 + return &v1.BranchRepos{ 244 + Branch: br.Branch, 245 + Repos: b, 246 + } 247 + } 248 + 249 + func RepoSetFromProto(p *v1.RepoSet) *RepoSet { 250 + return &RepoSet{ 251 + Set: p.GetSet(), 252 + } 253 + } 254 + 255 + func (q *RepoSet) ToProto() *v1.RepoSet { 256 + return &v1.RepoSet{ 257 + Set: q.Set, 258 + } 259 + } 260 + 261 + func FileNameSetFromProto(p *v1.FileNameSet) *FileNameSet { 262 + m := make(map[string]struct{}, len(p.GetSet())) 263 + for _, name := range p.GetSet() { 264 + m[name] = struct{}{} 265 + } 266 + return &FileNameSet{ 267 + Set: m, 268 + } 269 + } 270 + 271 + func (q *FileNameSet) ToProto() *v1.FileNameSet { 272 + s := make([]string, 0, len(q.Set)) 273 + for name := range q.Set { 274 + s = append(s, name) 275 + } 276 + return &v1.FileNameSet{ 277 + Set: s, 278 + } 279 + } 280 + 281 + func TypeFromProto(p *v1.Type) (*Type, error) { 282 + child, err := QFromProto(p.GetChild()) 283 + if err != nil { 284 + return nil, err 285 + } 286 + 287 + var kind uint8 288 + switch p.GetType() { 289 + case v1.Type_FILE_MATCH: 290 + kind = TypeFileMatch 291 + case v1.Type_FILE_NAME: 292 + kind = TypeFileName 293 + case v1.Type_REPO: 294 + kind = TypeRepo 295 + } 296 + 297 + return &Type{ 298 + Child: child, 299 + // TODO: make proper enum types 300 + Type: kind, 301 + }, nil 302 + } 303 + 304 + func (q *Type) ToProto() *v1.Type { 305 + var kind v1.Type_Kind 306 + switch q.Type { 307 + case TypeFileMatch: 308 + kind = v1.Type_FILE_MATCH 309 + case TypeFileName: 310 + kind = v1.Type_FILE_NAME 311 + case TypeRepo: 312 + kind = v1.Type_REPO 313 + } 314 + 315 + return &v1.Type{ 316 + Child: QToProto(q.Child), 317 + Type: kind, 318 + } 319 + } 320 + 321 + func SubstringFromProto(p *v1.Substring) *Substring { 322 + return &Substring{ 323 + Pattern: p.GetPattern(), 324 + CaseSensitive: p.GetCaseSensitive(), 325 + FileName: p.GetFileName(), 326 + Content: p.GetContent(), 327 + } 328 + } 329 + 330 + func (q *Substring) ToProto() *v1.Substring { 331 + return &v1.Substring{ 332 + Pattern: q.Pattern, 333 + CaseSensitive: q.CaseSensitive, 334 + FileName: q.FileName, 335 + Content: q.Content, 336 + } 337 + } 338 + 339 + func OrFromProto(p *v1.Or) (*Or, error) { 340 + children := make([]Q, len(p.GetChildren())) 341 + for i, child := range p.GetChildren() { 342 + c, err := QFromProto(child) 343 + if err != nil { 344 + return nil, err 345 + } 346 + children[i] = c 347 + } 348 + return &Or{ 349 + Children: children, 350 + }, nil 351 + } 352 + 353 + func (q *Or) ToProto() *v1.Or { 354 + children := make([]*v1.Q, len(q.Children)) 355 + for i, child := range q.Children { 356 + children[i] = QToProto(child) 357 + } 358 + return &v1.Or{ 359 + Children: children, 360 + } 361 + } 362 + 363 + func NotFromProto(p *v1.Not) (*Not, error) { 364 + child, err := QFromProto(p.GetChild()) 365 + if err != nil { 366 + return nil, err 367 + } 368 + return &Not{ 369 + Child: child, 370 + }, nil 371 + } 372 + 373 + func (q *Not) ToProto() *v1.Not { 374 + return &v1.Not{ 375 + Child: QToProto(q.Child), 376 + } 377 + } 378 + 379 + func AndFromProto(p *v1.And) (*And, error) { 380 + children := make([]Q, len(p.GetChildren())) 381 + for i, child := range p.GetChildren() { 382 + c, err := QFromProto(child) 383 + if err != nil { 384 + return nil, err 385 + } 386 + children[i] = c 387 + } 388 + return &And{ 389 + Children: children, 390 + }, nil 391 + } 392 + 393 + func (q *And) ToProto() *v1.And { 394 + children := make([]*v1.Q, len(q.Children)) 395 + for i, child := range q.Children { 396 + children[i] = QToProto(child) 397 + } 398 + return &v1.And{ 399 + Children: children, 400 + } 401 + } 402 + 403 + func BranchFromProto(p *v1.Branch) *Branch { 404 + return &Branch{ 405 + Pattern: p.GetPattern(), 406 + Exact: p.GetExact(), 407 + } 408 + } 409 + 410 + func (q *Branch) ToProto() *v1.Branch { 411 + return &v1.Branch{ 412 + Pattern: q.Pattern, 413 + Exact: q.Exact, 414 + } 415 + } 416 + 417 + func RawConfigFromProto(p *v1.RawConfig) (res RawConfig) { 418 + for _, protoFlag := range p.Flags { 419 + switch protoFlag { 420 + case v1.RawConfig_ONLY_PUBLIC: 421 + res |= RcOnlyPublic 422 + case v1.RawConfig_ONLY_PRIVATE: 423 + res |= RcOnlyPrivate 424 + case v1.RawConfig_ONLY_FORKS: 425 + res |= RcOnlyForks 426 + case v1.RawConfig_NO_FORKS: 427 + res |= RcNoForks 428 + case v1.RawConfig_ONLY_ARCHIVED: 429 + res |= RcOnlyArchived 430 + case v1.RawConfig_NO_ARCHIVED: 431 + res |= RcNoArchived 432 + } 433 + } 434 + return res 435 + } 436 + 437 + func (r RawConfig) ToProto() *v1.RawConfig { 438 + var flags []v1.RawConfig_Flag 439 + for _, flag := range flagNames { 440 + if r&flag.Mask != 0 { 441 + switch flag.Mask { 442 + case RcOnlyPublic: 443 + flags = append(flags, v1.RawConfig_ONLY_PUBLIC) 444 + case RcOnlyPrivate: 445 + flags = append(flags, v1.RawConfig_ONLY_PRIVATE) 446 + case RcOnlyForks: 447 + flags = append(flags, v1.RawConfig_ONLY_FORKS) 448 + case RcNoForks: 449 + flags = append(flags, v1.RawConfig_NO_FORKS) 450 + case RcOnlyArchived: 451 + flags = append(flags, v1.RawConfig_ONLY_ARCHIVED) 452 + case RcNoArchived: 453 + flags = append(flags, v1.RawConfig_NO_ARCHIVED) 454 + } 455 + } 456 + } 457 + return &v1.RawConfig{Flags: flags} 458 + }
+99
query/query_proto_test.go
··· 1 + package query 2 + 3 + import ( 4 + "regexp/syntax" 5 + "testing" 6 + 7 + "github.com/RoaringBitmap/roaring" 8 + "github.com/google/go-cmp/cmp" 9 + "github.com/grafana/regexp" 10 + ) 11 + 12 + func TestQueryRoundtrip(t *testing.T) { 13 + testCases := []Q{ 14 + &Regexp{ 15 + Regexp: regexpMustParse("foo"), 16 + FileName: true, 17 + Content: true, 18 + CaseSensitive: true, 19 + }, 20 + &Symbol{ 21 + Expr: &Language{ 22 + Language: "go", 23 + }, 24 + }, 25 + &Language{ 26 + Language: "typescript", 27 + }, 28 + &Const{ 29 + Value: true, 30 + }, 31 + &Repo{ 32 + Regexp: regexp.MustCompile("github.com/foo/bar"), 33 + }, 34 + &RepoRegexp{ 35 + Regexp: regexp.MustCompile("github.com/foo.*"), 36 + }, 37 + &BranchesRepos{ 38 + List: []BranchRepos{{ 39 + Branch: "test", 40 + Repos: func() *roaring.Bitmap { 41 + bm := roaring.New() 42 + bm.Add(3) 43 + bm.Add(34) 44 + return bm 45 + }(), 46 + }}, 47 + }, 48 + NewRepoIDs(3, 4, 5), 49 + &Branch{ 50 + Pattern: "master", 51 + Exact: true, 52 + }, 53 + NewRepoSet("test1", "test2"), 54 + NewFileNameSet("test3", "test4"), 55 + &And{ 56 + Children: []Q{ 57 + &Language{Language: "go"}, 58 + &Type{ 59 + Child: &Substring{Pattern: "interface"}, 60 + Type: TypeFileMatch, 61 + }, 62 + }, 63 + }, 64 + &Or{ 65 + Children: []Q{ 66 + &Language{Language: "go"}, 67 + &Type{ 68 + Child: &Substring{Pattern: "interface"}, 69 + Type: TypeFileMatch, 70 + }, 71 + }, 72 + }, 73 + &Not{ 74 + Child: &Language{Language: "go"}, 75 + }, 76 + } 77 + 78 + for _, q := range testCases { 79 + t.Run("", func(t *testing.T) { 80 + protoQ := QToProto(q) 81 + q2, err := QFromProto(protoQ) 82 + if err != nil { 83 + t.Fatal(err) 84 + } 85 + if diff := cmp.Diff(q.String(), q2.String()); diff != "" { 86 + t.Fatalf("unexpected diff: %s", diff) 87 + } 88 + }) 89 + } 90 + 91 + } 92 + 93 + func regexpMustParse(s string) *syntax.Regexp { 94 + re, err := syntax.Parse(s, syntax.Perl) 95 + if err != nil { 96 + panic(err) 97 + } 98 + return re 99 + }
testdata/search_result_1.pb

This is a binary file and will not be displayed.

+4
web/trace.go
··· 10 10 "github.com/sourcegraph/zoekt/trace" 11 11 ) 12 12 13 + func NewTraceAwareSearcher(s zoekt.Streamer) zoekt.Streamer { 14 + return traceAwareSearcher{Searcher: s} 15 + } 16 + 13 17 // traceAwareSearcher wraps a zoekt.Searcher instance so that the tracing context item is set in the 14 18 // context. This context item toggles on trace collection via the 15 19 // github.com/sourcegraph/zoekt/trace/ot package.