Documentation
¶
Index ¶
- Variables
- func RegisterSourceBackendServer(s grpc.ServiceRegistrar, srv SourceBackendServer)
- type FileReply
- type FileRequest
- type Match
- func (*Match) Descriptor() ([]byte, []int)deprecated
- func (x *Match) GetContext() string
- func (x *Match) GetCtxn1() string
- func (x *Match) GetCtxn2() string
- func (x *Match) GetCtxp1() string
- func (x *Match) GetCtxp2() string
- func (x *Match) GetLine() uint32
- func (x *Match) GetPackage() string
- func (x *Match) GetPath() string
- func (x *Match) GetPathrank() float32
- func (x *Match) GetRanking() float32
- func (*Match) ProtoMessage()
- func (x *Match) ProtoReflect() protoreflect.Message
- func (x *Match) Reset()
- func (x *Match) String() string
- type ProgressUpdate
- func (*ProgressUpdate) Descriptor() ([]byte, []int)deprecated
- func (x *ProgressUpdate) GetFilesProcessed() uint64
- func (x *ProgressUpdate) GetFilesTotal() uint64
- func (*ProgressUpdate) ProtoMessage()
- func (x *ProgressUpdate) ProtoReflect() protoreflect.Message
- func (x *ProgressUpdate) Reset()
- func (x *ProgressUpdate) String() string
- type ReplaceIndexReply
- type ReplaceIndexRequest
- func (*ReplaceIndexRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ReplaceIndexRequest) GetReplacementPath() string
- func (*ReplaceIndexRequest) ProtoMessage()
- func (x *ReplaceIndexRequest) ProtoReflect() protoreflect.Message
- func (x *ReplaceIndexRequest) Reset()
- func (x *ReplaceIndexRequest) String() string
- type SearchReply
- func (*SearchReply) Descriptor() ([]byte, []int)deprecated
- func (x *SearchReply) GetMatch() *Match
- func (x *SearchReply) GetProgressUpdate() *ProgressUpdate
- func (x *SearchReply) GetType() SearchReply_Type
- func (*SearchReply) ProtoMessage()
- func (x *SearchReply) ProtoReflect() protoreflect.Message
- func (x *SearchReply) Reset()
- func (x *SearchReply) String() string
- type SearchReply_Type
- func (SearchReply_Type) Descriptor() protoreflect.EnumDescriptor
- func (x SearchReply_Type) Enum() *SearchReply_Type
- func (SearchReply_Type) EnumDescriptor() ([]byte, []int)deprecated
- func (x SearchReply_Type) Number() protoreflect.EnumNumber
- func (x SearchReply_Type) String() string
- func (SearchReply_Type) Type() protoreflect.EnumType
- type SearchRequest
- func (*SearchRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SearchRequest) GetLiteral() bool
- func (x *SearchRequest) GetQuery() string
- func (x *SearchRequest) GetRewrittenUrl() string
- func (*SearchRequest) ProtoMessage()
- func (x *SearchRequest) ProtoReflect() protoreflect.Message
- func (x *SearchRequest) Reset()
- func (x *SearchRequest) String() string
- type SourceBackendClient
- type SourceBackendServer
- type SourceBackend_SearchClient
- type SourceBackend_SearchServer
- type UnimplementedSourceBackendServer
- func (UnimplementedSourceBackendServer) File(context.Context, *FileRequest) (*FileReply, error)
- func (UnimplementedSourceBackendServer) ReplaceIndex(context.Context, *ReplaceIndexRequest) (*ReplaceIndexReply, error)
- func (UnimplementedSourceBackendServer) Search(*SearchRequest, SourceBackend_SearchServer) error
- type UnsafeSourceBackendServer
Constants ¶
This section is empty.
Variables ¶
var ( SearchReply_Type_name = map[int32]string{ 0: "MATCH", 1: "PROGRESS_UPDATE", } SearchReply_Type_value = map[string]int32{ "MATCH": 0, "PROGRESS_UPDATE": 1, } )
Enum value maps for SearchReply_Type.
var File_sourcebackend_proto protoreflect.FileDescriptor
var SourceBackend_ServiceDesc = grpc.ServiceDesc{ ServiceName: "sourcebackendpb.SourceBackend", HandlerType: (*SourceBackendServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "File", Handler: _SourceBackend_File_Handler, }, { MethodName: "ReplaceIndex", Handler: _SourceBackend_ReplaceIndex_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Search", Handler: _SourceBackend_Search_Handler, ServerStreams: true, }, }, Metadata: "sourcebackend.proto", }
SourceBackend_ServiceDesc is the grpc.ServiceDesc for SourceBackend service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterSourceBackendServer ¶
func RegisterSourceBackendServer(s grpc.ServiceRegistrar, srv SourceBackendServer)
Types ¶
type FileReply ¶
type FileReply struct { Contents []byte `protobuf:"bytes,1,opt,name=contents,proto3" json:"contents,omitempty"` // contains filtered or unexported fields }
func (*FileReply) Descriptor
deprecated
func (*FileReply) GetContents ¶
func (*FileReply) ProtoMessage ¶
func (*FileReply) ProtoMessage()
func (*FileReply) ProtoReflect ¶
func (x *FileReply) ProtoReflect() protoreflect.Message
type FileRequest ¶
type FileRequest struct { Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` // contains filtered or unexported fields }
func (*FileRequest) Descriptor
deprecated
func (*FileRequest) Descriptor() ([]byte, []int)
Deprecated: Use FileRequest.ProtoReflect.Descriptor instead.
func (*FileRequest) GetPath ¶
func (x *FileRequest) GetPath() string
func (*FileRequest) ProtoMessage ¶
func (*FileRequest) ProtoMessage()
func (*FileRequest) ProtoReflect ¶
func (x *FileRequest) ProtoReflect() protoreflect.Message
func (*FileRequest) Reset ¶
func (x *FileRequest) Reset()
func (*FileRequest) String ¶
func (x *FileRequest) String() string
type Match ¶
type Match struct { Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` Line uint32 `protobuf:"varint,2,opt,name=line,proto3" json:"line,omitempty"` // Contents of line-2. Ctxp2 string `protobuf:"bytes,3,opt,name=ctxp2,proto3" json:"ctxp2,omitempty"` // Contents of line-1. Ctxp1 string `protobuf:"bytes,4,opt,name=ctxp1,proto3" json:"ctxp1,omitempty"` // Contents of the line containing the match. Context string `protobuf:"bytes,5,opt,name=context,proto3" json:"context,omitempty"` // Contents of line+1. Ctxn1 string `protobuf:"bytes,6,opt,name=ctxn1,proto3" json:"ctxn1,omitempty"` // Contents of line+2. Ctxn2 string `protobuf:"bytes,7,opt,name=ctxn2,proto3" json:"ctxn2,omitempty"` Pathrank float32 `protobuf:"fixed32,8,opt,name=pathrank,proto3" json:"pathrank,omitempty"` Ranking float32 `protobuf:"fixed32,9,opt,name=ranking,proto3" json:"ranking,omitempty"` Package string `protobuf:"bytes,10,opt,name=package,proto3" json:"package,omitempty"` // contains filtered or unexported fields }
func (*Match) Descriptor
deprecated
func (*Match) GetContext ¶
func (*Match) GetPackage ¶
func (*Match) GetPathrank ¶
func (*Match) GetRanking ¶
func (*Match) ProtoMessage ¶
func (*Match) ProtoMessage()
func (*Match) ProtoReflect ¶
func (x *Match) ProtoReflect() protoreflect.Message
type ProgressUpdate ¶
type ProgressUpdate struct { FilesProcessed uint64 `protobuf:"varint,1,opt,name=files_processed,json=filesProcessed,proto3" json:"files_processed,omitempty"` FilesTotal uint64 `protobuf:"varint,2,opt,name=files_total,json=filesTotal,proto3" json:"files_total,omitempty"` // contains filtered or unexported fields }
func (*ProgressUpdate) Descriptor
deprecated
func (*ProgressUpdate) Descriptor() ([]byte, []int)
Deprecated: Use ProgressUpdate.ProtoReflect.Descriptor instead.
func (*ProgressUpdate) GetFilesProcessed ¶
func (x *ProgressUpdate) GetFilesProcessed() uint64
func (*ProgressUpdate) GetFilesTotal ¶
func (x *ProgressUpdate) GetFilesTotal() uint64
func (*ProgressUpdate) ProtoMessage ¶
func (*ProgressUpdate) ProtoMessage()
func (*ProgressUpdate) ProtoReflect ¶
func (x *ProgressUpdate) ProtoReflect() protoreflect.Message
func (*ProgressUpdate) Reset ¶
func (x *ProgressUpdate) Reset()
func (*ProgressUpdate) String ¶
func (x *ProgressUpdate) String() string
type ReplaceIndexReply ¶
type ReplaceIndexReply struct {
// contains filtered or unexported fields
}
func (*ReplaceIndexReply) Descriptor
deprecated
func (*ReplaceIndexReply) Descriptor() ([]byte, []int)
Deprecated: Use ReplaceIndexReply.ProtoReflect.Descriptor instead.
func (*ReplaceIndexReply) ProtoMessage ¶
func (*ReplaceIndexReply) ProtoMessage()
func (*ReplaceIndexReply) ProtoReflect ¶
func (x *ReplaceIndexReply) ProtoReflect() protoreflect.Message
func (*ReplaceIndexReply) Reset ¶
func (x *ReplaceIndexReply) Reset()
func (*ReplaceIndexReply) String ¶
func (x *ReplaceIndexReply) String() string
type ReplaceIndexRequest ¶
type ReplaceIndexRequest struct { ReplacementPath string `protobuf:"bytes,1,opt,name=replacement_path,json=replacementPath,proto3" json:"replacement_path,omitempty"` // contains filtered or unexported fields }
func (*ReplaceIndexRequest) Descriptor
deprecated
func (*ReplaceIndexRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReplaceIndexRequest.ProtoReflect.Descriptor instead.
func (*ReplaceIndexRequest) GetReplacementPath ¶
func (x *ReplaceIndexRequest) GetReplacementPath() string
func (*ReplaceIndexRequest) ProtoMessage ¶
func (*ReplaceIndexRequest) ProtoMessage()
func (*ReplaceIndexRequest) ProtoReflect ¶
func (x *ReplaceIndexRequest) ProtoReflect() protoreflect.Message
func (*ReplaceIndexRequest) Reset ¶
func (x *ReplaceIndexRequest) Reset()
func (*ReplaceIndexRequest) String ¶
func (x *ReplaceIndexRequest) String() string
type SearchReply ¶
type SearchReply struct { Type SearchReply_Type `protobuf:"varint,1,opt,name=type,proto3,enum=sourcebackendpb.SearchReply_Type" json:"type,omitempty"` Match *Match `protobuf:"bytes,2,opt,name=match,proto3" json:"match,omitempty"` ProgressUpdate *ProgressUpdate `protobuf:"bytes,3,opt,name=progress_update,json=progressUpdate,proto3" json:"progress_update,omitempty"` // contains filtered or unexported fields }
func (*SearchReply) Descriptor
deprecated
func (*SearchReply) Descriptor() ([]byte, []int)
Deprecated: Use SearchReply.ProtoReflect.Descriptor instead.
func (*SearchReply) GetMatch ¶
func (x *SearchReply) GetMatch() *Match
func (*SearchReply) GetProgressUpdate ¶
func (x *SearchReply) GetProgressUpdate() *ProgressUpdate
func (*SearchReply) GetType ¶
func (x *SearchReply) GetType() SearchReply_Type
func (*SearchReply) ProtoMessage ¶
func (*SearchReply) ProtoMessage()
func (*SearchReply) ProtoReflect ¶
func (x *SearchReply) ProtoReflect() protoreflect.Message
func (*SearchReply) Reset ¶
func (x *SearchReply) Reset()
func (*SearchReply) String ¶
func (x *SearchReply) String() string
type SearchReply_Type ¶
type SearchReply_Type int32
const ( SearchReply_MATCH SearchReply_Type = 0 SearchReply_PROGRESS_UPDATE SearchReply_Type = 1 )
func (SearchReply_Type) Descriptor ¶
func (SearchReply_Type) Descriptor() protoreflect.EnumDescriptor
func (SearchReply_Type) Enum ¶
func (x SearchReply_Type) Enum() *SearchReply_Type
func (SearchReply_Type) EnumDescriptor
deprecated
func (SearchReply_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use SearchReply_Type.Descriptor instead.
func (SearchReply_Type) Number ¶
func (x SearchReply_Type) Number() protoreflect.EnumNumber
func (SearchReply_Type) String ¶
func (x SearchReply_Type) String() string
func (SearchReply_Type) Type ¶
func (SearchReply_Type) Type() protoreflect.EnumType
type SearchRequest ¶
type SearchRequest struct { Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` // Rewritten URL (after RewriteQuery()) with all the parameters that // are relevant for ranking. RewrittenUrl string `protobuf:"bytes,2,opt,name=rewritten_url,json=rewrittenUrl,proto3" json:"rewritten_url,omitempty"` Literal bool `protobuf:"varint,3,opt,name=literal,proto3" json:"literal,omitempty"` // contains filtered or unexported fields }
func (*SearchRequest) Descriptor
deprecated
func (*SearchRequest) Descriptor() ([]byte, []int)
Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.
func (*SearchRequest) GetLiteral ¶
func (x *SearchRequest) GetLiteral() bool
func (*SearchRequest) GetQuery ¶
func (x *SearchRequest) GetQuery() string
func (*SearchRequest) GetRewrittenUrl ¶
func (x *SearchRequest) GetRewrittenUrl() string
func (*SearchRequest) ProtoMessage ¶
func (*SearchRequest) ProtoMessage()
func (*SearchRequest) ProtoReflect ¶
func (x *SearchRequest) ProtoReflect() protoreflect.Message
func (*SearchRequest) Reset ¶
func (x *SearchRequest) Reset()
func (*SearchRequest) String ¶
func (x *SearchRequest) String() string
type SourceBackendClient ¶
type SourceBackendClient interface { // File reads the file and returns its contents. File(ctx context.Context, in *FileRequest, opts ...grpc.CallOption) (*FileReply, error) // Search performs the given query and streams matches/progress updates. Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (SourceBackend_SearchClient, error) // Replaces the loaded index with the specified replacement index. On a file // system level, the specified file is mv'ed to the file specified by // -index_path. ReplaceIndex(ctx context.Context, in *ReplaceIndexRequest, opts ...grpc.CallOption) (*ReplaceIndexReply, error) }
SourceBackendClient is the client API for SourceBackend service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkgo.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewSourceBackendClient ¶
func NewSourceBackendClient(cc grpc.ClientConnInterface) SourceBackendClient
type SourceBackendServer ¶
type SourceBackendServer interface { // File reads the file and returns its contents. File(context.Context, *FileRequest) (*FileReply, error) // Search performs the given query and streams matches/progress updates. Search(*SearchRequest, SourceBackend_SearchServer) error // Replaces the loaded index with the specified replacement index. On a file // system level, the specified file is mv'ed to the file specified by // -index_path. ReplaceIndex(context.Context, *ReplaceIndexRequest) (*ReplaceIndexReply, error) // contains filtered or unexported methods }
SourceBackendServer is the server API for SourceBackend service. All implementations must embed UnimplementedSourceBackendServer for forward compatibility
type SourceBackend_SearchClient ¶
type SourceBackend_SearchClient interface { Recv() (*SearchReply, error) grpc.ClientStream }
type SourceBackend_SearchServer ¶
type SourceBackend_SearchServer interface { Send(*SearchReply) error grpc.ServerStream }
type UnimplementedSourceBackendServer ¶
type UnimplementedSourceBackendServer struct { }
UnimplementedSourceBackendServer must be embedded to have forward compatible implementations.
func (UnimplementedSourceBackendServer) File ¶
func (UnimplementedSourceBackendServer) File(context.Context, *FileRequest) (*FileReply, error)
func (UnimplementedSourceBackendServer) ReplaceIndex ¶
func (UnimplementedSourceBackendServer) ReplaceIndex(context.Context, *ReplaceIndexRequest) (*ReplaceIndexReply, error)
func (UnimplementedSourceBackendServer) Search ¶
func (UnimplementedSourceBackendServer) Search(*SearchRequest, SourceBackend_SearchServer) error
type UnsafeSourceBackendServer ¶
type UnsafeSourceBackendServer interface {
// contains filtered or unexported methods
}
UnsafeSourceBackendServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SourceBackendServer will result in compilation errors.