client

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Unlicense Imports: 24 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireAWSWebIdentityToken

func AcquireAWSWebIdentityToken() (string, error)

AcquireAWSWebIdentityToken reads an EKS/IRSA web identity JWT from AWS_WEB_IDENTITY_TOKEN_FILE.

func AcquireGoogleIDToken

func AcquireGoogleIDToken(ctx context.Context, audience string) (string, error)

AcquireGoogleIDToken fetches a Google Cloud IAM identity token from the GCE metadata server for the requested audience.

Types

type ClientConfig

type ClientConfig struct {
	Addr     string
	APIKey   string
	TenantID string
	TLS      security.TLSConfig
}

ClientConfig configures security and tenant headers for SmartClient.

type ErrForwardRequired

type ErrForwardRequired struct {
	TargetNodeID string
	TargetAddr   string
}

ErrForwardRequired is returned when a request needs to be routed to another node

func IsForwardRequired

func IsForwardRequired(err error) *ErrForwardRequired

IsForwardRequired checks if an error is a "FORWARD_REQUIRED" error If success, returns the parsed error struct, otherwise nil

func (*ErrForwardRequired) Error

func (e *ErrForwardRequired) Error() string

type SmartClient

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

SmartClient is a wrapper around flight.Client that handles strict sharding redirects

func NewSmartClient

func NewSmartClient(addr string) (*SmartClient, error)

NewSmartClient creates a new smart client connected to the initial address

func NewSmartClientWithConfig

func NewSmartClientWithConfig(cfg ClientConfig) (*SmartClient, error)

NewSmartClientWithConfig creates a SmartClient with optional TLS/mTLS, API key, and tenant context.

func (*SmartClient) Close

func (c *SmartClient) Close() error

Close closes all active connections

func (*SmartClient) DoAction

DoAction performs a Flight DoAction with automatic redirection handling

func (*SmartClient) DoGet

DoGet performs a Flight DoGet with automatic redirection handling

func (*SmartClient) DoPut

DoPut performs a Flight DoPut with automatic redirection handling (best-effort)

func (*SmartClient) ExchangeOIDCToken

func (c *SmartClient) ExchangeOIDCToken(ctx context.Context, oidcToken string, ttl time.Duration) (string, error)

ExchangeOIDCToken exchanges a federated OIDC JWT for a short-lived Longbow session token via the ExchangeOIDCToken Flight action and updates SmartClient's active bearer credential.

func (*SmartClient) GetFlightInfo

func (c *SmartClient) GetFlightInfo(ctx context.Context, desc *flight.FlightDescriptor) (*flight.FlightInfo, error)

GetFlightInfo gets flight info with redirect handling

func (*SmartClient) GetLastLoadHints

func (c *SmartClient) GetLastLoadHints() *loadbalancing.LoadHints

GetLastLoadHints returns the latest load balancing hints received from the server.

func (*SmartClient) NewStreamUploader

func (c *SmartClient) NewStreamUploader(ctx context.Context, dataset string, schema *arrow.Schema) (*StreamUploader, error)

NewStreamUploader creates a stream uploader for streaming Arrow record batches/chunks into Longbow.

func (*SmartClient) SetAPIKey

func (c *SmartClient) SetAPIKey(token string)

SetAPIKey updates the bearer token / API key used by WithAuthContext.

func (*SmartClient) UploadTable

func (c *SmartClient) UploadTable(ctx context.Context, dataset string, tbl arrow.Table, chunkSize int64) error

UploadTable streams an arrow.Table in chunks (default 10,000 rows per chunk) to Longbow.

func (*SmartClient) WithAuthContext

func (c *SmartClient) WithAuthContext(ctx context.Context) context.Context

WithAuthContext attaches Bearer API key and optional tenant header to an outgoing RPC context.

type StreamUploader

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

StreamUploader handles streaming chunk uploads over Flight DoPut. It sends chunks of Arrow RecordBatches sequentially across the stream, avoiding huge memory spikes on either client or server.

func (*StreamUploader) Close

func (u *StreamUploader) Close() error

Close closes the stream writer and completes the Flight DoPut exchange.

func (*StreamUploader) Write

func (u *StreamUploader) Write(record arrow.RecordBatch) error

Write writes a single Arrow record batch to the upload stream.

func (*StreamUploader) WriteChunked

func (u *StreamUploader) WriteChunked(record arrow.RecordBatch, maxChunkSize int64) error

WriteChunked writes a record batch, automatically splitting it into smaller chunks if it exceeds maxChunkSize.

Jump to

Keyboard shortcuts

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