client

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, logger zerolog.Logger, specBytes []byte, opts plugin.NewClientOptions) (plugin.Client, error)

New creates a new Apache Arrow destination client

Types

type AuthHandler

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

AuthHandler is a simple auth handler that sends a token and reads a token

func NewAuthHandler

func NewAuthHandler(handshake, token string) *AuthHandler

NewAuthHandler creates a new auth handler

func (*AuthHandler) Authenticate

func (c *AuthHandler) Authenticate(_ context.Context, conn flight.AuthConn) error

Authenticate sends the auth token and reads the token

func (*AuthHandler) GetToken

func (c *AuthHandler) GetToken(context.Context) (string, error)

GetToken returns the token

type Client

type Client struct {
	plugin.UnimplementedSource
	// contains filtered or unexported fields
}

Client is the client for the Apache Arrow destination

func (*Client) Close

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

Close is called when the client is closed

func (*Client) DeleteRecord

func (c *Client) DeleteRecord(ctx context.Context, msg *message.WriteDeleteRecord) error

DeleteRecord is called when a record is deleted

func (*Client) DeleteStale

func (c *Client) DeleteStale(ctx context.Context, msg *message.WriteDeleteStale) error

DeleteStale is called when a record is deleted

func (*Client) Insert

func (c *Client) Insert(ctx context.Context, msg *message.WriteInsert) error

Insert is called when a record is inserted

func (*Client) MigrateTable

func (c *Client) MigrateTable(ctx context.Context, msg *message.WriteMigrateTable) error

MigrateTable is called when a table is created or updated

func (*Client) Read

func (c *Client) Read(ctx context.Context, table *schema.Table, res chan<- arrow.Record) error

Read is called when a table is read

func (*Client) Write

func (c *Client) Write(ctx context.Context, messages <-chan message.WriteMessage) error

Write receives messages from the plugin and writes them to the destination

type Spec

type Spec struct {
	Addr      string `json:"addr,omitempty"`
	Handshake string `json:"handshake,omitempty"`
	Token     string `json:"token,omitempty"`

	CloseTimeout configtype.Duration `json:"close_timeout,omitempty"`

	MaxCallRecvMsgSize *int `json:"max_call_recv_msg_size,omitempty"`
	MaxCallSendMsgSize *int `json:"max_call_send_msg_size,omitempty"`

	TlsEnabled            bool   `json:"tls_enabled,omitempty"`
	TlsServerName         string `json:"tls_server_name,omitempty"`
	TlsInsecureSkipVerify bool   `json:"tls_insecure_skip_verify,omitempty"`
}

Spec is the configuration for the Arrow Flight client.

func (*Spec) SetDefaults added in v1.0.3

func (s *Spec) SetDefaults()

Jump to

Keyboard shortcuts

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