Versions in this module Expand all Collapse all v1 v1.0.1 Sep 2, 2024 Changes in this version + const INDEX_SERVICE + const SERVICE_ROOT_PATH + var ErrIntOverflowIndex = fmt.Errorf("proto: integer overflow") + var ErrInvalidLengthIndex = fmt.Errorf("proto: negative length found during unmarshaling") + var ErrUnexpectedEndOfGroupIndex = fmt.Errorf("proto: unexpected end of group") + func RegisterIndexServiceServer(s *grpc.Server, srv IndexServiceServer) + type AffectedCount struct + Count uint32 + func (*AffectedCount) Descriptor() ([]byte, []int) + func (*AffectedCount) ProtoMessage() + func (m *AffectedCount) GetCount() uint32 + func (m *AffectedCount) Marshal() (dAtA []byte, err error) + func (m *AffectedCount) MarshalTo(dAtA []byte) (int, error) + func (m *AffectedCount) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *AffectedCount) Reset() + func (m *AffectedCount) Size() (n int) + func (m *AffectedCount) String() string + func (m *AffectedCount) Unmarshal(dAtA []byte) error + func (m *AffectedCount) XXX_DiscardUnknown() + func (m *AffectedCount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *AffectedCount) XXX_Merge(src proto.Message) + func (m *AffectedCount) XXX_Size() int + func (m *AffectedCount) XXX_Unmarshal(b []byte) error + type CountRequest struct + func (*CountRequest) Descriptor() ([]byte, []int) + func (*CountRequest) ProtoMessage() + func (m *CountRequest) Marshal() (dAtA []byte, err error) + func (m *CountRequest) MarshalTo(dAtA []byte) (int, error) + func (m *CountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *CountRequest) Reset() + func (m *CountRequest) Size() (n int) + func (m *CountRequest) String() string + func (m *CountRequest) Unmarshal(dAtA []byte) error + func (m *CountRequest) XXX_DiscardUnknown() + func (m *CountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *CountRequest) XXX_Merge(src proto.Message) + func (m *CountRequest) XXX_Size() int + func (m *CountRequest) XXX_Unmarshal(b []byte) error + type DocId struct + DocId string + func (*DocId) Descriptor() ([]byte, []int) + func (*DocId) ProtoMessage() + func (m *DocId) GetDocId() string + func (m *DocId) Marshal() (dAtA []byte, err error) + func (m *DocId) MarshalTo(dAtA []byte) (int, error) + func (m *DocId) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *DocId) Reset() + func (m *DocId) Size() (n int) + func (m *DocId) String() string + func (m *DocId) Unmarshal(dAtA []byte) error + func (m *DocId) XXX_DiscardUnknown() + func (m *DocId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *DocId) XXX_Merge(src proto.Message) + func (m *DocId) XXX_Size() int + func (m *DocId) XXX_Unmarshal(b []byte) error + type IIndexer interface + AddDoc func(doc types.Document) (int, error) + Close func() error + Count func() int + DeleteDoc func(docId string) int + Search func(querys *types.TermQuery, onFlag, offFlag uint64, orFlags []uint64) []*types.Document + type IServiceHub interface + Close func() + GetServiceEndpoint func(service string) string + GetServiceEndpoints func(service string) []string + Regist func(service, endpoint string, leaseID etcdv3.LeaseID) (etcdv3.LeaseID, error) + UnRegist func(service, endpoint string) error + type IndexServiceClient interface + AddDoc func(ctx context.Context, in *types.Document, opts ...grpc.CallOption) (*AffectedCount, error) + Count func(ctx context.Context, in *CountRequest, opts ...grpc.CallOption) (*AffectedCount, error) + DeleteDoc func(ctx context.Context, in *DocId, opts ...grpc.CallOption) (*AffectedCount, error) + Search func(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) + func NewIndexServiceClient(cc *grpc.ClientConn) IndexServiceClient + type IndexServiceServer interface + AddDoc func(context.Context, *types.Document) (*AffectedCount, error) + Count func(context.Context, *CountRequest) (*AffectedCount, error) + DeleteDoc func(context.Context, *DocId) (*AffectedCount, error) + Search func(context.Context, *SearchRequest) (*SearchResponse, error) + type IndexServiceWorker struct + Indexer *Indexer + func (service *IndexServiceWorker) AddDoc(ctx context.Context, doc *types.Document) (*AffectedCount, error) + func (service *IndexServiceWorker) Close() + func (service *IndexServiceWorker) Count(ctx context.Context, request *CountRequest) (*AffectedCount, error) + func (service *IndexServiceWorker) DeleteDoc(ctx context.Context, docId *DocId) (*AffectedCount, error) + func (service *IndexServiceWorker) Init(workerIndex ...int) error + func (service *IndexServiceWorker) Regist(etcdEndpoint []string, servicePort, heartRate int) error + func (service *IndexServiceWorker) Search(ctx context.Context, request *SearchRequest) (*SearchResponse, error) + type Indexer struct + func (Indexer *Indexer) Count() int + func (indexer *Indexer) AddDoc(doc types.Document) (int, error) + func (indexer *Indexer) Close() error + func (indexer *Indexer) DeleteDoc(docId string) int + func (indexer *Indexer) Init(DocNumEstimate int, dbtype int, Data string) error + func (indexer *Indexer) LoadFromIndexFile() int + func (indexer *Indexer) Search(querys *types.TermQuery, onFlag, offFlag uint64, orFlags []uint64) []*types.Document + type LoadBalancer interface + Take func([]string) string + type RandomSelect struct + func (rs *RandomSelect) Take(endPoints []string) string + type RoundRobin struct + func (rr *RoundRobin) Take(endPoints []string) string + type SearchRequest struct + OffFlag uint64 + OnFlag uint64 + OrFlags []uint64 + Query *types.TermQuery + func (*SearchRequest) Descriptor() ([]byte, []int) + func (*SearchRequest) ProtoMessage() + func (m *SearchRequest) GetOffFlag() uint64 + func (m *SearchRequest) GetOnFlag() uint64 + func (m *SearchRequest) GetOrFlags() []uint64 + func (m *SearchRequest) GetQuery() *types.TermQuery + func (m *SearchRequest) Marshal() (dAtA []byte, err error) + func (m *SearchRequest) MarshalTo(dAtA []byte) (int, error) + func (m *SearchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *SearchRequest) Reset() + func (m *SearchRequest) Size() (n int) + func (m *SearchRequest) String() string + func (m *SearchRequest) Unmarshal(dAtA []byte) error + func (m *SearchRequest) XXX_DiscardUnknown() + func (m *SearchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *SearchRequest) XXX_Merge(src proto.Message) + func (m *SearchRequest) XXX_Size() int + func (m *SearchRequest) XXX_Unmarshal(b []byte) error + type SearchResponse struct + Documents []*types.Document + func (*SearchResponse) Descriptor() ([]byte, []int) + func (*SearchResponse) ProtoMessage() + func (m *SearchResponse) GetDocuments() []*types.Document + func (m *SearchResponse) Marshal() (dAtA []byte, err error) + func (m *SearchResponse) MarshalTo(dAtA []byte) (int, error) + func (m *SearchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *SearchResponse) Reset() + func (m *SearchResponse) Size() (n int) + func (m *SearchResponse) String() string + func (m *SearchResponse) Unmarshal(dAtA []byte) error + func (m *SearchResponse) XXX_DiscardUnknown() + func (m *SearchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *SearchResponse) XXX_Merge(src proto.Message) + func (m *SearchResponse) XXX_Size() int + func (m *SearchResponse) XXX_Unmarshal(b []byte) error + type Sentinel struct + func NewSentinel(etcdServers []string) *Sentinel + func (sentinal *Sentinel) GetGrpcConn(endpoint string) *grpc.ClientConn + func (sentinel *Sentinel) AddDoc(doc types.Document) (int, error) + func (sentinel *Sentinel) Close() (err error) + func (sentinel *Sentinel) Count() int + func (sentinel *Sentinel) DeleteDoc(docId string) int + func (sentinel *Sentinel) Search(querys *types.TermQuery, onFlag, offFlag uint64, orFlags []uint64) []*types.Document + type ServiceHub struct + func GetServiceHub(etcdEndpoints []string, heartRate int64) *ServiceHub + func (hub *ServiceHub) Close() + func (hub *ServiceHub) GetServiceEndpoint(service string) string + func (hub *ServiceHub) GetServiceEndpoints(service string) []string + func (hub *ServiceHub) Regist(service, endpoint string, leaseID etcdv3.LeaseID) (etcdv3.LeaseID, error) + func (hub *ServiceHub) UnRegist(service, endpoint string) error + type ServiceHubProxy struct + func GetServiceHubProxy(etcdEndpoints []string, heartRate int64, qps int) *ServiceHubProxy + func (proxy *ServiceHubProxy) GetServiceEndpoints(service string) []string + type UnimplementedIndexServiceServer struct + func (*UnimplementedIndexServiceServer) AddDoc(ctx context.Context, req *types.Document) (*AffectedCount, error) + func (*UnimplementedIndexServiceServer) Count(ctx context.Context, req *CountRequest) (*AffectedCount, error) + func (*UnimplementedIndexServiceServer) DeleteDoc(ctx context.Context, req *DocId) (*AffectedCount, error) + func (*UnimplementedIndexServiceServer) Search(ctx context.Context, req *SearchRequest) (*SearchResponse, error)