Documentation ¶
Index ¶
- Variables
- func RegisterTextIndexerServer(s *grpc.Server, srv TextIndexerServer)
- type Document
- func (*Document) Descriptor() ([]byte, []int)
- func (m *Document) GetContent() string
- func (m *Document) GetIndexedAt() *timestamp.Timestamp
- func (m *Document) GetLinkId() []byte
- func (m *Document) GetTitle() string
- func (m *Document) GetUrl() string
- func (*Document) ProtoMessage()
- func (m *Document) Reset()
- func (m *Document) String() string
- func (m *Document) XXX_DiscardUnknown()
- func (m *Document) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Document) XXX_Merge(src proto.Message)
- func (m *Document) XXX_Size() int
- func (m *Document) XXX_Unmarshal(b []byte) error
- type Query
- func (*Query) Descriptor() ([]byte, []int)
- func (m *Query) GetExpression() string
- func (m *Query) GetOffset() uint64
- func (m *Query) GetType() Query_Type
- func (*Query) ProtoMessage()
- func (m *Query) Reset()
- func (m *Query) String() string
- func (m *Query) XXX_DiscardUnknown()
- func (m *Query) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Query) XXX_Merge(src proto.Message)
- func (m *Query) XXX_Size() int
- func (m *Query) XXX_Unmarshal(b []byte) error
- type QueryResult
- func (*QueryResult) Descriptor() ([]byte, []int)
- func (m *QueryResult) GetDoc() *Document
- func (m *QueryResult) GetDocCount() uint64
- func (m *QueryResult) GetResult() isQueryResult_Result
- func (*QueryResult) ProtoMessage()
- func (m *QueryResult) Reset()
- func (m *QueryResult) String() string
- func (m *QueryResult) XXX_DiscardUnknown()
- func (m *QueryResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryResult) XXX_Merge(src proto.Message)
- func (*QueryResult) XXX_OneofWrappers() []interface{}
- func (m *QueryResult) XXX_Size() int
- func (m *QueryResult) XXX_Unmarshal(b []byte) error
- type QueryResult_Doc
- type QueryResult_DocCount
- type Query_Type
- type TextIndexerClient
- type TextIndexerServer
- type TextIndexer_SearchClient
- type TextIndexer_SearchServer
- type UnimplementedTextIndexerServer
- func (*UnimplementedTextIndexerServer) Index(ctx context.Context, req *Document) (*Document, error)
- func (*UnimplementedTextIndexerServer) Search(req *Query, srv TextIndexer_SearchServer) error
- func (*UnimplementedTextIndexerServer) UpdateScore(ctx context.Context, req *UpdateScoreRequest) (*empty.Empty, error)
- type UpdateScoreRequest
- func (*UpdateScoreRequest) Descriptor() ([]byte, []int)
- func (m *UpdateScoreRequest) GetLinkId() []byte
- func (m *UpdateScoreRequest) GetPageRankScore() float64
- func (*UpdateScoreRequest) ProtoMessage()
- func (m *UpdateScoreRequest) Reset()
- func (m *UpdateScoreRequest) String() string
- func (m *UpdateScoreRequest) XXX_DiscardUnknown()
- func (m *UpdateScoreRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UpdateScoreRequest) XXX_Merge(src proto.Message)
- func (m *UpdateScoreRequest) XXX_Size() int
- func (m *UpdateScoreRequest) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var Query_Type_name = map[int32]string{
0: "MATCH",
1: "PHRASE",
}
var Query_Type_value = map[string]int32{
"MATCH": 0,
"PHRASE": 1,
}
Functions ¶
func RegisterTextIndexerServer ¶
func RegisterTextIndexerServer(s *grpc.Server, srv TextIndexerServer)
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 *timestamp.Timestamp `protobuf:"bytes,5,opt,name=indexed_at,json=indexedAt,proto3" json:"indexed_at,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Document represents an indexed document.
func (*Document) Descriptor ¶
func (*Document) GetContent ¶
func (*Document) GetIndexedAt ¶
func (*Document) ProtoMessage ¶
func (*Document) ProtoMessage()
func (*Document) XXX_DiscardUnknown ¶
func (m *Document) XXX_DiscardUnknown()
func (*Document) XXX_Marshal ¶
func (*Document) XXX_Unmarshal ¶
type Query ¶
type Query struct { Type Query_Type `protobuf:"varint,1,opt,name=type,proto3,enum=proto.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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Query represents a search query.
func (*Query) Descriptor ¶
func (*Query) GetExpression ¶
func (*Query) GetType ¶
func (m *Query) GetType() Query_Type
func (*Query) ProtoMessage ¶
func (*Query) ProtoMessage()
func (*Query) XXX_DiscardUnknown ¶
func (m *Query) XXX_DiscardUnknown()
func (*Query) XXX_Marshal ¶
func (*Query) XXX_Unmarshal ¶
type QueryResult ¶
type QueryResult struct { // Types that are valid to be assigned to Result: // *QueryResult_DocCount // *QueryResult_Doc Result isQueryResult_Result `protobuf_oneof:"result"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
QueryResult contains either the total count of results for a query or a single document from the resultset.
func (*QueryResult) Descriptor ¶
func (*QueryResult) Descriptor() ([]byte, []int)
func (*QueryResult) GetDoc ¶
func (m *QueryResult) GetDoc() *Document
func (*QueryResult) GetDocCount ¶
func (m *QueryResult) GetDocCount() uint64
func (*QueryResult) GetResult ¶
func (m *QueryResult) GetResult() isQueryResult_Result
func (*QueryResult) ProtoMessage ¶
func (*QueryResult) ProtoMessage()
func (*QueryResult) Reset ¶
func (m *QueryResult) Reset()
func (*QueryResult) String ¶
func (m *QueryResult) String() string
func (*QueryResult) XXX_DiscardUnknown ¶
func (m *QueryResult) XXX_DiscardUnknown()
func (*QueryResult) XXX_Marshal ¶
func (m *QueryResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryResult) XXX_Merge ¶
func (m *QueryResult) XXX_Merge(src proto.Message)
func (*QueryResult) XXX_OneofWrappers ¶
func (*QueryResult) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*QueryResult) XXX_Size ¶
func (m *QueryResult) XXX_Size() int
func (*QueryResult) XXX_Unmarshal ¶
func (m *QueryResult) XXX_Unmarshal(b []byte) error
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) EnumDescriptor ¶
func (Query_Type) EnumDescriptor() ([]byte, []int)
func (Query_Type) String ¶
func (x Query_Type) String() string
type TextIndexerClient ¶
type TextIndexerClient interface { // Index inserts a new document to the index or updates the index entry for // and existing document. Index(ctx context.Context, in *Document, opts ...grpc.CallOption) (*Document, error) // Search the index for a particular query and stream the results back to // the client. The first response will include the total result count while // all subsequent responses will include documents from the resultset. Search(ctx context.Context, in *Query, opts ...grpc.CallOption) (TextIndexer_SearchClient, error) // UpdateScore updates the PageRank score for a document with the specified // link ID. UpdateScore(ctx context.Context, in *UpdateScoreRequest, opts ...grpc.CallOption) (*empty.Empty, error) }
TextIndexerClient is the client API for TextIndexer service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewTextIndexerClient ¶
func NewTextIndexerClient(cc *grpc.ClientConn) TextIndexerClient
type TextIndexerServer ¶
type TextIndexerServer interface { // Index inserts a new document to the index or updates the index entry for // and existing document. Index(context.Context, *Document) (*Document, error) // Search the index for a particular query and stream the results back to // the client. The first response will include the total result count while // all subsequent responses will include documents from the resultset. Search(*Query, TextIndexer_SearchServer) error // UpdateScore updates the PageRank score for a document with the specified // link ID. UpdateScore(context.Context, *UpdateScoreRequest) (*empty.Empty, error) }
TextIndexerServer is the server API for TextIndexer service.
type TextIndexer_SearchClient ¶
type TextIndexer_SearchClient interface { Recv() (*QueryResult, error) grpc.ClientStream }
type TextIndexer_SearchServer ¶
type TextIndexer_SearchServer interface { Send(*QueryResult) error grpc.ServerStream }
type UnimplementedTextIndexerServer ¶
type UnimplementedTextIndexerServer struct { }
UnimplementedTextIndexerServer can be embedded to have forward compatible implementations.
func (*UnimplementedTextIndexerServer) Search ¶
func (*UnimplementedTextIndexerServer) Search(req *Query, srv TextIndexer_SearchServer) error
func (*UnimplementedTextIndexerServer) UpdateScore ¶
func (*UnimplementedTextIndexerServer) UpdateScore(ctx context.Context, req *UpdateScoreRequest) (*empty.Empty, error)
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
UpdateScoreRequest encapsulates the parameters for the UpdateScore RPC.
func (*UpdateScoreRequest) Descriptor ¶
func (*UpdateScoreRequest) Descriptor() ([]byte, []int)
func (*UpdateScoreRequest) GetLinkId ¶
func (m *UpdateScoreRequest) GetLinkId() []byte
func (*UpdateScoreRequest) GetPageRankScore ¶
func (m *UpdateScoreRequest) GetPageRankScore() float64
func (*UpdateScoreRequest) ProtoMessage ¶
func (*UpdateScoreRequest) ProtoMessage()
func (*UpdateScoreRequest) Reset ¶
func (m *UpdateScoreRequest) Reset()
func (*UpdateScoreRequest) String ¶
func (m *UpdateScoreRequest) String() string
func (*UpdateScoreRequest) XXX_DiscardUnknown ¶
func (m *UpdateScoreRequest) XXX_DiscardUnknown()
func (*UpdateScoreRequest) XXX_Marshal ¶
func (m *UpdateScoreRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*UpdateScoreRequest) XXX_Merge ¶
func (m *UpdateScoreRequest) XXX_Merge(src proto.Message)
func (*UpdateScoreRequest) XXX_Size ¶
func (m *UpdateScoreRequest) XXX_Size() int
func (*UpdateScoreRequest) XXX_Unmarshal ¶
func (m *UpdateScoreRequest) XXX_Unmarshal(b []byte) error