Documentation
¶
Overview ¶
Package keyspaces is the Amazon Keyspaces kind of clients/cql: the regional endpoint on port 9142, mandatory TLS with host verification, SigV4 authentication (the AWS SigV4 gocql plugin, credentials from an AWS credentials provider — the default chain, IRSA in-cluster) and DisableInitialHostLookup, per AWS guidance. Cluster builds the configuration without dialing; New dials it through clients/cql/driver.
Index ¶
Constants ¶
const DefaultPort = 9142
DefaultPort is the Keyspaces TLS native-protocol port.
Variables ¶
This section is empty.
Functions ¶
func Cluster ¶
func Cluster(cfg *Config) (*gocql.ClusterConfig, error)
Cluster returns the cluster configuration for cfg, without dialing or loading credentials; a zero port is DefaultPort and a zero timeout keeps the driver's default. A missing region or an unknown consistency is CodeInvalidInput.
func New ¶
func New(cfg *Config) (interfaces.CQLSession, error)
New dials a session on the cluster cfg describes, with no speculative execution (Keyspaces bills each request). An invalid cfg is CodeInvalidInput; a failed dial is CodeUnavailable.
Types ¶
type Config ¶
type Config struct {
// Credentials supplies SigV4 credentials; nil loads the AWS default chain on
// the first credentials refresh, not at construction.
Credentials aws.CredentialsProvider
// Region is the AWS region of the Keyspaces endpoint (required).
Region string
// Keyspace is the keyspace sessions use.
Keyspace string
// Consistency is the default consistency level name (LOCAL_QUORUM for Keyspaces).
Consistency string
// CACertPath, when set, is a PEM CA bundle to trust instead of the system pool.
CACertPath string
// Timeout bounds each request.
Timeout time.Duration
// ConnectTimeout bounds each connection attempt.
ConnectTimeout time.Duration
// Port is the TLS native-protocol port (0 = DefaultPort).
Port int
// PageSize is the default page size of a query.
PageSize int
// NumConns is the number of connections per host.
NumConns int
}
Config is the Amazon Keyspaces connection configuration.