Documentation ¶
Overview ¶
Package mockcsv implements an in-memory csv data source for testing usage implemented by wrapping the mem-b-tree, loading csv data into it. NOT intended for any production usages, test only.
Index ¶
- Constants
- Variables
- func LoadTable(schemaName, name, csvRaw string)
- func Schema() *schema.Schema
- type Source
- func (m *Source) Close() error
- func (m *Source) CreateTable(tableName, csvRaw string)
- func (m *Source) DropTable(t string) error
- func (m *Source) Init()
- func (m *Source) Open(tableName string) (schema.Conn, error)
- func (m *Source) Setup(s *schema.Schema) error
- func (m *Source) Table(tableName string) (*schema.Table, error)
- func (m *Source) Tables() []string
- type Table
Constants ¶
View Source
const (
// SchemaName is "mockcsv"
SchemaName = "mockcsv"
)
Variables ¶
View Source
var ( // CsvGlobal mock csv in mem store CsvGlobal = New() )
Functions ¶
Types ¶
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source DataSource for testing creates an in memory b-tree per "table". Is not thread safe.
func (*Source) CreateTable ¶
CreateTable create a csv table in this source.
type Table ¶
type Table struct {
*membtree.StaticDataSource
}
Table converts the static csv-source into a schema.Conn source
Click to show internal directories.
Click to hide internal directories.