Documentation
¶
Index ¶
- Constants
- func New() sdk.Source
- type Config
- type Iterator
- type Source
- func (s *Source) Ack(ctx context.Context, p sdk.Position) error
- func (s *Source) Configure(_ context.Context, cfg map[string]string) error
- func (s *Source) Open(ctx context.Context, rp sdk.Position) error
- func (s *Source) Parameters() map[string]sdk.Parameter
- func (s *Source) Read(ctx context.Context) (sdk.Record, error)
- func (s *Source) Teardown(ctx context.Context) error
Constants ¶
View Source
const ( // KeyOrderingColumn is a config name for an ordering column. KeyOrderingColumn = "orderingColumn" // KeyColumns is a config name for columns. KeyColumns = "columns" // KeyBatchSize is a config name for a batch size. KeyBatchSize = "batchSize" // KeyPrimaryKey is column name that records should use for their `Key` fields. KeyPrimaryKey string = "primaryKey" // KeySnapshot is a config name for snapshotMode. KeySnapshot = "snapshot" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
config.Config
// OrderingColumn is a name of a column that the connector will use for ordering rows.
OrderingColumn string `json:"orderingColumn" validate:"required"`
// Columns list of column names that should be included in each Record's payload.
Columns []string `json:"columns"`
// BatchSize is the size of rows batch.
BatchSize int `json:"batchSize" default:"1000" validate:"gt=1,lt=100000"`
// Key - Column name that records should use for their `Key` fields.
Key string `json:"primaryKey"`
// Snapshot whether the plugin will take a snapshot of the entire table before starting cdc.
Snapshot bool `default:"true"`
}
Config holds source specific configurable values.
type Iterator ¶
type Iterator interface {
HasNext(ctx context.Context) (bool, error)
Next(ctx context.Context) (sdk.Record, error)
Stop(ctx context.Context) error
Ack(ctx context.Context, rp sdk.Position) error
}
Iterator interface.
type Source ¶
type Source struct {
sdk.UnimplementedSource
// contains filtered or unexported fields
}
Source connector.
func (*Source) Configure ¶
Configure parses and stores configurations, returns an error in case of invalid configuration.
func (*Source) Parameters ¶
Parameters returns a map of named sdk.Parameters that describe how to configure the Source.
Click to show internal directories.
Click to hide internal directories.