Documentation ¶
Index ¶
- type Client
- func (c *Client) AddE(label string, from, to interface{}) (resp interface{}, err error)
- func (c *Client) AddEById(label string, from, to uuid.UUID) (resp interface{}, err error)
- func (c *Client) AddV(label string, data interface{}) (resp interface{}, err error)
- func (c *Client) Close()
- func (c *Client) Execute(query string, bindings, rebindings map[string]string) (resp interface{}, err error)
- func (c *Client) ExecuteFile(path string, bindings, rebindings map[string]string) (resp interface{}, err error)
- func (c *Client) Get(query string, ptr interface{}) (err error)
- type DialerConfig
- type Pool
- type PooledConnection
- type Ws
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Errored bool // contains filtered or unexported fields }
Client is a container for the gremgo client.
func Dial ¶
Dial returns a gremgo client for interaction with the Gremlin Server specified in the host IP.
func (*Client) AddE ¶
AddE takes a label, from UUID and to UUID then creates a edge between the two vertex in the graph
func (*Client) AddEById ¶
AddEById takes a label, from UUID and to UUID then creates a edge between the two vertex in the graph
func (*Client) Close ¶
func (c *Client) Close()
Close closes the underlying connection and marks the client as closed.
func (*Client) Execute ¶
func (c *Client) Execute(query string, bindings, rebindings map[string]string) (resp interface{}, err error)
Execute formats a raw Gremlin query, sends it to Gremlin Server, and returns the result.
type DialerConfig ¶
type DialerConfig func(*Ws)
DialerConfig is the struct for defining configuration for WebSocket dialer
func SetAuthentication ¶
func SetAuthentication(username string, password string) DialerConfig
SetAuthentication sets on dialer credentials for authentication
func SetPingInterval ¶
func SetPingInterval(seconds int) DialerConfig
SetPingInterval sets the interval of ping sending for know is connection is alive and in consequence the client is connected
func SetReadingWait ¶
func SetReadingWait(seconds int) DialerConfig
SetReadingWait sets the time for waiting that reading occur
func SetWritingWait ¶
func SetWritingWait(seconds int) DialerConfig
SetWritingWait sets the time for waiting that writing occur
type Pool ¶
type Pool struct { Dial func() (*Client, error) MaxActive int IdleTimeout time.Duration // contains filtered or unexported fields }
Pool maintains a list of connections.
func (*Pool) Get ¶
func (p *Pool) Get() (*PooledConnection, error)
Get will return an available pooled connection. Either an idle connection or by dialing a new one if the pool does not currently have a maximum number of active connections.
type PooledConnection ¶
PooledConnection represents a shared and reusable connection.
func (*PooledConnection) Close ¶
func (pc *PooledConnection) Close()
Close signals that the caller is finished with the connection and should be returned to the pool for future use.