Documentation ¶
Overview ¶
Package cluster implements a driver.Connection that provides cluster failover support (it is not intended to be used directly).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConnection ¶
func NewConnection(config ConnectionConfig, connectionBuilder ServerConnectionBuilder, endpoints []string) (driver.Connection, error)
NewConnection creates a new cluster connection to a cluster of servers. The given connections are existing connections to each of the servers.
Types ¶
type ConnectionConfig ¶
type ConnectionConfig struct { // DefaultTimeout is the timeout used by requests that have no timeout set in the given context. DefaultTimeout time.Duration }
ConnectionConfig provides all configuration options for a cluster connection.
type ServerConnectionBuilder ¶
type ServerConnectionBuilder func(endpoint string) (driver.Connection, error)
ServerConnectionBuilder specifies a function called by the cluster connection when it needs to create an underlying connection to a specific endpoint.
Click to show internal directories.
Click to hide internal directories.