From e2e29ae1c302ee4a3d796c42ef3a6f2e03019e1b Mon Sep 17 00:00:00 2001 From: James Liu Date: Wed, 29 Nov 2023 14:26:27 +1100 Subject: proto: Add missing docs for SearchFilesByContent RPC --- proto/go/gitalypb/repository.pb.go | 18 +++++++++++------- proto/go/gitalypb/repository_grpc.pb.go | 6 ++++-- proto/repository.proto | 21 +++++++++++++-------- 3 files changed, 28 insertions(+), 17 deletions(-) (limited to 'proto') diff --git a/proto/go/gitalypb/repository.pb.go b/proto/go/gitalypb/repository.pb.go index 46872c5af..3a1d85da3 100644 --- a/proto/go/gitalypb/repository.pb.go +++ b/proto/go/gitalypb/repository.pb.go @@ -3807,17 +3807,19 @@ func (x *SearchFilesByNameResponse) GetFiles() [][]byte { return nil } -// SearchFilesByContentRequest ... +// SearchFilesByContentRequest is a request for the SearchFilesByContent RPC. type SearchFilesByContentRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // repository ... + // repository is the repo to search. The storage_name and relative_path attributes must be provided. Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - // query ... + // query is the grep pattern to use. Queries are case-insensitive and are compatible + // with Perl regexp syntax. Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` - // ref ... + // ref is the reference to limit the search scope by, for example a commit or + // branch name. Ref []byte `protobuf:"bytes,3,opt,name=ref,proto3" json:"ref,omitempty"` // chunked_response ... ChunkedResponse bool `protobuf:"varint,4,opt,name=chunked_response,json=chunkedResponse,proto3" json:"chunked_response,omitempty"` @@ -3883,7 +3885,7 @@ func (x *SearchFilesByContentRequest) GetChunkedResponse() bool { return false } -// SearchFilesByContentResponse ... +// SearchFilesByContentResponse is a response for the SearchFilesByContent RPC. type SearchFilesByContentResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3891,9 +3893,11 @@ type SearchFilesByContentResponse struct { // matches ... Matches [][]byte `protobuf:"bytes,1,rep,name=matches,proto3" json:"matches,omitempty"` - // match_data ... + // match_data contains the results of the search. Data is streamed in chunks, where + // each chunk is an individual result. MatchData []byte `protobuf:"bytes,2,opt,name=match_data,json=matchData,proto3" json:"match_data,omitempty"` - // end_of_match ... + // end_of_match indicates the end of an individual match results. Additional results + // may follow in subsequent gRPC messages. EndOfMatch bool `protobuf:"varint,3,opt,name=end_of_match,json=endOfMatch,proto3" json:"end_of_match,omitempty"` } diff --git a/proto/go/gitalypb/repository_grpc.pb.go b/proto/go/gitalypb/repository_grpc.pb.go index 05f97279d..efcf2860c 100644 --- a/proto/go/gitalypb/repository_grpc.pb.go +++ b/proto/go/gitalypb/repository_grpc.pb.go @@ -123,7 +123,8 @@ type RepositoryServiceClient interface { CreateRepositoryFromSnapshot(ctx context.Context, in *CreateRepositoryFromSnapshotRequest, opts ...grpc.CallOption) (*CreateRepositoryFromSnapshotResponse, error) // GetRawChanges returns metadata in raw format on the changes between two revisions. GetRawChanges(ctx context.Context, in *GetRawChangesRequest, opts ...grpc.CallOption) (RepositoryService_GetRawChangesClient, error) - // SearchFilesByContent ... + // SearchFilesByContent searches files in the repository using the provided grep pattern. + // For each result, the matched line is returned along with the two previous and next lines. SearchFilesByContent(ctx context.Context, in *SearchFilesByContentRequest, opts ...grpc.CallOption) (RepositoryService_SearchFilesByContentClient, error) // SearchFilesByName ... SearchFilesByName(ctx context.Context, in *SearchFilesByNameRequest, opts ...grpc.CallOption) (RepositoryService_SearchFilesByNameClient, error) @@ -1095,7 +1096,8 @@ type RepositoryServiceServer interface { CreateRepositoryFromSnapshot(context.Context, *CreateRepositoryFromSnapshotRequest) (*CreateRepositoryFromSnapshotResponse, error) // GetRawChanges returns metadata in raw format on the changes between two revisions. GetRawChanges(*GetRawChangesRequest, RepositoryService_GetRawChangesServer) error - // SearchFilesByContent ... + // SearchFilesByContent searches files in the repository using the provided grep pattern. + // For each result, the matched line is returned along with the two previous and next lines. SearchFilesByContent(*SearchFilesByContentRequest, RepositoryService_SearchFilesByContentServer) error // SearchFilesByName ... SearchFilesByName(*SearchFilesByNameRequest, RepositoryService_SearchFilesByNameServer) error diff --git a/proto/repository.proto b/proto/repository.proto index cb5c6d0f4..df6a9bd1d 100644 --- a/proto/repository.proto +++ b/proto/repository.proto @@ -246,7 +246,8 @@ service RepositoryService { }; } - // SearchFilesByContent ... + // SearchFilesByContent searches files in the repository using the provided grep pattern. + // For each result, the matched line is returned along with the two previous and next lines. rpc SearchFilesByContent(SearchFilesByContentRequest) returns (stream SearchFilesByContentResponse) { option (op_type) = { op: ACCESSOR @@ -1097,25 +1098,29 @@ message SearchFilesByNameResponse { repeated bytes files = 1; } -// SearchFilesByContentRequest ... +// SearchFilesByContentRequest is a request for the SearchFilesByContent RPC. message SearchFilesByContentRequest { - // repository ... + // repository is the repo to search. The storage_name and relative_path attributes must be provided. Repository repository = 1 [(target_repository)=true]; - // query ... + // query is the grep pattern to use. Queries are case-insensitive and are compatible + // with Perl regexp syntax. string query = 2; - // ref ... + // ref is the reference to limit the search scope by, for example a commit or + // branch name. bytes ref = 3; // chunked_response ... bool chunked_response = 4; } -// SearchFilesByContentResponse ... +// SearchFilesByContentResponse is a response for the SearchFilesByContent RPC. message SearchFilesByContentResponse { // matches ... repeated bytes matches = 1; - // match_data ... + // match_data contains the results of the search. Data is streamed in chunks, where + // each chunk is an individual result. bytes match_data = 2; - // end_of_match ... + // end_of_match indicates the end of an individual match results. Additional results + // may follow in subsequent gRPC messages. bool end_of_match = 3; } -- cgit v1.2.3