destination

package
v1.45.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MPL-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithDirectory

func WithDirectory(directory string) func(*Client)

func WithGrpcConn

func WithGrpcConn(userConn *grpc.ClientConn) func(*Client)

func WithLogger

func WithLogger(logger zerolog.Logger) func(*Client)

func WithNoSentry

func WithNoSentry() func(*Client)

Types

type Client

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

func NewClient

func NewClient(ctx context.Context, registrySpec specs.Registry, path string, version string, opts ...ClientOption) (*Client, error)

func (*Client) Close

func (c *Client) Close(ctx context.Context) error

func (*Client) DeleteStale

func (c *Client) DeleteStale(ctx context.Context, tables schema.Tables, source string, timestamp time.Time) error

func (*Client) GetMetrics

func (c *Client) GetMetrics(ctx context.Context) (*destination.Metrics, error)

func (*Client) GetProtocolVersion

func (c *Client) GetProtocolVersion(ctx context.Context) (uint64, error)

func (*Client) Initialize

func (c *Client) Initialize(ctx context.Context, spec specs.Destination) error

func (*Client) Migrate

func (c *Client) Migrate(ctx context.Context, tables []*schema.Table) error

func (*Client) Name

func (c *Client) Name(ctx context.Context) (string, error)

func (*Client) Terminate

func (c *Client) Terminate() error

Terminate is used only in conjunction with NewManagedClient. It closes the connection it created, kills the spawned process and removes the socket file.

func (*Client) Version

func (c *Client) Version(ctx context.Context) (string, error)

func (*Client) Write

func (c *Client) Write(ctx context.Context, source string, syncTime time.Time, resources <-chan []byte) (uint64, error)

Write writes rows as they are received from the channel to the destination plugin. resources is marshaled schema.Resource. We are not marshalling this inside the function because usually it is already marshalled from the destination plugin.

func (*Client) Write2

func (c *Client) Write2(ctx context.Context, sourceSpec specs.Source, tables schema.Tables, syncTime time.Time, resources <-chan []byte) error

type ClientOption

type ClientOption func(*Client)

Jump to

Keyboard shortcuts

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