Documentation ¶
Index ¶
- type Client
- func (c *Client) Close()
- func (c *Client) Execute(query string) (resp []Response, err error)
- func (c *Client) ExecuteFile(path string, bindings, rebindings map[string]string) (resp []Response, err error)
- func (c *Client) ExecuteWithBindings(query string, bindings, rebindings map[string]string) (resp []Response, err error)
- type DialerConfig
- type Pool
- type PooledConnection
- type Response
- type Result
- type Status
- 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) Close ¶
func (c *Client) Close()
Close closes the underlying connection and marks the client as closed.
func (*Client) Execute ¶
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.
type Response ¶
type Response struct { RequestID string `json:"requestId"` Status Status `json:"status"` Result Result `json:"result"` }
Response structs holds the entire response from requests to the gremlin server
type Result ¶
type Result struct { // Query Response Data Data json.RawMessage `json:"data"` Meta map[string]string `json:"meta"` }
Result struct is used to hold properties returned for results from requests to the gremlin server