push

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJSONRowIterator

func NewJSONRowIterator(file io.ReadCloser) push.RowIterator

NewJSONRowIterator creates a new JSONRowIterator.

func NewJSONRowWriter

func NewJSONRowWriter(file io.Writer) push.RowWriter

NewJSONRowWriter creates a new JSONRowWriter.

Types

type Db2DataDestinationFactory added in v1.4.0

type Db2DataDestinationFactory struct{}

Db2DataDestinationFactory exposes methods to create new Db2 extractors.

func NewDb2DataDestinationFactory added in v1.4.0

func NewDb2DataDestinationFactory() *Db2DataDestinationFactory

NewDb2DataDestinationFactory creates a new Db2 datadestination factory.

func (*Db2DataDestinationFactory) New added in v1.4.0

New return a Db2 pusher

type Db2Dialect added in v1.4.0

type Db2Dialect struct{}

Db2Dialect inject oracle variations

func (Db2Dialect) ConvertValue added in v1.4.0

func (d Db2Dialect) ConvertValue(from push.Value) push.Value

ConvertValue before load

func (Db2Dialect) DisableConstraintsStatement added in v1.4.0

func (d Db2Dialect) DisableConstraintsStatement(tableName string) string

DisableConstraintsStatement generate statments to deactivate constraintes

func (Db2Dialect) EnableConstraintsStatement added in v1.4.0

func (d Db2Dialect) EnableConstraintsStatement(tableName string) string

EnableConstraintsStatement generate statments to activate constraintes

func (Db2Dialect) InsertStatement added in v1.4.0

func (d Db2Dialect) InsertStatement(tableName string, columns []string, values []string, primaryKeys []string) string

InsertStatement generate insert statement

func (Db2Dialect) IsDuplicateError added in v1.4.0

func (d Db2Dialect) IsDuplicateError(err error) bool

IsDuplicateError check if error is a duplicate error

func (Db2Dialect) Placeholder added in v1.4.0

func (d Db2Dialect) Placeholder(position int) string

Placeholde return the variable format for postgres

func (Db2Dialect) TruncateStatement added in v1.4.0

func (d Db2Dialect) TruncateStatement(tableName string) string

TruncateStatement generate statement to truncat table content

func (Db2Dialect) UpdateStatement added in v1.4.0

func (d Db2Dialect) UpdateStatement(tableName string, columns []string, uValues []string, primaryKeys []string, pValues []string) (string, []string, *push.Error)

UpdateStatement

type HTTPDataDestination added in v1.7.0

type HTTPDataDestination struct {
	// contains filtered or unexported fields
}

HTTPDataDestination write data to a HTTP endpoint.

func NewHTTPDataDestination added in v1.7.0

func NewHTTPDataDestination(url string, schema string) *HTTPDataDestination

NewHTTPDataDestination creates a new HTTP datadestination.

func (*HTTPDataDestination) Close added in v1.7.0

func (dd *HTTPDataDestination) Close() *push.Error

Close HTTP connections

func (*HTTPDataDestination) Commit added in v1.7.0

func (dd *HTTPDataDestination) Commit() *push.Error

Commit HTTP for connection

func (*HTTPDataDestination) Open added in v1.7.0

func (dd *HTTPDataDestination) Open(plan push.Plan, mode push.Mode, disableConstraints bool) *push.Error

Open HTTP Connection

func (*HTTPDataDestination) RowWriter added in v1.7.0

func (dd *HTTPDataDestination) RowWriter(table push.Table) (push.RowWriter, *push.Error)

RowWriter return HTTP table writer

type HTTPDataDestinationFactory added in v1.7.0

type HTTPDataDestinationFactory struct{}

HTTPDataDestinationFactory exposes methods to create new HTTP pusher.

func NewHTTPDataDestinationFactory added in v1.7.0

func NewHTTPDataDestinationFactory() *HTTPDataDestinationFactory

NewHTTPDataDestinationFactory creates a new HTTP datadestination factory.

func (*HTTPDataDestinationFactory) New added in v1.7.0

New return a HTTP pusher

type HTTPRowWriter added in v1.7.0

type HTTPRowWriter struct {
	// contains filtered or unexported fields
}

HTTPRowWriter write data to a HTTP table.

func NewHTTPRowWriter added in v1.7.0

func NewHTTPRowWriter(table push.Table, dd *HTTPDataDestination, req *http.Request, buf io.WriteCloser) *HTTPRowWriter

NewHTTPRowWriter creates a new HTTP row writer.

func (*HTTPRowWriter) Close added in v1.7.0

func (rw *HTTPRowWriter) Close() *push.Error

close table writer

func (*HTTPRowWriter) Request added in v1.7.0

func (rw *HTTPRowWriter) Request()

Request

func (*HTTPRowWriter) Write added in v1.7.0

func (rw *HTTPRowWriter) Write(row push.Row) *push.Error

Write

type JSONRowIterator

type JSONRowIterator struct {
	// contains filtered or unexported fields
}

JSONRowIterator export rows to JSON format.

func (*JSONRowIterator) Close

func (re *JSONRowIterator) Close() *push.Error

Close file format.

func (*JSONRowIterator) Error

func (re *JSONRowIterator) Error() *push.Error

Error return error catch by next

func (*JSONRowIterator) Next

func (re *JSONRowIterator) Next() bool

Next try to convert next line to Row

func (*JSONRowIterator) Value

func (re *JSONRowIterator) Value() *push.Row

Value return current row

type JSONRowWriter

type JSONRowWriter struct {
	// contains filtered or unexported fields
}

JSONRowWriter export rows to JSON format.

func (*JSONRowWriter) Write

func (rw *JSONRowWriter) Write(row push.Row) *push.Error

NextRow convert next line to Row

type MariadbDataDestinationFactory added in v1.10.0

type MariadbDataDestinationFactory struct{}

MariadbDataDestinationFactory exposes methods to create new Mariadb pullers.

func NewMariadbDataDestinationFactory added in v1.10.0

func NewMariadbDataDestinationFactory() *MariadbDataDestinationFactory

NewMariadbDataDestinationFactory creates a new mariadb datadestination factory.

func (*MariadbDataDestinationFactory) New added in v1.10.0

New return a Mariadb pusher

type MariadbDialect added in v1.10.0

type MariadbDialect struct{}

MariadbDialect inject mariadb variations

func (MariadbDialect) ConvertValue added in v1.10.0

func (d MariadbDialect) ConvertValue(from push.Value) push.Value

ConvertValue before load

func (MariadbDialect) DisableConstraintsStatement added in v1.10.0

func (d MariadbDialect) DisableConstraintsStatement(tableName string) string

DisableConstraintsStatement generate statments to deactivate constraintes

func (MariadbDialect) EnableConstraintsStatement added in v1.10.0

func (d MariadbDialect) EnableConstraintsStatement(tableName string) string

EnableConstraintsStatement generate statments to activate constraintes

func (MariadbDialect) InsertStatement added in v1.10.0

func (d MariadbDialect) InsertStatement(tableName string, columns []string, values []string, primaryKeys []string) string

InsertStatement generate insert statement

func (MariadbDialect) IsDuplicateError added in v1.10.0

func (d MariadbDialect) IsDuplicateError(err error) bool

IsDuplicateError check if error is a duplicate error

func (MariadbDialect) Placeholder added in v1.10.0

func (d MariadbDialect) Placeholder(position int) string

Placeholde return the variable format for mariadb

func (MariadbDialect) TruncateStatement added in v1.10.0

func (d MariadbDialect) TruncateStatement(tableName string) string

TruncateStatement generate statement to truncat table content (ON DELETE CASCADE must be set to TRUNCATE child tables)

func (MariadbDialect) UpdateStatement added in v1.10.0

func (d MariadbDialect) UpdateStatement(tableName string, columns []string, uValues []string, primaryKeys []string, pValues []string) (string, []string, *push.Error)

type MockSQLDialect

type MockSQLDialect struct {
	mock.Mock
}

MockSQLDialect is an autogenerated mock type for the SQLDialect type

func (*MockSQLDialect) ConvertValue

func (_m *MockSQLDialect) ConvertValue(_a0 push.Value) push.Value

ConvertValue provides a mock function with given fields: _a0

func (*MockSQLDialect) DisableConstraintsStatement

func (_m *MockSQLDialect) DisableConstraintsStatement(tableName string) string

DisableConstraintsStatement provides a mock function with given fields: tableName

func (*MockSQLDialect) EnableConstraintsStatement

func (_m *MockSQLDialect) EnableConstraintsStatement(tableName string) string

EnableConstraintsStatement provides a mock function with given fields: tableName

func (*MockSQLDialect) InsertStatement

func (_m *MockSQLDialect) InsertStatement(tableName string, columns []string, values []string, primaryKeys []string) string

InsertStatement provides a mock function with given fields: tableName, columns, values, primaryKeys

func (*MockSQLDialect) IsDuplicateError

func (_m *MockSQLDialect) IsDuplicateError(_a0 error) bool

IsDuplicateError provides a mock function with given fields: _a0

func (*MockSQLDialect) Placeholder

func (_m *MockSQLDialect) Placeholder(_a0 int) string

Placeholder provides a mock function with given fields: _a0

func (*MockSQLDialect) TruncateStatement

func (_m *MockSQLDialect) TruncateStatement(tableName string) string

TruncateStatement provides a mock function with given fields: tableName

func (*MockSQLDialect) UpdateStatement

func (_m *MockSQLDialect) UpdateStatement(tableName string, columns []string, uValues []string, primaryKeys []string, pValues []string) (string, *push.Error)

UpdateStatement provides a mock function with given fields: tableName, columns, uValues, primaryKeys, pValues

type OracleDataDestinationFactory

type OracleDataDestinationFactory struct{}

OracleDataDestinationFactory exposes methods to create new Oracle extractors.

func NewOracleDataDestinationFactory

func NewOracleDataDestinationFactory() *OracleDataDestinationFactory

NewOracleDataDestinationFactory creates a new Oracle datadestination factory.

func (*OracleDataDestinationFactory) New

New return a Oracle pusher

type OracleDialect

type OracleDialect struct{}

OracleDialect inject oracle variations

func (OracleDialect) ConvertValue

func (d OracleDialect) ConvertValue(from push.Value) push.Value

ConvertValue before load

func (OracleDialect) DisableConstraintsStatement

func (d OracleDialect) DisableConstraintsStatement(tableName string) string

DisableConstraintsStatement generate statments to deactivate constraintes

func (OracleDialect) EnableConstraintsStatement

func (d OracleDialect) EnableConstraintsStatement(tableName string) string

EnableConstraintsStatement generate statments to activate constraintes

func (OracleDialect) InsertStatement

func (d OracleDialect) InsertStatement(tableName string, columns []string, values []string, primaryKeys []string) string

InsertStatement generate insert statement

func (OracleDialect) IsDuplicateError

func (d OracleDialect) IsDuplicateError(err error) bool

IsDuplicateError check if error is a duplicate error

func (OracleDialect) Placeholder

func (d OracleDialect) Placeholder(position int) string

Placeholde return the variable format for postgres

func (OracleDialect) TruncateStatement

func (d OracleDialect) TruncateStatement(tableName string) string

TruncateStatement generate statement to truncat table content

func (OracleDialect) UpdateStatement

func (d OracleDialect) UpdateStatement(tableName string, columns []string, uValues []string, primaryKeys []string, pValues []string) (string, []string, *push.Error)

UpdateStatement

type PostgresDataDestinationFactory

type PostgresDataDestinationFactory struct{}

PostgresDataDestinationFactory exposes methods to create new Postgres pullers.

func NewPostgresDataDestinationFactory

func NewPostgresDataDestinationFactory() *PostgresDataDestinationFactory

NewPostgresDataDestinationFactory creates a new postgres datadestination factory.

func (*PostgresDataDestinationFactory) New

New return a Postgres pusher

type PostgresDialect

type PostgresDialect struct{}

PostgresDialect inject postgres variations

func (PostgresDialect) ConvertValue

func (d PostgresDialect) ConvertValue(from push.Value) push.Value

ConvertValue before load

func (PostgresDialect) DisableConstraintsStatement

func (d PostgresDialect) DisableConstraintsStatement(tableName string) string

DisableConstraintsStatement generate statments to deactivate constraintes

func (PostgresDialect) EnableConstraintsStatement

func (d PostgresDialect) EnableConstraintsStatement(tableName string) string

EnableConstraintsStatement generate statments to activate constraintes

func (PostgresDialect) InsertStatement

func (d PostgresDialect) InsertStatement(tableName string, columns []string, values []string, primaryKeys []string) string

InsertStatement generate insert statement

func (PostgresDialect) IsDuplicateError

func (d PostgresDialect) IsDuplicateError(err error) bool

IsDuplicateError check if error is a duplicate error

func (PostgresDialect) Placeholder

func (d PostgresDialect) Placeholder(position int) string

Placeholde return the variable format for postgres

func (PostgresDialect) TruncateStatement

func (d PostgresDialect) TruncateStatement(tableName string) string

TruncateStatement generate statement to truncat table content

func (PostgresDialect) UpdateStatement

func (d PostgresDialect) UpdateStatement(tableName string, columns []string, uValues []string, primaryKeys []string, pValues []string) (string, []string, *push.Error)

type SQLDataDestination

type SQLDataDestination struct {
	// contains filtered or unexported fields
}

SQLDataDestination read data from a SQL database.

func NewSQLDataDestination

func NewSQLDataDestination(url string, schema string, dialect SQLDialect) *SQLDataDestination

NewSQLDataDestination creates a new SQL datadestination.

func (*SQLDataDestination) Close

func (dd *SQLDataDestination) Close() *push.Error

Close SQL connections

func (*SQLDataDestination) Commit

func (dd *SQLDataDestination) Commit() *push.Error

Commit SQL for connection

func (*SQLDataDestination) Open

func (dd *SQLDataDestination) Open(plan push.Plan, mode push.Mode, disableConstraints bool) *push.Error

Open SQL Connection

func (*SQLDataDestination) RowWriter

func (dd *SQLDataDestination) RowWriter(table push.Table) (push.RowWriter, *push.Error)

RowWriter return SQL table writer

type SQLDialect

type SQLDialect interface {
	Placeholder(int) string
	DisableConstraintsStatement(tableName string) string
	EnableConstraintsStatement(tableName string) string
	TruncateStatement(tableName string) string
	InsertStatement(tableName string, columns []string, values []string, primaryKeys []string) string
	UpdateStatement(tableName string, columns []string, uValues []string, primaryKeys []string, pValues []string) (string, []string, *push.Error)
	IsDuplicateError(error) bool
	ConvertValue(push.Value) push.Value
}

SQLDialect is an interface to inject SQL variations

type SQLRowWriter

type SQLRowWriter struct {
	// contains filtered or unexported fields
}

SQLRowWriter write data to a SQL table.

func NewSQLRowWriter

func NewSQLRowWriter(table push.Table, dd *SQLDataDestination) *SQLRowWriter

NewSQLRowWriter creates a new SQL row writer.

func (*SQLRowWriter) Write

func (rw *SQLRowWriter) Write(row push.Row) *push.Error

Write

Jump to

Keyboard shortcuts

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