client

package
v0.0.0-...-a1fdd15 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JSONSchema string

Functions

func New

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

Types

type Client

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

func (*Client) Close

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

func (*Client) DeleteStale

func (c *Client) DeleteStale(ctx context.Context, msgs message.WriteDeleteStales) error

DeleteStale removes entries from previous syncs

func (*Client) MigrateTables

func (c *Client) MigrateTables(ctx context.Context, msgs message.WriteMigrateTables) error

Migrate creates or updates index templates.

func (*Client) Read

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

func (*Client) Write

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

func (*Client) WriteTableBatch

func (c *Client) WriteTableBatch(ctx context.Context, _ string, msgs message.WriteInserts) error

type Spec

type Spec struct {
	// A list of Elasticsearch nodes to use.
	// Mutually exclusive with `cloud_id`.
	Addresses []string `json:"addresses" jsonschema:"default=http://localhost:9200"`

	// Username for HTTP Basic Authentication.
	Username string `json:"username"`

	// Password for HTTP Basic Authentication.
	Password string `json:"password"`

	// Endpoint for the Elasticsearch Service (https://elastic.co/cloud).
	// Mutually exclusive with `addresses`.
	CloudID string `json:"cloud_id" jsonschema:"example=MyDeployment:abcdefgh"`

	// Base64-encoded token for authorization; if set, overrides username/password and service token.
	APIKey string `json:"api_key"`

	// Service token for authorization; if set, overrides username/password.
	ServiceToken string `json:"service_token"`

	// SHA256 hex fingerprint given by Elasticsearch on first launch.
	CertificateFingerprint string `json:"certificate_fingerprint"`

	// PEM-encoded certificate authorities.
	// When set, an empty certificate pool will be created, and the certificates will be appended to it.
	CACert string `json:"ca_cert"`

	// Number of concurrent worker goroutines to use for indexing. (Default: number of CPUs)
	Concurrency int `json:"concurrency" jsonschema:"minimum=1"`

	// Number of documents to batch together per request.
	BatchSize int `json:"batch_size" jsonschema:"minimum=1,default=1000"`

	// Number of bytes to batch together per request.
	BatchSizeBytes int `json:"batch_size_bytes" jsonschema:"minimum=1,default=5242880"`
}

func (Spec) JSONSchemaExtend

func (Spec) JSONSchemaExtend(sc *jsonschema.Schema)

func (*Spec) SetDefaults

func (s *Spec) SetDefaults()

func (*Spec) Validate

func (*Spec) Validate() error

Directories

Path Synopsis
spec
gen

Jump to

Keyboard shortcuts

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