gdbclient

package
v0.0.0-...-0bd2a67 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(logger *zap.Logger)

Types

type Client

type Client interface {
	ClientShell

	Close()
}

session-less client support submit in sync or async, all in auto-transaction

func NewClient

func NewClient(settings *Settings) Client

type ClientShell

type ClientShell interface {
	SubmitScript(gremlin string) ([]Result, error)
	SubmitScriptBound(gremlin string, bindings map[string]interface{}) ([]Result, error)
	SubmitScriptOptions(gremlin string, options *graph.RequestOptions) ([]Result, error)

	SubmitScriptAsync(gremlin string) (ResultSetFuture, error)
	SubmitScriptBoundAsync(gremlin string, bindings map[string]interface{}) (ResultSetFuture, error)
	SubmitScriptOptionsAsync(gremlin string, options *graph.RequestOptions) (ResultSetFuture, error)
}

client shell for submit serial API

type Result

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

func (*Result) GetBool

func (r *Result) GetBool() bool

func (*Result) GetDouble

func (r *Result) GetDouble() float64

func (*Result) GetEdge

func (r *Result) GetEdge() graph.Edge

func (*Result) GetFloat

func (r *Result) GetFloat() float32

func (*Result) GetInt32

func (r *Result) GetInt32() int32

func (*Result) GetInt64

func (r *Result) GetInt64() int64

func (*Result) GetInt8

func (r *Result) GetInt8() int8

func (*Result) GetList

func (r *Result) GetList() []interface{}

func (*Result) GetMap

func (r *Result) GetMap() map[interface{}]interface{}

func (*Result) GetObject

func (r *Result) GetObject() interface{}

func (*Result) GetPath

func (r *Result) GetPath() *graph.DetachedPath

func (*Result) GetProperty

func (r *Result) GetProperty() graph.Property

func (*Result) GetString

func (r *Result) GetString() string

func (*Result) GetVertex

func (r *Result) GetVertex() graph.Vertex

func (*Result) GetVertexProperty

func (r *Result) GetVertexProperty() graph.VertexProperty

func (*Result) SetValue

func (r *Result) SetValue(value interface{})

type ResultSetFuture

type ResultSetFuture interface {
	IsCompleted() bool

	GetResults() ([]Result, error)

	GetResultsOrTimeout(timeout time.Duration) ([]Result, bool, error)
}

func NewResultSetFuture

func NewResultSetFuture(future *graphsonv3.ResponseFuture) ResultSetFuture

type SessionClient

type SessionClient interface {
	BatchSubmit(func(ClientShell) error) error

	Close()
}

session client support batch submit

func NewSessionClient

func NewSessionClient(sessionId string, settings *Settings) SessionClient

type Settings

type Settings struct {
	// port of GDB to connect, default is 8182
	Port int
	// host that the driver will connect to, default is 'localhost'
	Host string
	// username and password for GDB auth
	Username, Password string
	// serializer for the driver of request to GDB and response from
	Serializer string
	// manageTransaction by user client or not in session
	IsManageTransaction bool

	// maximum number of socket connections, Default is 8
	PoolSize int
	// Amount of time client waits for connection if all connections
	// are busy before returning an error.
	// Default is ReadTimeout + 1 second.
	PoolTimeout time.Duration
	// Frequency of WebSocket ping checks, Default is 1 minute
	PingInterval time.Duration
	// max concurrent request pending on one connection, Default is 4
	MaxConcurrentRequest int
	// Amount of time client waits connection io write before returning an error.
	// Default is 5 second
	WriteTimeout time.Duration
	// Amount of time client waits connection io read before returning an error.
	// Default is the same with WriteTimeout
	ReadTimeout time.Duration
	// Interval of time to check connection health status in pool, new connection will be
	// created if someone broken in pool
	// Default is 1min, set minus value will disable it
	AliveCheckInterval time.Duration

	// deprecated
	MinIdleConns int
	// deprecated
	IdleTimeout time.Duration
	// deprecated
	IdleCheckFrequency time.Duration
	// deprecated
	MaxConnAge time.Duration
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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