clients

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

package clients is a wrapper around grpc clients so clients can work with non protobuf structs and handle unmarshaling

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DestinationClient

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

func NewDestinationClient

func NewDestinationClient(cc grpc.ClientConnInterface) *DestinationClient

func (*DestinationClient) Initialize added in v0.0.4

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

func (*DestinationClient) Migrate added in v0.0.4

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

func (*DestinationClient) Name added in v0.0.10

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

func (*DestinationClient) Version added in v0.0.10

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

func (*DestinationClient) Write added in v0.0.4

func (c *DestinationClient) Write(ctx context.Context, 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 alreadun marshalled from the source plugin.

type FetchResultMessage

type FetchResultMessage struct {
	Resource []byte
}

type SourceClient

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

SourceClient

func NewSourceClient

func NewSourceClient(cc grpc.ClientConnInterface) *SourceClient

func (*SourceClient) GetTables

func (c *SourceClient) GetTables(ctx context.Context) ([]*schema.Table, error)

func (*SourceClient) Name added in v0.0.10

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

func (*SourceClient) Sync added in v0.0.4

func (c *SourceClient) Sync(ctx context.Context, spec specs.Source, res chan<- []byte) error

Sync start syncing for the source client per the given spec and returning the results in the given channel. res is marshaled schema.Resource. We are not unmarshalling this for performance reasons as usually this is sent over-the-wire anyway to a destination plugin

func (*SourceClient) Version added in v0.0.10

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

Jump to

Keyboard shortcuts

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