client

package
v0.0.0-...-288f90c 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: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AnonT = gremlingo.T__
View Source
var JSONSchema string

Functions

func New

func New(ctx context.Context, logger zerolog.Logger, spec []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(_ context.Context, msgs message.WriteDeleteStales) error

func (*Client) MigrateTables

Migrate tables. Like neo4j, gremlin does not have a schema, so this is a no-op.

func (*Client) Read

func (c *Client) Read(_ 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, tableName string, msgs message.WriteInserts) error

type Logger

type Logger struct {
	Base zerolog.Logger
}

func (Logger) Log

func (l Logger) Log(verbosity gremlingo.LogVerbosity, v ...any)

func (Logger) Logf

func (l Logger) Logf(verbosity gremlingo.LogVerbosity, format string, v ...any)

type Spec

type Spec struct {
	// Endpoint for the database. Supported schemes are `wss://` and `ws://`, the default port is `8182`.
	Endpoint string `json:"endpoint" jsonschema:"required,pattern=^wss?://[^\n]+$"`

	// Whether to skip TLS verification. Defaults to `false`. This should be set on a macOS environment when connecting to an AWS Neptune endpoint.
	Insecure bool `json:"insecure" jsonschema:"default=false"`

	// Authentication mode to use. `basic` uses static credentials, `aws` uses AWS IAM authentication.
	AuthMode authMode `json:"auth_mode" jsonschema:"default=none"`

	// Username to connect to the database. Required when `auth_mode` is `basic`.
	Username string `json:"username"`

	// Password to connect to the database. Required when `auth_mode` is `basic`.
	Password string `json:"password"`

	// Number of retries on `ConcurrentModificationException` before giving up for each batch.
	// Retries are exponentially backed off.
	MaxRetries int `json:"max_retries" jsonschema:"minimum=1,default=5"`

	// AWS region to use for AWS IAM authentication. Required when `auth_mode` is `aws`.
	AWSRegion string `json:"aws_region" jsonschema:"example=us-east-1"`

	// AWS Neptune host header to use with AWS IAM authentication. Required when `auth_mode` is `aws`.
	AWSNeptuneHost string `json:"aws_neptune_host" jsonschema:"pattern=^[\\w\\.-]+$,example=my-neptune.cluster.us-east-1.neptune.amazonaws.com"`

	// Maximum number of concurrent connections to the database. Defaults to the number of CPUs.
	MaxConcurrentConnections int `json:"max_concurrent_connections" jsonschema:"minimum=1"`

	// Whether to use all Gremlin types or just a basic subset.
	// Should remain `false` for Amazon Neptune compatibility.
	CompleteTypes bool `json:"complete_types" jsonschema:"default=false"`

	// Number of records to batch together before sending to the database.
	BatchSize int `json:"batch_size" jsonschema:"minimum=1,default=200"`

	// Number of bytes (as Arrow buffer size) to batch together before sending to the database.
	BatchSizeBytes int `json:"batch_size_bytes" jsonschema:"minimum=1,default=4194304"`
}

func (Spec) JSONSchemaExtend

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

func (*Spec) SetDefaults

func (s *Spec) SetDefaults()

func (*Spec) Validate

func (s *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