Documentation
¶
Index ¶
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.
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 GremlinError ¶
type GremlinError struct {
Attributes interface{} `json:"attributes" omitempty`
Code float64 `json:"code"`
Message string `json:"message"`
}
func (*GremlinError) Error ¶
func (e *GremlinError) Error() string
type GremlinNetworkError ¶
type GremlinNetworkError struct {
Attributes interface{} `json:"attributes" omitempty`
Code int32 `json:"code" omitempty`
Message string `json:"message" omitempty`
ConnStr string `json:"conn_str omitempty`
}
GremlinNetworkError - This returns decorated error with useful information
func (GremlinNetworkError) Error ¶
func (e GremlinNetworkError) Error() string
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.
Source Files
¶
- client.go
- configuration.go
- connection.go
- networkError.go
- pool.go
- request.go
- response.go