destination

package
v0.0.0-...-a67629d Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigKeyKeyColumn = "keyColumn"

ConfigKeyKeyColumn is a config name for an key column.

Variables

This section is empty.

Functions

func NewDestination

func NewDestination() sdk.Destination

NewDestination creates new instance of the Destination.

Types

type Config

type Config struct {
	config.Config

	// KeyColumn is a column name that is used to detect if the target table already contains the record.
	// Max length is 64, see [MySQL Identifier Length Limits].
	//
	// [MySQL Identifier Length Limits]: https://dev.mysql.com/doc/refman/8.0/en/identifier-length.html
	KeyColumn string `key:"keyColumn" validate:"required,max=64"`
}

Config holds destination specific configurable values.

func ParseConfig

func ParseConfig(cfg map[string]string) (Config, error)

ParseConfig maps the incoming map to the Config and validates it.

type Destination

type Destination struct {
	sdk.UnimplementedDestination
	// contains filtered or unexported fields
}

Destination Vitess Connector persists records to a MySQL database via VTgate instance.

func (*Destination) Configure

func (d *Destination) Configure(_ context.Context, cfg map[string]string) error

Configure parses and initializes the config.

func (*Destination) Open

func (d *Destination) Open(ctx context.Context) error

Open makes sure everything is prepared to receive records.

func (*Destination) Parameters

func (d *Destination) Parameters() map[string]sdk.Parameter

Parameters is a map of named Parameters that describe how to configure the Destination.

func (*Destination) Teardown

func (d *Destination) Teardown(context.Context) error

Teardown gracefully closes connections.

func (*Destination) Write

func (d *Destination) Write(ctx context.Context, records []sdk.Record) (int, error)

Write writes a record into a Destination.

type Writer

type Writer interface {
	Write(ctx context.Context, record sdk.Record) error
	Close() error
}

Writer defines a writer interface needed for the Destination.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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