Documentation ¶
Overview ¶
Package segment is a generated GoMock package.
Index ¶
- Variables
- type Builder
- type DocumentsBuilder
- type FieldsIterable
- type FieldsIterator
- type MockBuilder
- func (m *MockBuilder) AllDocs() (index.IDDocIterator, error)
- func (m *MockBuilder) Docs() []doc.Document
- func (m *MockBuilder) EXPECT() *MockBuilderMockRecorder
- func (m *MockBuilder) Fields() (FieldsIterator, error)
- func (m *MockBuilder) Reset(arg0 postings.ID)
- func (m *MockBuilder) Terms(arg0 []byte) (TermsIterator, error)
- type MockBuilderMockRecorder
- func (mr *MockBuilderMockRecorder) AllDocs() *gomock.Call
- func (mr *MockBuilderMockRecorder) Docs() *gomock.Call
- func (mr *MockBuilderMockRecorder) Fields() *gomock.Call
- func (mr *MockBuilderMockRecorder) Reset(arg0 interface{}) *gomock.Call
- func (mr *MockBuilderMockRecorder) Terms(arg0 interface{}) *gomock.Call
- type MockMutableSegment
- func (m *MockMutableSegment) AllDocs() (index.IDDocIterator, error)
- func (m *MockMutableSegment) Close() error
- func (m *MockMutableSegment) ContainsID(arg0 []byte) (bool, error)
- func (m *MockMutableSegment) Docs() []doc.Document
- func (m *MockMutableSegment) EXPECT() *MockMutableSegmentMockRecorder
- func (m *MockMutableSegment) Fields() (FieldsIterator, error)
- func (m *MockMutableSegment) FieldsIterable() FieldsIterable
- func (m *MockMutableSegment) Insert(arg0 doc.Document) ([]byte, error)
- func (m *MockMutableSegment) InsertBatch(arg0 index.Batch) error
- func (m *MockMutableSegment) IsSealed() bool
- func (m *MockMutableSegment) Offset() postings.ID
- func (m *MockMutableSegment) Reader() (index.Reader, error)
- func (m *MockMutableSegment) Reset(arg0 postings.ID)
- func (m *MockMutableSegment) Seal() error
- func (m *MockMutableSegment) Size() int64
- func (m *MockMutableSegment) Terms(arg0 []byte) (TermsIterator, error)
- func (m *MockMutableSegment) TermsIterable() TermsIterable
- type MockMutableSegmentMockRecorder
- func (mr *MockMutableSegmentMockRecorder) AllDocs() *gomock.Call
- func (mr *MockMutableSegmentMockRecorder) Close() *gomock.Call
- func (mr *MockMutableSegmentMockRecorder) ContainsID(arg0 interface{}) *gomock.Call
- func (mr *MockMutableSegmentMockRecorder) Docs() *gomock.Call
- func (mr *MockMutableSegmentMockRecorder) Fields() *gomock.Call
- func (mr *MockMutableSegmentMockRecorder) FieldsIterable() *gomock.Call
- func (mr *MockMutableSegmentMockRecorder) Insert(arg0 interface{}) *gomock.Call
- func (mr *MockMutableSegmentMockRecorder) InsertBatch(arg0 interface{}) *gomock.Call
- func (mr *MockMutableSegmentMockRecorder) IsSealed() *gomock.Call
- func (mr *MockMutableSegmentMockRecorder) Offset() *gomock.Call
- func (mr *MockMutableSegmentMockRecorder) Reader() *gomock.Call
- func (mr *MockMutableSegmentMockRecorder) Reset(arg0 interface{}) *gomock.Call
- func (mr *MockMutableSegmentMockRecorder) Seal() *gomock.Call
- func (mr *MockMutableSegmentMockRecorder) Size() *gomock.Call
- func (mr *MockMutableSegmentMockRecorder) Terms(arg0 interface{}) *gomock.Call
- func (mr *MockMutableSegmentMockRecorder) TermsIterable() *gomock.Call
- type MockSegment
- func (m *MockSegment) Close() error
- func (m *MockSegment) ContainsID(arg0 []byte) (bool, error)
- func (m *MockSegment) EXPECT() *MockSegmentMockRecorder
- func (m *MockSegment) FieldsIterable() FieldsIterable
- func (m *MockSegment) Reader() (index.Reader, error)
- func (m *MockSegment) Size() int64
- func (m *MockSegment) TermsIterable() TermsIterable
- type MockSegmentMockRecorder
- func (mr *MockSegmentMockRecorder) Close() *gomock.Call
- func (mr *MockSegmentMockRecorder) ContainsID(arg0 interface{}) *gomock.Call
- func (mr *MockSegmentMockRecorder) FieldsIterable() *gomock.Call
- func (mr *MockSegmentMockRecorder) Reader() *gomock.Call
- func (mr *MockSegmentMockRecorder) Size() *gomock.Call
- func (mr *MockSegmentMockRecorder) TermsIterable() *gomock.Call
- type MutableSegment
- type OrderedBytesIterator
- type Segment
- type SegmentsBuilder
- type TermsIterable
- type TermsIterator
Constants ¶
This section is empty.
Variables ¶
var ( // ErrClosed is the error returned when attempting to perform operations on a // segment that has already been closed. ErrClosed = errors.New("segment has been closed") )
Functions ¶
This section is empty.
Types ¶
type Builder ¶ added in v0.5.0
type Builder interface { FieldsIterable TermsIterable // Reset resets the builder for reuse. Reset(offset postings.ID) // Docs returns the current docs slice, this is not safe to modify // and is invalidated on a call to reset. Docs() []doc.Document // AllDocs returns an iterator over the documents known to the Reader. AllDocs() (index.IDDocIterator, error) }
Builder is a builder that can be used to construct segments.
type DocumentsBuilder ¶ added in v0.5.0
DocumentsBuilder is a builder is written documents to.
type FieldsIterable ¶ added in v0.5.0
type FieldsIterable interface { // Fields returns an iterator over the list of known fields, in order // by name, it is not valid for reading after mutating the // builder by inserting more documents. Fields() (FieldsIterator, error) }
FieldsIterable can iterate over segment fields, it is not by default concurrency safe.
type FieldsIterator ¶ added in v0.4.1
type FieldsIterator interface { // Next returns a bool indicating if there are any more elements. Next() bool // Current returns the current element. // NB: the element returned is only valid until the subsequent call to Next(). Current() []byte // Err returns any errors encountered during iteration. Err() error // Close releases any resources held by the iterator. Close() error }
FieldsIterator iterates over all known fields.
type MockBuilder ¶ added in v0.5.0
type MockBuilder struct {
// contains filtered or unexported fields
}
MockBuilder is a mock of Builder interface
func NewMockBuilder ¶ added in v0.5.0
func NewMockBuilder(ctrl *gomock.Controller) *MockBuilder
NewMockBuilder creates a new mock instance
func (*MockBuilder) AllDocs ¶ added in v0.5.0
func (m *MockBuilder) AllDocs() (index.IDDocIterator, error)
AllDocs mocks base method
func (*MockBuilder) Docs ¶ added in v0.5.0
func (m *MockBuilder) Docs() []doc.Document
Docs mocks base method
func (*MockBuilder) EXPECT ¶ added in v0.5.0
func (m *MockBuilder) EXPECT() *MockBuilderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockBuilder) Fields ¶ added in v0.5.0
func (m *MockBuilder) Fields() (FieldsIterator, error)
Fields mocks base method
func (*MockBuilder) Reset ¶ added in v0.5.0
func (m *MockBuilder) Reset(arg0 postings.ID)
Reset mocks base method
func (*MockBuilder) Terms ¶ added in v0.5.0
func (m *MockBuilder) Terms(arg0 []byte) (TermsIterator, error)
Terms mocks base method
type MockBuilderMockRecorder ¶ added in v0.5.0
type MockBuilderMockRecorder struct {
// contains filtered or unexported fields
}
MockBuilderMockRecorder is the mock recorder for MockBuilder
func (*MockBuilderMockRecorder) AllDocs ¶ added in v0.5.0
func (mr *MockBuilderMockRecorder) AllDocs() *gomock.Call
AllDocs indicates an expected call of AllDocs
func (*MockBuilderMockRecorder) Docs ¶ added in v0.5.0
func (mr *MockBuilderMockRecorder) Docs() *gomock.Call
Docs indicates an expected call of Docs
func (*MockBuilderMockRecorder) Fields ¶ added in v0.5.0
func (mr *MockBuilderMockRecorder) Fields() *gomock.Call
Fields indicates an expected call of Fields
func (*MockBuilderMockRecorder) Reset ¶ added in v0.5.0
func (mr *MockBuilderMockRecorder) Reset(arg0 interface{}) *gomock.Call
Reset indicates an expected call of Reset
func (*MockBuilderMockRecorder) Terms ¶ added in v0.5.0
func (mr *MockBuilderMockRecorder) Terms(arg0 interface{}) *gomock.Call
Terms indicates an expected call of Terms
type MockMutableSegment ¶
type MockMutableSegment struct {
// contains filtered or unexported fields
}
MockMutableSegment is a mock of MutableSegment interface
func NewMockMutableSegment ¶
func NewMockMutableSegment(ctrl *gomock.Controller) *MockMutableSegment
NewMockMutableSegment creates a new mock instance
func (*MockMutableSegment) AllDocs ¶ added in v0.5.0
func (m *MockMutableSegment) AllDocs() (index.IDDocIterator, error)
AllDocs mocks base method
func (*MockMutableSegment) Close ¶
func (m *MockMutableSegment) Close() error
Close mocks base method
func (*MockMutableSegment) ContainsID ¶
func (m *MockMutableSegment) ContainsID(arg0 []byte) (bool, error)
ContainsID mocks base method
func (*MockMutableSegment) Docs ¶ added in v0.5.0
func (m *MockMutableSegment) Docs() []doc.Document
Docs mocks base method
func (*MockMutableSegment) EXPECT ¶
func (m *MockMutableSegment) EXPECT() *MockMutableSegmentMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockMutableSegment) Fields ¶
func (m *MockMutableSegment) Fields() (FieldsIterator, error)
Fields mocks base method
func (*MockMutableSegment) FieldsIterable ¶ added in v0.5.0
func (m *MockMutableSegment) FieldsIterable() FieldsIterable
FieldsIterable mocks base method
func (*MockMutableSegment) Insert ¶
func (m *MockMutableSegment) Insert(arg0 doc.Document) ([]byte, error)
Insert mocks base method
func (*MockMutableSegment) InsertBatch ¶
func (m *MockMutableSegment) InsertBatch(arg0 index.Batch) error
InsertBatch mocks base method
func (*MockMutableSegment) IsSealed ¶
func (m *MockMutableSegment) IsSealed() bool
IsSealed mocks base method
func (*MockMutableSegment) Offset ¶ added in v0.5.0
func (m *MockMutableSegment) Offset() postings.ID
Offset mocks base method
func (*MockMutableSegment) Reader ¶
func (m *MockMutableSegment) Reader() (index.Reader, error)
Reader mocks base method
func (*MockMutableSegment) Reset ¶ added in v0.5.0
func (m *MockMutableSegment) Reset(arg0 postings.ID)
Reset mocks base method
func (*MockMutableSegment) Terms ¶
func (m *MockMutableSegment) Terms(arg0 []byte) (TermsIterator, error)
Terms mocks base method
func (*MockMutableSegment) TermsIterable ¶ added in v0.5.0
func (m *MockMutableSegment) TermsIterable() TermsIterable
TermsIterable mocks base method
type MockMutableSegmentMockRecorder ¶
type MockMutableSegmentMockRecorder struct {
// contains filtered or unexported fields
}
MockMutableSegmentMockRecorder is the mock recorder for MockMutableSegment
func (*MockMutableSegmentMockRecorder) AllDocs ¶ added in v0.5.0
func (mr *MockMutableSegmentMockRecorder) AllDocs() *gomock.Call
AllDocs indicates an expected call of AllDocs
func (*MockMutableSegmentMockRecorder) Close ¶
func (mr *MockMutableSegmentMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockMutableSegmentMockRecorder) ContainsID ¶
func (mr *MockMutableSegmentMockRecorder) ContainsID(arg0 interface{}) *gomock.Call
ContainsID indicates an expected call of ContainsID
func (*MockMutableSegmentMockRecorder) Docs ¶ added in v0.5.0
func (mr *MockMutableSegmentMockRecorder) Docs() *gomock.Call
Docs indicates an expected call of Docs
func (*MockMutableSegmentMockRecorder) Fields ¶
func (mr *MockMutableSegmentMockRecorder) Fields() *gomock.Call
Fields indicates an expected call of Fields
func (*MockMutableSegmentMockRecorder) FieldsIterable ¶ added in v0.5.0
func (mr *MockMutableSegmentMockRecorder) FieldsIterable() *gomock.Call
FieldsIterable indicates an expected call of FieldsIterable
func (*MockMutableSegmentMockRecorder) Insert ¶
func (mr *MockMutableSegmentMockRecorder) Insert(arg0 interface{}) *gomock.Call
Insert indicates an expected call of Insert
func (*MockMutableSegmentMockRecorder) InsertBatch ¶
func (mr *MockMutableSegmentMockRecorder) InsertBatch(arg0 interface{}) *gomock.Call
InsertBatch indicates an expected call of InsertBatch
func (*MockMutableSegmentMockRecorder) IsSealed ¶
func (mr *MockMutableSegmentMockRecorder) IsSealed() *gomock.Call
IsSealed indicates an expected call of IsSealed
func (*MockMutableSegmentMockRecorder) Offset ¶ added in v0.5.0
func (mr *MockMutableSegmentMockRecorder) Offset() *gomock.Call
Offset indicates an expected call of Offset
func (*MockMutableSegmentMockRecorder) Reader ¶
func (mr *MockMutableSegmentMockRecorder) Reader() *gomock.Call
Reader indicates an expected call of Reader
func (*MockMutableSegmentMockRecorder) Reset ¶ added in v0.5.0
func (mr *MockMutableSegmentMockRecorder) Reset(arg0 interface{}) *gomock.Call
Reset indicates an expected call of Reset
func (*MockMutableSegmentMockRecorder) Seal ¶
func (mr *MockMutableSegmentMockRecorder) Seal() *gomock.Call
Seal indicates an expected call of Seal
func (*MockMutableSegmentMockRecorder) Size ¶
func (mr *MockMutableSegmentMockRecorder) Size() *gomock.Call
Size indicates an expected call of Size
func (*MockMutableSegmentMockRecorder) Terms ¶
func (mr *MockMutableSegmentMockRecorder) Terms(arg0 interface{}) *gomock.Call
Terms indicates an expected call of Terms
func (*MockMutableSegmentMockRecorder) TermsIterable ¶ added in v0.5.0
func (mr *MockMutableSegmentMockRecorder) TermsIterable() *gomock.Call
TermsIterable indicates an expected call of TermsIterable
type MockSegment ¶
type MockSegment struct {
// contains filtered or unexported fields
}
MockSegment is a mock of Segment interface
func NewMockSegment ¶
func NewMockSegment(ctrl *gomock.Controller) *MockSegment
NewMockSegment creates a new mock instance
func (*MockSegment) ContainsID ¶
func (m *MockSegment) ContainsID(arg0 []byte) (bool, error)
ContainsID mocks base method
func (*MockSegment) EXPECT ¶
func (m *MockSegment) EXPECT() *MockSegmentMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockSegment) FieldsIterable ¶ added in v0.5.0
func (m *MockSegment) FieldsIterable() FieldsIterable
FieldsIterable mocks base method
func (*MockSegment) Reader ¶
func (m *MockSegment) Reader() (index.Reader, error)
Reader mocks base method
func (*MockSegment) TermsIterable ¶ added in v0.5.0
func (m *MockSegment) TermsIterable() TermsIterable
TermsIterable mocks base method
type MockSegmentMockRecorder ¶
type MockSegmentMockRecorder struct {
// contains filtered or unexported fields
}
MockSegmentMockRecorder is the mock recorder for MockSegment
func (*MockSegmentMockRecorder) Close ¶
func (mr *MockSegmentMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockSegmentMockRecorder) ContainsID ¶
func (mr *MockSegmentMockRecorder) ContainsID(arg0 interface{}) *gomock.Call
ContainsID indicates an expected call of ContainsID
func (*MockSegmentMockRecorder) FieldsIterable ¶ added in v0.5.0
func (mr *MockSegmentMockRecorder) FieldsIterable() *gomock.Call
FieldsIterable indicates an expected call of FieldsIterable
func (*MockSegmentMockRecorder) Reader ¶
func (mr *MockSegmentMockRecorder) Reader() *gomock.Call
Reader indicates an expected call of Reader
func (*MockSegmentMockRecorder) Size ¶
func (mr *MockSegmentMockRecorder) Size() *gomock.Call
Size indicates an expected call of Size
func (*MockSegmentMockRecorder) TermsIterable ¶ added in v0.5.0
func (mr *MockSegmentMockRecorder) TermsIterable() *gomock.Call
TermsIterable indicates an expected call of TermsIterable
type MutableSegment ¶
type MutableSegment interface { Segment DocumentsBuilder // Offset returns the postings offset. Offset() postings.ID // Seal marks the Mutable Segment immutable. Seal() error // IsSealed returns true iff the segment is open and un-sealed. IsSealed() bool }
MutableSegment is a segment which can be updated.
type OrderedBytesIterator ¶ added in v0.4.1
type OrderedBytesIterator interface { // Next returns a bool indicating if there are any more elements. Next() bool // Current returns the current element. // NB: the element returned is only valid until the subsequent call to Next(). Current() []byte // Err returns any errors encountered during iteration. Err() error // Close releases any resources held by the iterator. Close() error }
OrderedBytesIterator iterates over a collection of []bytes in lexicographical order.
var EmptyOrderedBytesIterator OrderedBytesIterator = emptyBytesIter{}
EmptyOrderedBytesIterator is an empty OrderedBytesIterator.
type Segment ¶
type Segment interface { // FieldsIterable returns an iterable fields, for which is not // safe for concurrent use. For concurrent use call FieldsIterable // multiple times. FieldsIterable() FieldsIterable // TermsIterable returns an iterable terms, for which is not // safe for concurrent use. For concurrent use call TermsIterable // multiple times. TermsIterable() TermsIterable // Size returns the number of documents within the Segment. It returns // 0 if the Segment has been closed. Size() int64 // ContainsID returns a bool indicating if the Segment contains the provided ID. ContainsID(docID []byte) (bool, error) // Reader returns a point-in-time accessor to search the segment. Reader() (index.Reader, error) // Close closes the segment and releases any internal resources. Close() error }
Segment is a sub-collection of documents within an index.
type SegmentsBuilder ¶ added in v0.5.0
type SegmentsBuilder interface { Builder // AddSegments adds segments to build from. AddSegments(segments []Segment) error }
SegmentsBuilder is a builder that is built from segments.
type TermsIterable ¶ added in v0.5.0
type TermsIterable interface { // Terms returns an iterator over the known terms values for the given // field, in order by name, it is not valid for reading after mutating the // builder by inserting more documents. Terms(field []byte) (TermsIterator, error) }
TermsIterable can iterate over segment terms, it is not by default concurrency safe.
type TermsIterator ¶ added in v0.4.1
type TermsIterator interface { // Next returns a bool indicating if there are any more elements. Next() bool // Current returns the current element. // NB: the element returned is only valid until the subsequent call to Next(). Current() (term []byte, postings postings.List) // Err returns any errors encountered during iteration. Err() error // Close releases any resources held by the iterator. Close() error }
TermsIterator iterates over all known terms for the provided field.
var EmptyTermsIterator TermsIterator = emptyTermsIter{}
EmptyTermsIterator is an empty EmptyTermsIterator.