gremlin

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package gremlin provides access to a Gremlin server.

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeout = errors.New("timeout error")

ErrTimeout is returned when a Gremlin query times out.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Endpoint is the Gremlin Endpoint.
	Endpoint string

	// AuthMode is the authentication mode. Valid values: "plain",
	// "neptune_iam".
	AuthMode string

	// AWSRegion is the AWS region in case of using Neptune.
	AWSRegion string

	// RetryLimit is the number of retries before returning error.
	RetryLimit int

	// RetryDuration is the time to wait between retries.
	RetryDuration time.Duration
}

Config contains the configuration parameters needed to interact with a Gremlin server.

type Connection

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

A Connection handles the connection with the Gremlin server. This includes authentication, reconnections and retries.

func NewConnection

func NewConnection(cfg Config) (Connection, error)

NewConnection creates a Connection with the provided configuration.

func (Connection) Query

func (conn Connection) Query(cf QueryFunc) (results []*gremlingo.Result, err error)

Query executes cf taking care of the authentication, reconnections and retries.

type QueryFunc

type QueryFunc func(*gremlingo.GraphTraversalSource) ([]*gremlingo.Result, error)

QueryFunc represents a Gremlin query in the context of a Connection. It is executed by [Connectino.Query].

Jump to

Keyboard shortcuts

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