mockcsv

package
v0.0.0-...-8371fe2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2016 License: MIT Imports: 6 Imported by: 0

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

func LoadTable

func LoadTable(schemaName, name, csvRaw string)

LoadTable MockCsv is used for mocking so has a global data source we can load data into

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) Open

func (m *MockCsvSource) Open(tableName string) (schema.Conn, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL