Documentation
¶
Index ¶
- func ConvertGenericColumnValueToSpannerValue(cv *GenericColumnValue) (interface{}, error)
- type CSVDatasource
- func (ds *CSVDatasource) GetRows(ctx context.Context, schema *Schema) ([]*Row, error)
- func (ds *CSVDatasource) GetSchema(ctx context.Context, name string) (*Schema, error)
- func (ds *CSVDatasource) SetRows(ctx context.Context, schema *Schema, rows []*Row) error
- func (ds *CSVDatasource) SetSchema(ctx context.Context, schema *Schema) error
- type Column
- type ColumnType
- type Datasource
- type GenericColumnValue
- type GroupByKey
- type Key
- type KeyType
- type MockDatasource
- func (ds *MockDatasource) GetAllSchema(ctx context.Context) ([]*Schema, error)
- func (ds *MockDatasource) GetRows(ctx context.Context, sc *Schema) ([]*Row, error)
- func (ds *MockDatasource) GetSchema(ctx context.Context, name string) (*Schema, error)
- func (ds *MockDatasource) SetRows(ctx context.Context, sc *Schema, rows []*Row) error
- func (ds *MockDatasource) SetSchema(ctx context.Context, sc *Schema) error
- type MySQLDatasource
- func (ds *MySQLDatasource) Close() error
- func (ds *MySQLDatasource) GetRows(ctx context.Context, schema *Schema) ([]*Row, error)
- func (ds *MySQLDatasource) GetSchema(ctx context.Context, name string) (*Schema, error)
- func (ds *MySQLDatasource) Open() error
- func (ds *MySQLDatasource) SetRows(ctx context.Context, schema *Schema, rows []*Row) error
- func (ds *MySQLDatasource) SetSchema(ctx context.Context, schema *Schema) error
- type Row
- type RowValues
- type Schema
- type SpannerDatasource
- func (ds *SpannerDatasource) Close() error
- func (ds *SpannerDatasource) GetAllSchema(ctx context.Context) ([]*Schema, error)
- func (ds *SpannerDatasource) GetRows(ctx context.Context, schema *Schema) ([]*Row, error)
- func (ds *SpannerDatasource) GetSchema(ctx context.Context, name string) (*Schema, error)
- func (ds *SpannerDatasource) SetRows(ctx context.Context, schema *Schema, rows []*Row) error
- func (ds *SpannerDatasource) SetSchema(ctx context.Context, schema *Schema) error
- type SpreadsheetDatasource
- func (ds *SpreadsheetDatasource) GetRows(ctx context.Context, schema *Schema) ([]*Row, error)
- func (ds *SpreadsheetDatasource) GetSchema(ctx context.Context, name string) (*Schema, error)
- func (ds *SpreadsheetDatasource) SetRows(ctx context.Context, schema *Schema, rows []*Row) error
- func (ds *SpreadsheetDatasource) SetSchema(ctx context.Context, schema *Schema) error
- type SpreadsheetService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertGenericColumnValueToSpannerValue ¶
func ConvertGenericColumnValueToSpannerValue(cv *GenericColumnValue) (interface{}, error)
ConvertGenericColumnValueToSpannerValue converts GenericColumnValue to Spanner Value
Types ¶
type CSVDatasource ¶
type CSVDatasource struct {
RootPath string `json:"root_path"`
ColumnRowIndex int `json:"column_row_index"`
}
CSVDatasource is datasource config for csv file
func NewCSVDatasource ¶
func NewCSVDatasource(rootPath string, columnRowIndex int) (*CSVDatasource, error)
NewCSVDatasource is create CSVDatasource instance
type Column ¶
type Column struct {
Name string `json:"name"`
OrdinalPosition int `json:"ordinal_position"`
Type ColumnType `json:"type"`
NotNull bool `json:"not_null"`
AutoIncrement bool `json:"auto_increment"`
}
func (*Column) IsArrayType ¶
type ColumnType ¶
type ColumnType int
const ( ColumnTypeNull ColumnType = iota ColumnTypeString ColumnTypeInt ColumnTypeFloat ColumnTypeDatetime ColumnTypeDate ColumnTypeBytes ColumnTypeBool ColumnTypeStringArray ColumnTypeIntArray ColumnTypeFloatArray ColumnTypeDatetimeArray ColumnTypeDateArray ColumnTypeBytesArray ColumnTypeBoolArray )
func (ColumnType) String ¶
func (ct ColumnType) String() string
type Datasource ¶
type GenericColumnValue ¶
type GenericColumnValue struct {
Column *Column
Value interface{}
}
TOOD: rename GenericRowValue?
func GenericSpannerValueToTamateGenericColumnValue ¶
func GenericSpannerValueToTamateGenericColumnValue(sp spanner.GenericColumnValue, col *Column) (*GenericColumnValue, error)
func NewGenericColumnValue ¶
func NewGenericColumnValue(col *Column) *GenericColumnValue
func NewStringGenericColumnValue ¶
func NewStringGenericColumnValue(col *Column, s string) *GenericColumnValue
func (*GenericColumnValue) BoolValue ¶
func (cv *GenericColumnValue) BoolValue() bool
func (*GenericColumnValue) StringValue ¶
func (cv *GenericColumnValue) StringValue() string
type GroupByKey ¶
type GroupByKey map[string][]*GenericColumnValue
type MockDatasource ¶
type MockDatasource struct{}
func NewMockDatasource ¶
func NewMockDatasource() (*MockDatasource, error)
func (*MockDatasource) GetAllSchema ¶
func (ds *MockDatasource) GetAllSchema(ctx context.Context) ([]*Schema, error)
type MySQLDatasource ¶
type MySQLDatasource struct {
DSN string `json:"dsn"`
// contains filtered or unexported fields
}
MySQLDatasource is datasource config for MySQL DB
func NewMySQLDatasource ¶
func NewMySQLDatasource(dsn string) (*MySQLDatasource, error)
NewMySQLDatasource is create MySQLDatasource instance
type Row ¶
type Row struct {
GroupByKey GroupByKey `json:"-"`
Values RowValues
}
type RowValues ¶
type RowValues map[string]*GenericColumnValue
type Schema ¶
type Schema struct {
Name string `json:"name"`
PrimaryKey *Key `json:"primary_key"`
Columns []*Column `json:"columns"`
}
* Schema
func (*Schema) GetColumnNames ¶
GetColumnNames is return name list of columns
type SpannerDatasource ¶
type SpannerDatasource struct {
DSN string `json:"dsn"`
// contains filtered or unexported fields
}
func NewSpannerDatasource ¶
func NewSpannerDatasource(dsn string) (*SpannerDatasource, error)
func (*SpannerDatasource) Close ¶
func (ds *SpannerDatasource) Close() error
func (*SpannerDatasource) GetAllSchema ¶
func (ds *SpannerDatasource) GetAllSchema(ctx context.Context) ([]*Schema, error)
type SpreadsheetDatasource ¶
type SpreadsheetDatasource struct {
SpreadsheetID string `json:"spreadsheet_id"`
ColumnRowIndex int `json:"column_row_index"`
// contains filtered or unexported fields
}
func NewGoogleSpreadsheetDatasource ¶
func NewGoogleSpreadsheetDatasource(client *http.Client, spreadsheetID string, columnRowIndex int) (*SpreadsheetDatasource, error)
NewGoogleSpreadsheetDatasource is return SpreadsheetDatasource for google instance
func NewSpreadsheetDatasource ¶
func NewSpreadsheetDatasource(service SpreadsheetService, spreadsheetID string, columnRowIndex int) (*SpreadsheetDatasource, error)
NewSpreadsheetDatasource is return SpreadsheetDatasource instance
Click to show internal directories.
Click to hide internal directories.