Documentation ¶
Overview ¶
Package fst is a generated GoMock package.
Index ¶
- 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) ContainsField(arg0 []byte) (bool, 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) FieldsIterable() segment.FieldsIterable
- func (m *MockSegment) MatchAll() (postings.MutableList, error)
- func (m *MockSegment) MatchField(arg0 []byte) (postings.List, 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) TermsIterable() segment.TermsIterable
- type MockSegmentMockRecorder
- func (mr *MockSegmentMockRecorder) AllDocs() *gomock.Call
- func (mr *MockSegmentMockRecorder) Close() *gomock.Call
- func (mr *MockSegmentMockRecorder) ContainsField(arg0 interface{}) *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) FieldsIterable() *gomock.Call
- func (mr *MockSegmentMockRecorder) MatchAll() *gomock.Call
- func (mr *MockSegmentMockRecorder) MatchField(arg0 interface{}) *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) TermsIterable() *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.Builder) 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 Version
- type Writer
- type WriterOptions
Constants ¶
This section is empty.
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) ContainsField ¶ added in v0.9.1
func (m *MockSegment) ContainsField(arg0 []byte) (bool, error)
ContainsField 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) FieldsIterable ¶ added in v0.5.0
func (m *MockSegment) FieldsIterable() segment.FieldsIterable
FieldsIterable mocks base method
func (*MockSegment) MatchAll ¶
func (m *MockSegment) MatchAll() (postings.MutableList, error)
MatchAll mocks base method
func (*MockSegment) MatchField ¶ added in v0.8.2
func (m *MockSegment) MatchField(arg0 []byte) (postings.List, error)
MatchField 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) TermsIterable ¶ added in v0.5.0
func (m *MockSegment) TermsIterable() segment.TermsIterable
TermsIterable 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) ContainsField ¶ added in v0.9.1
func (mr *MockSegmentMockRecorder) ContainsField(arg0 interface{}) *gomock.Call
ContainsField indicates an expected call of ContainsField
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) FieldsIterable ¶ added in v0.5.0
func (mr *MockSegmentMockRecorder) FieldsIterable() *gomock.Call
FieldsIterable indicates an expected call of FieldsIterable
func (*MockSegmentMockRecorder) MatchAll ¶
func (mr *MockSegmentMockRecorder) MatchAll() *gomock.Call
MatchAll indicates an expected call of MatchAll
func (*MockSegmentMockRecorder) MatchField ¶ added in v0.8.2
func (mr *MockSegmentMockRecorder) MatchField(arg0 interface{}) *gomock.Call
MatchField indicates an expected call of MatchField
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) TermsIterable ¶ added in v0.5.0
func (mr *MockSegmentMockRecorder) TermsIterable() *gomock.Call
TermsIterable indicates an expected call of TermsIterable
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.Builder) 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 // 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 { Version Version Metadata []byte DocsData []byte DocsIdxData []byte PostingsData []byte FSTTermsData []byte FSTFieldsData []byte // DocsReader is an alternative to specifying // the docs data and docs idx data if the documents // already reside in memory and we want to use the // in memory references instead. DocsReader *docs.SliceReader 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): if provided segment is a mutable segment it must be sealed. Reset(s sgmt.Builder) 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.
type WriterOptions ¶ added in v0.5.0
type WriterOptions struct { // DisableRegistry disables the FST builder node registry cache which can // de-duplicate transitions that are an exact match of each other during // a final compilation phase, this helps compress the FST by a significant // amount (e.g. 2x). You can disable this to speed up high fixed cost // lookups to during building of the FST however. DisableRegistry bool }
WriterOptions is a set of options used when writing an FST.