cluster

package
v1.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 8 Imported by: 8

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL