Documentation
¶
Index ¶
- func PluginTestSuiteRunner(t *testing.T, p *Plugin, spec interface{}, tests TestSuiteTests)
- func SetDestinationManagedCqColumns(tables []*schema.Table)
- type Client
- type ClientResource
- type DefaultReverseTransformer
- type Metrics
- type NewClientFunc
- type Plugin
- func (p *Plugin) Close(ctx context.Context) error
- func (p *Plugin) DeleteStale(ctx context.Context, tables schema.Tables, sourceName string, ...) error
- func (p *Plugin) Init(ctx context.Context, logger zerolog.Logger, spec specs.Destination) error
- func (p *Plugin) Metrics() Metrics
- func (p *Plugin) Migrate(ctx context.Context, tables schema.Tables) error
- func (p *Plugin) Name() string
- func (p *Plugin) Read(ctx context.Context, table *schema.Table, sourceName string, ...) error
- func (p *Plugin) Version() string
- func (p *Plugin) Write(ctx context.Context, tables schema.Tables, sourceName string, ...) error
- type TestDestinationMemDBClient
- func (c *TestDestinationMemDBClient) Close(context.Context) error
- func (c *TestDestinationMemDBClient) DeleteStale(ctx context.Context, tables schema.Tables, source string, syncTime time.Time) error
- func (c *TestDestinationMemDBClient) Initialize(_ context.Context, spec specs.Destination) error
- func (*TestDestinationMemDBClient) Metrics() Metrics
- func (c *TestDestinationMemDBClient) Migrate(_ context.Context, tables schema.Tables) error
- func (c *TestDestinationMemDBClient) Read(_ context.Context, table *schema.Table, source string, ...) error
- func (*TestDestinationMemDBClient) ReverseTransformValues(_ *schema.Table, values []interface{}) (schema.CQTypes, error)
- func (c *TestDestinationMemDBClient) Write(ctx context.Context, tables schema.Tables, resources <-chan *ClientResource) error
- type TestDestinationOption
- type TestSuite
- type TestSuiteTests
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PluginTestSuiteRunner ¶
func PluginTestSuiteRunner(t *testing.T, p *Plugin, spec interface{}, tests TestSuiteTests)
func SetDestinationManagedCqColumns ¶
Overwrites or adds the CQ columns that are managed by the destination plugins (_cq_sync_time, _cq_source_name).
Types ¶
type Client ¶
type Client interface {
schema.CQTypeTransformer
ReverseTransformValues(table *schema.Table, values []interface{}) (schema.CQTypes, error)
Migrate(ctx context.Context, tables schema.Tables) error
Read(ctx context.Context, table *schema.Table, sourceName string, res chan<- []interface{}) error
Write(ctx context.Context, tables schema.Tables, res <-chan *ClientResource) error
Metrics() Metrics
DeleteStale(ctx context.Context, tables schema.Tables, sourceName string, syncTime time.Time) error
Close(ctx context.Context) error
}
type ClientResource ¶
type ClientResource struct {
TableName string
Data []interface{}
}
type DefaultReverseTransformer ¶
type DefaultReverseTransformer struct {
}
func (*DefaultReverseTransformer) ReverseTransformValues ¶
func (*DefaultReverseTransformer) ReverseTransformValues(table *schema.Table, values []interface{}) (schema.CQTypes, error)
DefaultReverseTransformer tries best effort to convert a slice of values to CQTypes based on the provided table columns.
type NewClientFunc ¶
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func NewPlugin ¶ added in v1.12.7
func NewPlugin(name string, version string, newDestinationClient NewClientFunc) *Plugin
func (*Plugin) DeleteStale ¶
func (*Plugin) Migrate ¶
we implement all DestinationClient functions so we can hook into pre-post behavior
type TestDestinationMemDBClient ¶
type TestDestinationMemDBClient struct {
schema.DefaultTransformer
// contains filtered or unexported fields
}
TestDestinationMemDBClient is mostly used for testing.
func (*TestDestinationMemDBClient) Close ¶
func (c *TestDestinationMemDBClient) Close(context.Context) error
func (*TestDestinationMemDBClient) DeleteStale ¶
func (*TestDestinationMemDBClient) Initialize ¶
func (c *TestDestinationMemDBClient) Initialize(_ context.Context, spec specs.Destination) error
func (*TestDestinationMemDBClient) Metrics ¶
func (*TestDestinationMemDBClient) Metrics() Metrics
func (*TestDestinationMemDBClient) ReverseTransformValues ¶
func (*TestDestinationMemDBClient) Write ¶
func (c *TestDestinationMemDBClient) Write(ctx context.Context, tables schema.Tables, resources <-chan *ClientResource) error
type TestDestinationOption ¶
type TestDestinationOption func(*TestDestinationMemDBClient)
type TestSuiteTests ¶
type TestSuiteTests struct {
// SkipOverwrite skips testing for "overwrite" mode. Use if the destination
// // plugin doesn't support this feature.
SkipOverwrite bool
// SkipDeleteStale skips testing "delete-stale" mode. Use if the destination
// plugin doesn't support this feature.
SkipDeleteStale bool
// SkipAppend skips testing for "append" mode. Use if the destination
// plugin doesn't support this feature.
SkipAppend bool
// SkipSecondAppend skips the second append step in the test.
// This is useful in cases like cloud storage where you can't append to an
// existing object after the file has been closed.
SkipSecondAppend bool
}
Click to show internal directories.
Click to hide internal directories.