Documentation
¶
Index ¶
- Variables
- func Dial(conn interfaces.Dialer, errorChannel chan error, options ...clientOption) (*client, error)
- func NewPool(createQueryExecutor QueryExecutorFactoryFunc, maxActiveConnections int, ...) (*pool, error)
- func NewWebsocket(host string, options ...optionWebsocket) (interfaces.Dialer, error)
- func PingInterval(interval time.Duration) clientOption
- func SetAuth(username string, password string) clientOption
- func SetBufferSize(readBufferSize int, writeBufferSize int) optionWebsocket
- func SetReadingWait(wait time.Duration) optionWebsocket
- func SetTimeout(timeout time.Duration) optionWebsocket
- func SetWritingWait(wait time.Duration) optionWebsocket
- type Cosmos
- func (c *Cosmos) Execute(query string) ([]interfaces.Response, error)
- func (c *Cosmos) ExecuteAsync(query string, responseChannel chan interfaces.AsyncResponse) (err error)
- func (c *Cosmos) ExecuteQuery(query interfaces.QueryBuilder) ([]interfaces.Response, error)
- func (c *Cosmos) IsConnected() bool
- func (c *Cosmos) IsHealthy() error
- func (c *Cosmos) Stop() error
- func (c *Cosmos) String() string
- type Metrics
- type Option
- type QueryExecutorFactoryFunc
Constants ¶
This section is empty.
Variables ¶
var MimeType = []byte("application/vnd.gremlin-v2.0+json")
MimeType used for communication with the gremlin server.
Functions ¶
func Dial ¶
func Dial(conn interfaces.Dialer, errorChannel chan error, options ...clientOption) (*client, error)
Dial returns a client for interaction with the Gremlin Server specified in the host IP. The client is already connected.
func NewPool ¶
func NewPool(createQueryExecutor QueryExecutorFactoryFunc, maxActiveConnections int, idleTimeout time.Duration, logger zerolog.Logger) (*pool, error)
NewPool creates a new pool which is a QueryExecutor
func NewWebsocket ¶
func NewWebsocket(host string, options ...optionWebsocket) (interfaces.Dialer, error)
NewWebsocket returns a WebSocket dialer to use when connecting to Gremlin Server
func PingInterval ¶
PingInterval sets the ping interval, which is the interval to send the ping frame to the peer
func SetBufferSize ¶
SetBufferSize sets the read/write buffer size
func SetReadingWait ¶
SetReadingWait sets the time for waiting that reading occur
func SetTimeout ¶
SetTimeout sets the dial handshake timeout
func SetWritingWait ¶
SetWritingWait sets the time for waiting that writing occur
Types ¶
type Cosmos ¶
type Cosmos struct {
// contains filtered or unexported fields
}
Cosmos is a connector that can be used to connect to and interact with a CosmosDB
func (*Cosmos) ExecuteAsync ¶
func (c *Cosmos) ExecuteAsync(query string, responseChannel chan interfaces.AsyncResponse) (err error)
func (*Cosmos) ExecuteQuery ¶
func (c *Cosmos) ExecuteQuery(query interfaces.QueryBuilder) ([]interfaces.Response, error)
func (*Cosmos) IsConnected ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics represents the collection of metrics internally set by the service.
func NewMetrics ¶
NewMetrics returns the metrics collection
type Option ¶
type Option func(*Cosmos)
Option is the struct for defining optional parameters for Cosmos
func ConnectionIdleTimeout ¶
ConnectionIdleTimeout specifies the timeout after which idle connections will be removed from the internal connection pool
func MetricsPrefix ¶
MetricsPrefix can be used to customize the metrics prefix as needed for a specific service. Per default 'gremcos' is used as prefix.
func NumMaxActiveConnections ¶
NumMaxActiveConnections specifies the maximum amount of active connections.
func WithLogger ¶
WithLogger specifies the logger to use
type QueryExecutorFactoryFunc ¶
type QueryExecutorFactoryFunc func() (interfaces.QueryExecutor, error)
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
examples
|
|
test
|
|
mocks/interfaces
Package mock_interfaces is a generated GoMock package.
|
Package mock_interfaces is a generated GoMock package. |
mocks/metrics
Package mock_metrics is a generated GoMock package.
|
Package mock_metrics is a generated GoMock package. |