Documentation ¶
Index ¶
- type AsyncResponse
- type Client
- func (c *Client) Close()
- func (c *Client) CommitSession(sessionID string) (resp []*Response, err error)
- func (c *Client) Execute(query string) (resp []*Response, err error)
- func (c *Client) ExecuteAsync(query string, responseChannel chan AsyncResponse) (err error)
- func (c *Client) ExecuteFile(path string) (resp []*Response, err error)
- func (c *Client) ExecuteFileWithBindings(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)
- func (c *Client) ExecuteWithSession(query string, sessionID string) (resp []*Response, err error)
- func (c *Client) ExecuteWithSessionAndTimeout(query string, sessionID string, timeout int) (resp []*Response, err error)
- type DialerConfig
- func SetAuthentication(username string, password string) DialerConfig
- func SetBufferSize(readBufferSize int, writeBufferSize int) DialerConfig
- func SetPingInterval(seconds int) DialerConfig
- func SetReadingWait(seconds int) DialerConfig
- func SetTimeout(seconds int) DialerConfig
- func SetWritingWait(seconds int) DialerConfig
- type Edge
- type EdgeProperty
- type EdgePropertyValue
- type EdgeValue
- type NeptuneSubGraph
- type Response
- type Result
- type Status
- type Vertex
- type VertexProperty
- type VertexPropertyValue
- type VertexValue
- type Ws
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncResponse ¶
type AsyncResponse struct { Response Response `json:"response"` //Partial Response object ErrorMessage string `json:"errorMessage"` // Error message if there was an error }
AsyncResponse structs holds the entire response from requests to the gremlin server
type Client ¶
Client is a container for the gremtune client.
func Dial ¶
Dial returns a gremtune 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) CommitSession ¶
CommitSession formats a raw Gremlin query, closes the session, and then the transaction will be commited
func (*Client) Execute ¶
Execute formats a raw Gremlin query, sends it to Gremlin Server, and returns the result.
func (*Client) ExecuteAsync ¶
func (c *Client) ExecuteAsync(query string, responseChannel chan AsyncResponse) (err error)
ExecuteAsync formats a raw Gremlin query, sends it to Gremlin Server, and the results are streamed to channel provided in method paramater.
func (*Client) ExecuteFile ¶
ExecuteFile takes a file path to a Gremlin script, sends it to Gremlin Server, and returns the result.
func (*Client) ExecuteFileWithBindings ¶
func (c *Client) ExecuteFileWithBindings(path string, bindings, rebindings map[string]string) (resp []*Response, err error)
ExecuteFileWithBindings takes a file path to a Gremlin script, sends it to Gremlin Server with bindings, and returns the result.
func (*Client) ExecuteWithBindings ¶
func (c *Client) ExecuteWithBindings(query string, bindings, rebindings map[string]string) (resp []*Response, err error)
ExecuteWithBindings formats a raw Gremlin query, sends it to Gremlin Server, and returns the result.
func (*Client) ExecuteWithSession ¶
ExecuteWithSession formats a raw Gremlin query as part of a session, 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 SetBufferSize ¶
func SetBufferSize(readBufferSize int, writeBufferSize int) DialerConfig
SetBufferSize sets the read/write buffer size
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 EdgeProperty ¶
type EdgeProperty struct {
Properties map[string]EdgePropertyValue
}
EdgeProperty represents an edge property
type EdgePropertyValue ¶
type EdgePropertyValue struct { Type string `json:"@type"` Value map[string]string `json:"@value"` }
Group struct
type EdgeValue ¶
type EdgeValue struct { ID string Label string InV string OutV string InVLabel string OutVLabel string Properties EdgeProperty }
EdgeValue represents a vertex value
type NeptuneSubGraph ¶
type NeptuneSubGraph struct { Value []struct { Value struct { Vertices []Vertex `json:"vertices,omitempty"` Edges []Edge `json:"edges,omitempty"` } `json:"@value,omitempty"` } `json:"@value,omitempty"` }
NeptuneSubGraph having the subgraph response from neptune
func (*NeptuneSubGraph) CountEdges ¶
func (subgraph *NeptuneSubGraph) CountEdges() int
CountEdges returns the number of Edges in the SubGraph
func (*NeptuneSubGraph) CountVertices ¶
func (subgraph *NeptuneSubGraph) CountVertices() int64
CountVertices returns the number of Edges in the SubGraph
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 NeptuneSubGraph `json:"data"` Meta map[string]interface{} `json:"meta"` }
Result struct is used to hold properties returned for results from requests to the gremlin server
type Status ¶
type Status struct { Message string `json:"message"` Code int `json:"code"` Attributes map[string]interface{} `json:"attributes"` }
Status struct is used to hold properties returned from requests to the gremlin server
type Vertex ¶
type Vertex struct { Type string `json:"@type"` Value VertexValue `json:"@value"` }
Vertex represents a vertex returned by the graph database
type VertexProperty ¶
type VertexProperty struct {
Value VertexPropertyValue `json:"@value"`
}
VertexProperty represents a vertex property
type VertexPropertyValue ¶
type VertexPropertyValue struct {
Value interface{} `json:"value"`
}
VertexPropertyValue represents a property value
type VertexValue ¶
type VertexValue struct { ID string Label string Properties map[string][]VertexProperty }
VertexValue represents a vertex value
type Ws ¶
Ws is the dialer for a WebSocket connection
func NewDialer ¶
func NewDialer(host string, configs ...DialerConfig) (dialer *Ws)
NewDialer returns a WebSocket dialer to use when connecting to Gremlin Server
func (*Ws) IsConnected ¶
IsConnected returns whether the underlying websocket is connected
func (*Ws) IsDisposed ¶
IsDisposed returns whether the underlying websocket is disposed