Skip to content

Git designed for AI agents.

11.5 KB
Raw Blame
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.12
// 	protoc        v6.30.2
// source: search.proto

package gitalypb

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// SearchCodeRequest is a request for the SearchCode RPC.
type SearchCodeRequest struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// repository is the repository to search.
	Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"`
	// revision is the commit-ish to search at.
	Revision []byte `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"`
	// query is the text to search for: a fixed string, or a regular expression
	// (POSIX extended syntax) when regex is set.
	Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"`
	// regex interprets query as a regular expression.
	Regex bool `protobuf:"varint,4,opt,name=regex,proto3" json:"regex,omitempty"`
	// case_sensitive makes matching case sensitive (default: insensitive).
	CaseSensitive bool `protobuf:"varint,5,opt,name=case_sensitive,json=caseSensitive,proto3" json:"case_sensitive,omitempty"`
	// paths limits the search to these path prefixes (empty: whole tree).
	Paths [][]byte `protobuf:"bytes,6,rep,name=paths,proto3" json:"paths,omitempty"`
	// max_results bounds the number of matching lines; 0 means the server
	// default, and the server caps it at its configured maximum.
	MaxResults uint32 `protobuf:"varint,7,opt,name=max_results,json=maxResults,proto3" json:"max_results,omitempty"`
	// context_lines is the number of lines of context before and after each
	// match (capped by the server).
	ContextLines  uint32 `protobuf:"varint,8,opt,name=context_lines,json=contextLines,proto3" json:"context_lines,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *SearchCodeRequest) Reset() {
	*x = SearchCodeRequest{}
	mi := &file_search_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *SearchCodeRequest) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*SearchCodeRequest) ProtoMessage() {}

func (x *SearchCodeRequest) ProtoReflect() protoreflect.Message {
	mi := &file_search_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use SearchCodeRequest.ProtoReflect.Descriptor instead.
func (*SearchCodeRequest) Descriptor() ([]byte, []int) {
	return file_search_proto_rawDescGZIP(), []int{0}
}

func (x *SearchCodeRequest) GetRepository() *Repository {
	if x != nil {
		return x.Repository
	}
	return nil
}

func (x *SearchCodeRequest) GetRevision() []byte {
	if x != nil {
		return x.Revision
	}
	return nil
}

func (x *SearchCodeRequest) GetQuery() string {
	if x != nil {
		return x.Query
	}
	return ""
}

func (x *SearchCodeRequest) GetRegex() bool {
	if x != nil {
		return x.Regex
	}
	return false
}

func (x *SearchCodeRequest) GetCaseSensitive() bool {
	if x != nil {
		return x.CaseSensitive
	}
	return false
}

func (x *SearchCodeRequest) GetPaths() [][]byte {
	if x != nil {
		return x.Paths
	}
	return nil
}

func (x *SearchCodeRequest) GetMaxResults() uint32 {
	if x != nil {
		return x.MaxResults
	}
	return 0
}

func (x *SearchCodeRequest) GetContextLines() uint32 {
	if x != nil {
		return x.ContextLines
	}
	return 0
}

// SearchCodeResponse carries a batch of matches.
type SearchCodeResponse struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// commit_id is the resolved revision. Only set on the first message.
	CommitId string `protobuf:"bytes,1,opt,name=commit_id,json=commitId,proto3" json:"commit_id,omitempty"`
	// matches is a batch of matches, ordered by path then line.
	Matches []*SearchCodeResponse_Match `protobuf:"bytes,2,rep,name=matches,proto3" json:"matches,omitempty"`
	// truncated is set on the last message when results were cut at
	// max_results or by the server's time budget.
	Truncated     bool `protobuf:"varint,3,opt,name=truncated,proto3" json:"truncated,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *SearchCodeResponse) Reset() {
	*x = SearchCodeResponse{}
	mi := &file_search_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *SearchCodeResponse) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*SearchCodeResponse) ProtoMessage() {}

func (x *SearchCodeResponse) ProtoReflect() protoreflect.Message {
	mi := &file_search_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use SearchCodeResponse.ProtoReflect.Descriptor instead.
func (*SearchCodeResponse) Descriptor() ([]byte, []int) {
	return file_search_proto_rawDescGZIP(), []int{1}
}

func (x *SearchCodeResponse) GetCommitId() string {
	if x != nil {
		return x.CommitId
	}
	return ""
}

func (x *SearchCodeResponse) GetMatches() []*SearchCodeResponse_Match {
	if x != nil {
		return x.Matches
	}
	return nil
}

func (x *SearchCodeResponse) GetTruncated() bool {
	if x != nil {
		return x.Truncated
	}
	return false
}

// Match is one matching line.
type SearchCodeResponse_Match struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// path is the file path.
	Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	// line_number is 1-based.
	LineNumber int32 `protobuf:"varint,2,opt,name=line_number,json=lineNumber,proto3" json:"line_number,omitempty"`
	// line is the matching line without its trailing newline.
	Line []byte `protobuf:"bytes,3,opt,name=line,proto3" json:"line,omitempty"`
	// preceding_lines are the context lines before the match, in file order.
	PrecedingLines [][]byte `protobuf:"bytes,4,rep,name=preceding_lines,json=precedingLines,proto3" json:"preceding_lines,omitempty"`
	// following_lines are the context lines after the match, in file order.
	FollowingLines [][]byte `protobuf:"bytes,5,rep,name=following_lines,json=followingLines,proto3" json:"following_lines,omitempty"`
	unknownFields  protoimpl.UnknownFields
	sizeCache      protoimpl.SizeCache
}

func (x *SearchCodeResponse_Match) Reset() {
	*x = SearchCodeResponse_Match{}
	mi := &file_search_proto_msgTypes[2]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *SearchCodeResponse_Match) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*SearchCodeResponse_Match) ProtoMessage() {}

func (x *SearchCodeResponse_Match) ProtoReflect() protoreflect.Message {
	mi := &file_search_proto_msgTypes[2]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use SearchCodeResponse_Match.ProtoReflect.Descriptor instead.
func (*SearchCodeResponse_Match) Descriptor() ([]byte, []int) {
	return file_search_proto_rawDescGZIP(), []int{1, 0}
}

func (x *SearchCodeResponse_Match) GetPath() []byte {
	if x != nil {
		return x.Path
	}
	return nil
}

func (x *SearchCodeResponse_Match) GetLineNumber() int32 {
	if x != nil {
		return x.LineNumber
	}
	return 0
}

func (x *SearchCodeResponse_Match) GetLine() []byte {
	if x != nil {
		return x.Line
	}
	return nil
}

func (x *SearchCodeResponse_Match) GetPrecedingLines() [][]byte {
	if x != nil {
		return x.PrecedingLines
	}
	return nil
}

func (x *SearchCodeResponse_Match) GetFollowingLines() [][]byte {
	if x != nil {
		return x.FollowingLines
	}
	return nil
}

var File_search_proto protoreflect.FileDescriptor

const file_search_proto_rawDesc = "" +
	"\n" +
	"\fsearch.proto\x12\x06gitaly\x1a\n" +
	"lint.proto\x1a\fshared.proto\"\x98\x02\n" +
	"\x11SearchCodeRequest\x128\n" +
	"\n" +
	"repository\x18\x01 \x01(\v2\x12.gitaly.RepositoryB\x04\x98\xc6,\x01R\n" +
	"repository\x12\x1a\n" +
	"\brevision\x18\x02 \x01(\fR\brevision\x12\x14\n" +
	"\x05query\x18\x03 \x01(\tR\x05query\x12\x14\n" +
	"\x05regex\x18\x04 \x01(\bR\x05regex\x12%\n" +
	"\x0ecase_sensitive\x18\x05 \x01(\bR\rcaseSensitive\x12\x14\n" +
	"\x05paths\x18\x06 \x03(\fR\x05paths\x12\x1f\n" +
	"\vmax_results\x18\a \x01(\rR\n" +
	"maxResults\x12#\n" +
	"\rcontext_lines\x18\b \x01(\rR\fcontextLines\"\xb0\x02\n" +
	"\x12SearchCodeResponse\x12\x1b\n" +
	"\tcommit_id\x18\x01 \x01(\tR\bcommitId\x12:\n" +
	"\amatches\x18\x02 \x03(\v2 .gitaly.SearchCodeResponse.MatchR\amatches\x12\x1c\n" +
	"\ttruncated\x18\x03 \x01(\bR\ttruncated\x1a\xa2\x01\n" +
	"\x05Match\x12\x12\n" +
	"\x04path\x18\x01 \x01(\fR\x04path\x12\x1f\n" +
	"\vline_number\x18\x02 \x01(\x05R\n" +
	"lineNumber\x12\x12\n" +
	"\x04line\x18\x03 \x01(\fR\x04line\x12'\n" +
	"\x0fpreceding_lines\x18\x04 \x03(\fR\x0eprecedingLines\x12'\n" +
	"\x0ffollowing_lines\x18\x05 \x03(\fR\x0efollowingLines2^\n" +
	"\rSearchService\x12M\n" +
	"\n" +
	"SearchCode\x12\x19.gitaly.SearchCodeRequest\x1a\x1a.gitaly.SearchCodeResponse\"\x06\xfa\x97(\x02\b\x020\x01B.Z,github.com/feder-cr/git-ai/proto/go/gitalypbb\x06proto3"

var (
	file_search_proto_rawDescOnce sync.Once
	file_search_proto_rawDescData []byte
)

func file_search_proto_rawDescGZIP() []byte {
	file_search_proto_rawDescOnce.Do(func() {
		file_search_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_search_proto_rawDesc), len(file_search_proto_rawDesc)))
	})
	return file_search_proto_rawDescData
}

var file_search_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_search_proto_goTypes = []any{
	(*SearchCodeRequest)(nil),        // 0: gitaly.SearchCodeRequest
	(*SearchCodeResponse)(nil),       // 1: gitaly.SearchCodeResponse
	(*SearchCodeResponse_Match)(nil), // 2: gitaly.SearchCodeResponse.Match
	(*Repository)(nil),               // 3: gitaly.Repository
}
var file_search_proto_depIdxs = []int32{
	3, // 0: gitaly.SearchCodeRequest.repository:type_name -> gitaly.Repository
	2, // 1: gitaly.SearchCodeResponse.matches:type_name -> gitaly.SearchCodeResponse.Match
	0, // 2: gitaly.SearchService.SearchCode:input_type -> gitaly.SearchCodeRequest
	1, // 3: gitaly.SearchService.SearchCode:output_type -> gitaly.SearchCodeResponse
	3, // [3:4] is the sub-list for method output_type
	2, // [2:3] is the sub-list for method input_type
	2, // [2:2] is the sub-list for extension type_name
	2, // [2:2] is the sub-list for extension extendee
	0, // [0:2] is the sub-list for field type_name
}

func init() { file_search_proto_init() }
func file_search_proto_init() {
	if File_search_proto != nil {
		return
	}
	file_lint_proto_init()
	file_shared_proto_init()
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_search_proto_rawDesc), len(file_search_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   3,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_search_proto_goTypes,
		DependencyIndexes: file_search_proto_depIdxs,
		MessageInfos:      file_search_proto_msgTypes,
	}.Build()
	File_search_proto = out.File
	file_search_proto_goTypes = nil
	file_search_proto_depIdxs = nil
}