keyspaces

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 11 Imported by: 0

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

View Source
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 Endpoint

func Endpoint(region string) string

Endpoint returns the Keyspaces service endpoint host for region.

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.

Jump to

Keyboard shortcuts

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