Documentation ¶
Overview ¶
Mockcsv implements an in-memory csv data source for testing usage implemented by wrapping the mem-b-tree.
Index ¶
Constants ¶
View Source
const (
MockSchemaName = "mockcsv"
)
Variables ¶
View Source
var ( // Schema ~= global mock // -> SourceSchema = "mockcsv" // -> DS = MockCsvSource MockCsvGlobal = NewMockSource() MockSchema *schema.Schema )
Functions ¶
Types ¶
type MockCsvSource ¶
type MockCsvSource struct {
// contains filtered or unexported fields
}
MockCsvSource DataSource for testing
- creates an in memory b-tree per "table"
- not thread safe
func NewMockSource ¶
func NewMockSource() *MockCsvSource
func (*MockCsvSource) Close ¶
func (m *MockCsvSource) Close() error
func (*MockCsvSource) CreateTable ¶
func (m *MockCsvSource) CreateTable(tableName, csvRaw string)
func (*MockCsvSource) Table ¶
func (m *MockCsvSource) Table(tableName string) (*schema.Table, error)
func (*MockCsvSource) Tables ¶
func (m *MockCsvSource) Tables() []string
type MockCsvTable ¶
type MockCsvTable struct {
*membtree.StaticDataSource
}
MockCsvTable converts the static csv-source into a schema.Conn source
Click to show internal directories.
Click to hide internal directories.