proto

package
v0.0.0-...-8b501b0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Query_Type_name = map[int32]string{
	0: "MATCH",
	1: "PHRASE",
}
View Source
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) Descriptor() ([]byte, []int)

func (*Document) GetContent

func (m *Document) GetContent() string

func (*Document) GetIndexedAt

func (m *Document) GetIndexedAt() *timestamp.Timestamp

func (*Document) GetLinkId

func (m *Document) GetLinkId() []byte

func (*Document) GetTitle

func (m *Document) GetTitle() string

func (*Document) GetUrl

func (m *Document) GetUrl() string

func (*Document) ProtoMessage

func (*Document) ProtoMessage()

func (*Document) Reset

func (m *Document) Reset()

func (*Document) String

func (m *Document) String() string

func (*Document) XXX_DiscardUnknown

func (m *Document) XXX_DiscardUnknown()

func (*Document) XXX_Marshal

func (m *Document) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Document) XXX_Merge

func (m *Document) XXX_Merge(src proto.Message)

func (*Document) XXX_Size

func (m *Document) XXX_Size() int

func (*Document) XXX_Unmarshal

func (m *Document) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*Query) GetExpression

func (m *Query) GetExpression() string

func (*Query) GetOffset

func (m *Query) GetOffset() uint64

func (*Query) GetType

func (m *Query) GetType() Query_Type

func (*Query) ProtoMessage

func (*Query) ProtoMessage()

func (*Query) Reset

func (m *Query) Reset()

func (*Query) String

func (m *Query) String() string

func (*Query) XXX_DiscardUnknown

func (m *Query) XXX_DiscardUnknown()

func (*Query) XXX_Marshal

func (m *Query) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Query) XXX_Merge

func (m *Query) XXX_Merge(src proto.Message)

func (*Query) XXX_Size

func (m *Query) XXX_Size() int

func (*Query) XXX_Unmarshal

func (m *Query) XXX_Unmarshal(b []byte) error

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) Index

func (*UnimplementedTextIndexerServer) Search

func (*UnimplementedTextIndexerServer) UpdateScore

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL