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
- 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 interface { // ExecuteQuery executes the given query and returns the according responses from the CosmosDB ExecuteQuery(query interfaces.QueryBuilder) ([]interfaces.Response, error) // Execute can be used to execute a raw query (string). This can be used to issue queries that are not yet supported by the QueryBuilder. Execute(query string) ([]interfaces.Response, error) // ExecuteAsync can be used to issue a query and streaming in the responses as they are available / are provided by the CosmosDB ExecuteAsync(query string, responseChannel chan interfaces.AsyncResponse) (err error) // IsConnected returns true in case the connection to the CosmosDB is up, false otherwise. IsConnected() bool // Stop stops the connector, terminates all background go routines and closes open connections. Stop() error // String String() string // IsHealthy returns nil in case the connection to the CosmosDB is up, the according error otherwise. IsHealthy() error }
Cosmos is an abstraction of the CosmosDB
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(*cosmosImpl)
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. |