Documentation

Index

Constants

This section is empty.

Variables

var (
	// DefaultDialer is a dialer with all fields set to the default values.
	DefaultDialer = &Dialer{
		Dialer: websocket.Dialer{
			Proxy:            http.ProxyFromEnvironment,
			HandshakeTimeout: 5 * time.Second,
			WriteBufferSize:  8192,
			ReadBufferSize:   8192,
		},
	}

	// ErrConnClosed is returned by the Conns Execute method when
	// the underlying gremlin server connection is closed.
	ErrConnClosed = errors.New("gremlin: server connection closed")

	// ErrDuplicateRequest is returned by the Conns Execute method on
	// request identifier key collision.
	ErrDuplicateRequest = errors.New("gremlin: duplicate request")
)

Functions

This section is empty.

Types

type Conn

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

Conn performs operations on a gremlin server.

func (*Conn) Close

func (c *Conn) Close() error

Close connection with a Gremlin server.

func (*Conn) Execute

func (c *Conn) Execute(ctx context.Context, req *gremlin.Request) (*gremlin.Response, error)

Execute executes a request against a Gremlin server.

type Dialer

type Dialer struct {
	// Underlying websocket dialer.
	websocket.Dialer
	// contains filtered or unexported fields
}

A Dialer contains options for connecting to Gremlin server.

func (*Dialer) Dial

func (d *Dialer) Dial(uri string) (*Conn, error)

Dial creates a new connection by calling DialContext with a background context.

func (*Dialer) DialContext

func (d *Dialer) DialContext(ctx context.Context, uri string) (*Conn, error)

DialContext creates a new Gremlin connection.

Source Files