Documentation ¶
Overview ¶
package clients is a wrapper around grpc clients so clients can work with non protobuf structs and handle unmarshaling
Index ¶
- func DownloadPluginFromGithub(ctx context.Context, localPath string, githubPath string, version string, ...) error
- func WithDestinationLogger(logger zerolog.Logger) func(*DestinationClient)
- func WithSourceLogger(logger zerolog.Logger) func(*SourceClient)
- type DestinationClient
- func (c *DestinationClient) Close() error
- func (c *DestinationClient) GetWaitError() error
- func (c *DestinationClient) Initialize(ctx context.Context, spec specs.Destination) error
- func (c *DestinationClient) Migrate(ctx context.Context, tables []*schema.Table) error
- func (c *DestinationClient) Name(ctx context.Context) (string, error)
- func (c *DestinationClient) Version(ctx context.Context) (string, error)
- func (c *DestinationClient) Write(ctx context.Context, resources <-chan []byte) (uint64, error)
- type DestinationClientOption
- type FetchResultMessage
- type PluginType
- type SourceClient
- func (c *SourceClient) Close() error
- func (c *SourceClient) GetTables(ctx context.Context) ([]*schema.Table, error)
- func (c *SourceClient) GetWaitError() error
- func (c *SourceClient) Name(ctx context.Context) (string, error)
- func (c *SourceClient) Sync(ctx context.Context, spec specs.Source, res chan<- []byte) error
- func (c *SourceClient) Version(ctx context.Context) (string, error)
- type SourceClientOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadPluginFromGithub ¶ added in v0.11.1
func WithDestinationLogger ¶ added in v0.11.1
func WithDestinationLogger(logger zerolog.Logger) func(*DestinationClient)
func WithSourceLogger ¶ added in v0.11.1
func WithSourceLogger(logger zerolog.Logger) func(*SourceClient)
Types ¶
type DestinationClient ¶
type DestinationClient struct {
// contains filtered or unexported fields
}
func NewDestinationClient ¶
func NewDestinationClient(cc grpc.ClientConnInterface) *DestinationClient
func NewManagedDestinationClient ¶ added in v0.11.1
func NewManagedDestinationClient(ctx context.Context, path string, opts ...DestinationClientOption) (*DestinationClient, error)
NewManagedDestinationClient starts a new destination plugin process, connects to it via gRPC server and returns a new DestinationClient
func (*DestinationClient) Close ¶ added in v0.11.1
func (c *DestinationClient) Close() error
Close is used only in conjunction with NewManagedDestinationClient. It closes the connection it created, kills the spawned process and removes the socket file.
func (*DestinationClient) GetWaitError ¶ added in v0.11.1
func (c *DestinationClient) GetWaitError() error
func (*DestinationClient) Initialize ¶ added in v0.0.4
func (c *DestinationClient) Initialize(ctx context.Context, spec specs.Destination) 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)
type DestinationClientOption ¶ added in v0.11.1
type DestinationClientOption func(*DestinationClient)
type FetchResultMessage ¶
type FetchResultMessage struct {
Resource []byte
}
type PluginType ¶ added in v0.11.1
type PluginType string
const ( PluginTypeSource PluginType = "source" PluginTypeDestination PluginType = "destination" )
type SourceClient ¶
type SourceClient struct {
// contains filtered or unexported fields
}
SourceClient
func NewManagedSourceClient ¶ added in v0.11.1
func NewManagedSourceClient(ctx context.Context, path string, opts ...SourceClientOption) (*SourceClient, error)
NewManagedSourceClient starts a new source plugin process, connects to it via gRPC server and returns a new SourceClient
func NewSourceClient ¶
func NewSourceClient(cc grpc.ClientConnInterface) *SourceClient
NewSourceClient connect to gRPC server running source plugin and returns a new SourceClient
func (*SourceClient) Close ¶ added in v0.11.1
func (c *SourceClient) Close() error
Close is used only in conjunetion with NewManagedSourceClient. It closes the connection it created, kills the spawned process and removes the socket file.
func (*SourceClient) GetWaitError ¶ added in v0.11.1
func (c *SourceClient) GetWaitError() 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
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
type SourceClientOption ¶ added in v0.11.1
type SourceClientOption func(*SourceClient)