source

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: 25 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 WithGRPCConnection

func WithGRPCConnection(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
}

Client

func NewClient

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

NewClient connect to gRPC server running source plugin and returns a new Client

func (*Client) GetMetrics

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

func (*Client) GetProtocolVersion

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

func (*Client) GetSyncSummary

func (c *Client) GetSyncSummary(ctx context.Context) (*schema.SyncSummary, error)

func (*Client) GetTables

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

func (*Client) GetTablesForSpec

func (c *Client) GetTablesForSpec(ctx context.Context, spec *specs.Source) ([]*schema.Table, error)

func (*Client) Name

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

func (*Client) Sync

func (c *Client) 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 source plugin

func (*Client) Sync2

func (c *Client) Sync2(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 source plugin

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)

type ClientOption

type ClientOption func(*Client)

type FetchResultMessage

type FetchResultMessage struct {
	Resource []byte
}

Jump to

Keyboard shortcuts

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