Documentation ¶
Overview ¶
Package fst is a generated GoMock package.
Index ¶
- Constants
- func ToTestSegment(t *testing.T, s sgmt.MutableSegment, opts Options) sgmt.Segment
- type MockSegment
- func (m *MockSegment) AllDocs() (index.IDDocIterator, error)
- func (m *MockSegment) Close() error
- func (m *MockSegment) ContainsID(arg0 []byte) (bool, error)
- func (m *MockSegment) Doc(arg0 postings.ID) (doc.Document, error)
- func (m *MockSegment) Docs(arg0 postings.List) (doc.Iterator, error)
- func (m *MockSegment) EXPECT() *MockSegmentMockRecorder
- func (m *MockSegment) Fields() (segment.FieldsIterator, error)
- func (m *MockSegment) MatchAll() (postings.MutableList, error)
- func (m *MockSegment) MatchRegexp(arg0 []byte, arg1 index.CompiledRegex) (postings.List, error)
- func (m *MockSegment) MatchTerm(arg0, arg1 []byte) (postings.List, error)
- func (m *MockSegment) Reader() (index.Reader, error)
- func (m *MockSegment) Size() int64
- func (m *MockSegment) Terms(arg0 []byte) (segment.TermsIterator, error)
- type MockSegmentMockRecorder
- func (mr *MockSegmentMockRecorder) AllDocs() *gomock.Call
- func (mr *MockSegmentMockRecorder) Close() *gomock.Call
- func (mr *MockSegmentMockRecorder) ContainsID(arg0 interface{}) *gomock.Call
- func (mr *MockSegmentMockRecorder) Doc(arg0 interface{}) *gomock.Call
- func (mr *MockSegmentMockRecorder) Docs(arg0 interface{}) *gomock.Call
- func (mr *MockSegmentMockRecorder) Fields() *gomock.Call
- func (mr *MockSegmentMockRecorder) MatchAll() *gomock.Call
- func (mr *MockSegmentMockRecorder) MatchRegexp(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockSegmentMockRecorder) MatchTerm(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockSegmentMockRecorder) Reader() *gomock.Call
- func (mr *MockSegmentMockRecorder) Size() *gomock.Call
- func (mr *MockSegmentMockRecorder) Terms(arg0 interface{}) *gomock.Call
- type MockWriter
- func (m *MockWriter) EXPECT() *MockWriterMockRecorder
- func (m *MockWriter) MajorVersion() int
- func (m *MockWriter) Metadata() []byte
- func (m *MockWriter) MinorVersion() int
- func (m *MockWriter) Reset(arg0 segment.MutableSegment) error
- func (m *MockWriter) WriteDocumentsData(arg0 io.Writer) error
- func (m *MockWriter) WriteDocumentsIndex(arg0 io.Writer) error
- func (m *MockWriter) WriteFSTFields(arg0 io.Writer) error
- func (m *MockWriter) WriteFSTTerms(arg0 io.Writer) error
- func (m *MockWriter) WritePostingsOffsets(arg0 io.Writer) error
- type MockWriterMockRecorder
- func (mr *MockWriterMockRecorder) MajorVersion() *gomock.Call
- func (mr *MockWriterMockRecorder) Metadata() *gomock.Call
- func (mr *MockWriterMockRecorder) MinorVersion() *gomock.Call
- func (mr *MockWriterMockRecorder) Reset(arg0 interface{}) *gomock.Call
- func (mr *MockWriterMockRecorder) WriteDocumentsData(arg0 interface{}) *gomock.Call
- func (mr *MockWriterMockRecorder) WriteDocumentsIndex(arg0 interface{}) *gomock.Call
- func (mr *MockWriterMockRecorder) WriteFSTFields(arg0 interface{}) *gomock.Call
- func (mr *MockWriterMockRecorder) WriteFSTTerms(arg0 interface{}) *gomock.Call
- func (mr *MockWriterMockRecorder) WritePostingsOffsets(arg0 interface{}) *gomock.Call
- type Options
- type Segment
- type SegmentData
- type Writer
Constants ¶
const ( // MajorVersion is the currently supported MajorVersion. MajorVersion = 1 // MinorVersion is the current MinorVersion. MinorVersion = 0 )
Variables ¶
This section is empty.
Functions ¶
func ToTestSegment ¶ added in v0.4.3
ToTestSegment returns a FST segment equivalent to the provide mutable segment.
Types ¶
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) AllDocs ¶
func (m *MockSegment) AllDocs() (index.IDDocIterator, error)
AllDocs mocks base method
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) Fields ¶
func (m *MockSegment) Fields() (segment.FieldsIterator, error)
Fields mocks base method
func (*MockSegment) MatchAll ¶
func (m *MockSegment) MatchAll() (postings.MutableList, error)
MatchAll mocks base method
func (*MockSegment) MatchRegexp ¶
func (m *MockSegment) MatchRegexp(arg0 []byte, arg1 index.CompiledRegex) (postings.List, error)
MatchRegexp mocks base method
func (*MockSegment) MatchTerm ¶
func (m *MockSegment) MatchTerm(arg0, arg1 []byte) (postings.List, error)
MatchTerm mocks base method
func (*MockSegment) Reader ¶
func (m *MockSegment) Reader() (index.Reader, error)
Reader mocks base method
func (*MockSegment) Terms ¶
func (m *MockSegment) Terms(arg0 []byte) (segment.TermsIterator, error)
Terms mocks base method
type MockSegmentMockRecorder ¶
type MockSegmentMockRecorder struct {
// contains filtered or unexported fields
}
MockSegmentMockRecorder is the mock recorder for MockSegment
func (*MockSegmentMockRecorder) AllDocs ¶
func (mr *MockSegmentMockRecorder) AllDocs() *gomock.Call
AllDocs indicates an expected call of AllDocs
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) Doc ¶
func (mr *MockSegmentMockRecorder) Doc(arg0 interface{}) *gomock.Call
Doc indicates an expected call of Doc
func (*MockSegmentMockRecorder) Docs ¶
func (mr *MockSegmentMockRecorder) Docs(arg0 interface{}) *gomock.Call
Docs indicates an expected call of Docs
func (*MockSegmentMockRecorder) Fields ¶
func (mr *MockSegmentMockRecorder) Fields() *gomock.Call
Fields indicates an expected call of Fields
func (*MockSegmentMockRecorder) MatchAll ¶
func (mr *MockSegmentMockRecorder) MatchAll() *gomock.Call
MatchAll indicates an expected call of MatchAll
func (*MockSegmentMockRecorder) MatchRegexp ¶
func (mr *MockSegmentMockRecorder) MatchRegexp(arg0, arg1 interface{}) *gomock.Call
MatchRegexp indicates an expected call of MatchRegexp
func (*MockSegmentMockRecorder) MatchTerm ¶
func (mr *MockSegmentMockRecorder) MatchTerm(arg0, arg1 interface{}) *gomock.Call
MatchTerm indicates an expected call of MatchTerm
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) Terms ¶
func (mr *MockSegmentMockRecorder) Terms(arg0 interface{}) *gomock.Call
Terms indicates an expected call of Terms
type MockWriter ¶
type MockWriter struct {
// contains filtered or unexported fields
}
MockWriter is a mock of Writer interface
func NewMockWriter ¶
func NewMockWriter(ctrl *gomock.Controller) *MockWriter
NewMockWriter creates a new mock instance
func (*MockWriter) EXPECT ¶
func (m *MockWriter) EXPECT() *MockWriterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockWriter) MajorVersion ¶
func (m *MockWriter) MajorVersion() int
MajorVersion mocks base method
func (*MockWriter) MinorVersion ¶
func (m *MockWriter) MinorVersion() int
MinorVersion mocks base method
func (*MockWriter) Reset ¶
func (m *MockWriter) Reset(arg0 segment.MutableSegment) error
Reset mocks base method
func (*MockWriter) WriteDocumentsData ¶
func (m *MockWriter) WriteDocumentsData(arg0 io.Writer) error
WriteDocumentsData mocks base method
func (*MockWriter) WriteDocumentsIndex ¶
func (m *MockWriter) WriteDocumentsIndex(arg0 io.Writer) error
WriteDocumentsIndex mocks base method
func (*MockWriter) WriteFSTFields ¶
func (m *MockWriter) WriteFSTFields(arg0 io.Writer) error
WriteFSTFields mocks base method
func (*MockWriter) WriteFSTTerms ¶
func (m *MockWriter) WriteFSTTerms(arg0 io.Writer) error
WriteFSTTerms mocks base method
func (*MockWriter) WritePostingsOffsets ¶
func (m *MockWriter) WritePostingsOffsets(arg0 io.Writer) error
WritePostingsOffsets mocks base method
type MockWriterMockRecorder ¶
type MockWriterMockRecorder struct {
// contains filtered or unexported fields
}
MockWriterMockRecorder is the mock recorder for MockWriter
func (*MockWriterMockRecorder) MajorVersion ¶
func (mr *MockWriterMockRecorder) MajorVersion() *gomock.Call
MajorVersion indicates an expected call of MajorVersion
func (*MockWriterMockRecorder) Metadata ¶
func (mr *MockWriterMockRecorder) Metadata() *gomock.Call
Metadata indicates an expected call of Metadata
func (*MockWriterMockRecorder) MinorVersion ¶
func (mr *MockWriterMockRecorder) MinorVersion() *gomock.Call
MinorVersion indicates an expected call of MinorVersion
func (*MockWriterMockRecorder) Reset ¶
func (mr *MockWriterMockRecorder) Reset(arg0 interface{}) *gomock.Call
Reset indicates an expected call of Reset
func (*MockWriterMockRecorder) WriteDocumentsData ¶
func (mr *MockWriterMockRecorder) WriteDocumentsData(arg0 interface{}) *gomock.Call
WriteDocumentsData indicates an expected call of WriteDocumentsData
func (*MockWriterMockRecorder) WriteDocumentsIndex ¶
func (mr *MockWriterMockRecorder) WriteDocumentsIndex(arg0 interface{}) *gomock.Call
WriteDocumentsIndex indicates an expected call of WriteDocumentsIndex
func (*MockWriterMockRecorder) WriteFSTFields ¶
func (mr *MockWriterMockRecorder) WriteFSTFields(arg0 interface{}) *gomock.Call
WriteFSTFields indicates an expected call of WriteFSTFields
func (*MockWriterMockRecorder) WriteFSTTerms ¶
func (mr *MockWriterMockRecorder) WriteFSTTerms(arg0 interface{}) *gomock.Call
WriteFSTTerms indicates an expected call of WriteFSTTerms
func (*MockWriterMockRecorder) WritePostingsOffsets ¶
func (mr *MockWriterMockRecorder) WritePostingsOffsets(arg0 interface{}) *gomock.Call
WritePostingsOffsets indicates an expected call of WritePostingsOffsets
type Options ¶
type Options interface { // SetInstrumentOptions sets the instrument options. SetInstrumentOptions(value instrument.Options) Options // InstrumentOptions returns the instrument options. InstrumentOptions() instrument.Options // SetBytesSliceArrayPool sets the bytes slice array pool. SetBytesSliceArrayPool(value bytes.SliceArrayPool) Options // BytesSliceArrayPool returns the bytes slice array pool. BytesSliceArrayPool() bytes.SliceArrayPool // SetBytesPool sets the bytes pool. SetBytesPool(value pool.BytesPool) Options // BytesPool returns the bytes pool. BytesPool() pool.BytesPool // SetPostingsListPool sets the postings list pool. SetPostingsListPool(value postings.Pool) Options // PostingsListPool returns the postings list pool. PostingsListPool() postings.Pool }
Options is a collection of knobs for a fs segment.
type Segment ¶
Segment represents a FST segment.
func NewSegment ¶
func NewSegment(data SegmentData, opts Options) (Segment, error)
NewSegment returns a new Segment backed by the provided options. NB(prateek): this method only assumes ownership of the data if it returns a nil error, otherwise, the user is expected to handle the lifecycle of the input.
type SegmentData ¶
type SegmentData struct { MajorVersion int MinorVersion int Metadata []byte DocsData []byte DocsIdxData []byte PostingsData []byte FSTTermsData []byte FSTFieldsData []byte Closer io.Closer }
SegmentData represent the collection of required parameters to construct a Segment.
func (SegmentData) Validate ¶
func (sd SegmentData) Validate() error
Validate validates the provided segment data, returning an error if it's not.
type Writer ¶
type Writer interface { // Reset sets the Writer to persist the provide segment. // NB(prateek): the provided segment must be a Sealed Mutable segment. Reset(s sgmt.MutableSegment) error // MajorVersion is the major version for the writer. MajorVersion() int // MinorVersion is the minor version for the writer. MinorVersion() int // Metadata returns metadata about the writer. Metadata() []byte // WriteDocumentsData writes out the documents data to the provided writer. WriteDocumentsData(w io.Writer) error // WriteDocumentsIndex writes out the documents index to the provided writer. // NB(prateek): this must be called after WriteDocumentsData(). WriteDocumentsIndex(w io.Writer) error // WritePostingsOffsets writes out the postings offset file to the provided // writer. WritePostingsOffsets(w io.Writer) error // WriteFSTTerms writes out the FSTTerms file using the provided writer. // NB(prateek): this must be called after WritePostingsOffsets(). WriteFSTTerms(w io.Writer) error // WriteFSTFields writes out the FSTFields file using the provided writer. // NB(prateek): this must be called after WriteFSTTerm(). WriteFSTFields(w io.Writer) error }
Writer writes out a FST segment from the provided elements.