Documentation
¶
Index ¶
- Variables
- func RegisterIndexerServer(s grpc.ServiceRegistrar, srv IndexerServer)
- type Document
- func (*Document) Descriptor() ([]byte, []int)deprecated
- func (x *Document) GetContent() string
- func (x *Document) GetIndexedAt() *timestamppb.Timestamp
- func (x *Document) GetLinkId() []byte
- func (x *Document) GetTitle() string
- func (x *Document) GetUrl() string
- func (*Document) ProtoMessage()
- func (x *Document) ProtoReflect() protoreflect.Message
- func (x *Document) Reset()
- func (x *Document) String() string
- type IndexerClient
- type IndexerServer
- type Indexer_SearchClient
- type Indexer_SearchServer
- type Query
- func (*Query) Descriptor() ([]byte, []int)deprecated
- func (x *Query) GetExpression() string
- func (x *Query) GetOffset() uint64
- func (x *Query) GetType() Query_Type
- func (*Query) ProtoMessage()
- func (x *Query) ProtoReflect() protoreflect.Message
- func (x *Query) Reset()
- func (x *Query) String() string
- type QueryResult
- func (*QueryResult) Descriptor() ([]byte, []int)deprecated
- func (x *QueryResult) GetDoc() *Document
- func (x *QueryResult) GetDocCount() uint64
- func (m *QueryResult) GetResult() isQueryResult_Result
- func (*QueryResult) ProtoMessage()
- func (x *QueryResult) ProtoReflect() protoreflect.Message
- func (x *QueryResult) Reset()
- func (x *QueryResult) String() string
- type QueryResult_Doc
- type QueryResult_DocCount
- type Query_Type
- type UnimplementedIndexerServer
- type UnsafeIndexerServer
- type UpdateScoreRequest
- func (*UpdateScoreRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateScoreRequest) GetLinkId() []byte
- func (x *UpdateScoreRequest) GetPageRankScore() float64
- func (*UpdateScoreRequest) ProtoMessage()
- func (x *UpdateScoreRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateScoreRequest) Reset()
- func (x *UpdateScoreRequest) String() string
Constants ¶
This section is empty.
Variables ¶
var ( Query_Type_name = map[int32]string{ 0: "MATCH", 1: "PHRASE", } Query_Type_value = map[string]int32{ "MATCH": 0, "PHRASE": 1, } )
Enum value maps for Query_Type.
var File_api_indexer_proto_api_proto protoreflect.FileDescriptor
var Indexer_ServiceDesc = grpc.ServiceDesc{ ServiceName: "indexer.v1.Indexer", HandlerType: (*IndexerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Index", Handler: _Indexer_Index_Handler, }, { MethodName: "UpdateScore", Handler: _Indexer_UpdateScore_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Search", Handler: _Indexer_Search_Handler, ServerStreams: true, }, }, Metadata: "api/indexer/proto/api.proto", }
Indexer_ServiceDesc is the grpc.ServiceDesc for Indexer service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterIndexerServer ¶
func RegisterIndexerServer(s grpc.ServiceRegistrar, srv IndexerServer)
Types ¶
type Document ¶
type Document struct { LinkId []byte `protobuf:"bytes,1,opt,name=link_id,json=linkId,proto3" json:"link_id,omitempty"` Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"` IndexedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=indexed_at,json=indexedAt,proto3" json:"indexed_at,omitempty"` // contains filtered or unexported fields }
func (*Document) Descriptor
deprecated
func (*Document) GetContent ¶
func (*Document) GetIndexedAt ¶
func (x *Document) GetIndexedAt() *timestamppb.Timestamp
func (*Document) ProtoMessage ¶
func (*Document) ProtoMessage()
func (*Document) ProtoReflect ¶
func (x *Document) ProtoReflect() protoreflect.Message
type IndexerClient ¶
type IndexerClient interface { Index(ctx context.Context, in *Document, opts ...grpc.CallOption) (*Document, error) Search(ctx context.Context, in *Query, opts ...grpc.CallOption) (Indexer_SearchClient, error) UpdateScore(ctx context.Context, in *UpdateScoreRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) }
IndexerClient is the client API for Indexer service.
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.
func NewIndexerClient ¶
func NewIndexerClient(cc grpc.ClientConnInterface) IndexerClient
type IndexerServer ¶
type IndexerServer interface { Index(context.Context, *Document) (*Document, error) Search(*Query, Indexer_SearchServer) error UpdateScore(context.Context, *UpdateScoreRequest) (*emptypb.Empty, error) // contains filtered or unexported methods }
IndexerServer is the server API for Indexer service. All implementations must embed UnimplementedIndexerServer for forward compatibility
type Indexer_SearchClient ¶
type Indexer_SearchClient interface { Recv() (*QueryResult, error) grpc.ClientStream }
type Indexer_SearchServer ¶
type Indexer_SearchServer interface { Send(*QueryResult) error grpc.ServerStream }
type Query ¶
type Query struct { Type Query_Type `protobuf:"varint,1,opt,name=type,proto3,enum=indexer.v1.Query_Type" json:"type,omitempty"` Expression string `protobuf:"bytes,2,opt,name=expression,proto3" json:"expression,omitempty"` Offset uint64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` // contains filtered or unexported fields }
func (*Query) Descriptor
deprecated
func (*Query) GetExpression ¶
func (*Query) GetType ¶
func (x *Query) GetType() Query_Type
func (*Query) ProtoMessage ¶
func (*Query) ProtoMessage()
func (*Query) ProtoReflect ¶
func (x *Query) ProtoReflect() protoreflect.Message
type QueryResult ¶
type QueryResult struct { // Types that are assignable to Result: // *QueryResult_DocCount // *QueryResult_Doc Result isQueryResult_Result `protobuf_oneof:"result"` // contains filtered or unexported fields }
func (*QueryResult) Descriptor
deprecated
func (*QueryResult) Descriptor() ([]byte, []int)
Deprecated: Use QueryResult.ProtoReflect.Descriptor instead.
func (*QueryResult) GetDoc ¶
func (x *QueryResult) GetDoc() *Document
func (*QueryResult) GetDocCount ¶
func (x *QueryResult) GetDocCount() uint64
func (*QueryResult) GetResult ¶
func (m *QueryResult) GetResult() isQueryResult_Result
func (*QueryResult) ProtoMessage ¶
func (*QueryResult) ProtoMessage()
func (*QueryResult) ProtoReflect ¶
func (x *QueryResult) ProtoReflect() protoreflect.Message
func (*QueryResult) Reset ¶
func (x *QueryResult) Reset()
func (*QueryResult) String ¶
func (x *QueryResult) String() string
type QueryResult_Doc ¶
type QueryResult_Doc struct {
Doc *Document `protobuf:"bytes,2,opt,name=doc,proto3,oneof"`
}
type QueryResult_DocCount ¶
type QueryResult_DocCount struct {
DocCount uint64 `protobuf:"varint,1,opt,name=doc_count,json=docCount,proto3,oneof"`
}
type Query_Type ¶
type Query_Type int32
const ( Query_MATCH Query_Type = 0 Query_PHRASE Query_Type = 1 )
func (Query_Type) Descriptor ¶
func (Query_Type) Descriptor() protoreflect.EnumDescriptor
func (Query_Type) Enum ¶
func (x Query_Type) Enum() *Query_Type
func (Query_Type) EnumDescriptor
deprecated
func (Query_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use Query_Type.Descriptor instead.
func (Query_Type) Number ¶
func (x Query_Type) Number() protoreflect.EnumNumber
func (Query_Type) String ¶
func (x Query_Type) String() string
func (Query_Type) Type ¶
func (Query_Type) Type() protoreflect.EnumType
type UnimplementedIndexerServer ¶
type UnimplementedIndexerServer struct { }
UnimplementedIndexerServer must be embedded to have forward compatible implementations.
func (UnimplementedIndexerServer) Search ¶
func (UnimplementedIndexerServer) Search(*Query, Indexer_SearchServer) error
func (UnimplementedIndexerServer) UpdateScore ¶
func (UnimplementedIndexerServer) UpdateScore(context.Context, *UpdateScoreRequest) (*emptypb.Empty, error)
type UnsafeIndexerServer ¶
type UnsafeIndexerServer interface {
// contains filtered or unexported methods
}
UnsafeIndexerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to IndexerServer will result in compilation errors.
type UpdateScoreRequest ¶
type UpdateScoreRequest struct { LinkId []byte `protobuf:"bytes,1,opt,name=link_id,json=linkId,proto3" json:"link_id,omitempty"` PageRankScore float64 `protobuf:"fixed64,2,opt,name=page_rank_score,json=pageRankScore,proto3" json:"page_rank_score,omitempty"` // contains filtered or unexported fields }
func (*UpdateScoreRequest) Descriptor
deprecated
func (*UpdateScoreRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateScoreRequest.ProtoReflect.Descriptor instead.
func (*UpdateScoreRequest) GetLinkId ¶
func (x *UpdateScoreRequest) GetLinkId() []byte
func (*UpdateScoreRequest) GetPageRankScore ¶
func (x *UpdateScoreRequest) GetPageRankScore() float64
func (*UpdateScoreRequest) ProtoMessage ¶
func (*UpdateScoreRequest) ProtoMessage()
func (*UpdateScoreRequest) ProtoReflect ¶
func (x *UpdateScoreRequest) ProtoReflect() protoreflect.Message
func (*UpdateScoreRequest) Reset ¶
func (x *UpdateScoreRequest) Reset()
func (*UpdateScoreRequest) String ¶
func (x *UpdateScoreRequest) String() string