Documentation
¶
Index ¶
- func PluginTestSuiteRunner(t *testing.T, p *Plugin, spec any, tests PluginTestSuiteTests)
- func SetDestinationManagedCqColumns(tables []*schema.Table)
- type Client
- type ClientResource
- type DefaultReverseTransformer
- type ManagedWriter
- type Metrics
- type NewClientFunc
- type Option
- 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, sourceSpec specs.Source, tables schema.Tables, ...) error
- type PluginTestSuite
- type PluginTestSuiteTests
- type UnimplementedManagedWriter
- type UnimplementedUnmanagedWriter
- type UnmanagedWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PluginTestSuiteRunner ¶
func PluginTestSuiteRunner(t *testing.T, p *Plugin, spec any, tests PluginTestSuiteTests)
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 []any) (schema.CQTypes, error)
Migrate(ctx context.Context, tables schema.Tables) error
Read(ctx context.Context, table *schema.Table, sourceName string, res chan<- []any) error
ManagedWriter
UnmanagedWriter
DeleteStale(ctx context.Context, tables schema.Tables, sourceName string, syncTime time.Time) error
Close(ctx context.Context) error
}
type ClientResource ¶
type DefaultReverseTransformer ¶
type DefaultReverseTransformer struct {
}
func (*DefaultReverseTransformer) ReverseTransformValues ¶
func (*DefaultReverseTransformer) ReverseTransformValues(table *schema.Table, values []any) (schema.CQTypes, error)
DefaultReverseTransformer tries best effort to convert a slice of values to CQTypes based on the provided table columns.
type ManagedWriter ¶ added in v1.13.0
type NewClientFunc ¶
type Option ¶ added in v1.13.0
type Option func(*Plugin)
func WithBatchTimeout ¶ added in v1.13.0
func WithDefaultBatchSize ¶ added in v1.16.0
func WithDefaultBatchSizeBytes ¶ added in v1.23.0
func WithManagedWriter ¶ added in v1.13.1
func WithManagedWriter() Option
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func NewPlugin ¶ added in v1.12.7
func NewPlugin(name string, version string, newClientFunc NewClientFunc, opts ...Option) *Plugin
NewPlugin creates a new destination plugin
func (*Plugin) DeleteStale ¶
func (*Plugin) Migrate ¶
we implement all DestinationClient functions so we can hook into pre-post behavior
type PluginTestSuite ¶ added in v1.13.0
type PluginTestSuite struct {
// contains filtered or unexported fields
}
type PluginTestSuiteTests ¶ added in v1.13.0
type PluginTestSuiteTests 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
// SkipMigrateAppend skips a test for the migrate function where a column is added,
// data is appended, then the column is removed and more data appended, checking that the migrations handle
// this correctly.
SkipMigrateAppend bool
// SkipMigrateAppendForce skips a test for the migrate function where a column is changed in force mode
SkipMigrateAppendForce bool
// SkipMigrateOverwrite skips a test for the migrate function where a column is added,
// data is appended, then the column is removed and more data overwritten, checking that the migrations handle
// this correctly.
SkipMigrateOverwrite bool
// SkipMigrateOverwriteForce skips a test for the migrate function where a column is changed in force mode
SkipMigrateOverwriteForce bool
}
type UnimplementedManagedWriter ¶ added in v1.13.0
type UnimplementedManagedWriter struct{}
func (*UnimplementedManagedWriter) WriteTableBatch ¶ added in v1.13.0
type UnimplementedUnmanagedWriter ¶ added in v1.13.0
type UnimplementedUnmanagedWriter struct{}
func (*UnimplementedUnmanagedWriter) Metrics ¶ added in v1.13.0
func (*UnimplementedUnmanagedWriter) Metrics() Metrics
func (*UnimplementedUnmanagedWriter) Write ¶ added in v1.13.0
func (*UnimplementedUnmanagedWriter) Write(context.Context, schema.Tables, <-chan *ClientResource) error
type UnmanagedWriter ¶ added in v1.13.0
Click to show internal directories.
Click to hide internal directories.