keyspaces

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package keyspaces builds the gocql cluster configuration for Amazon Keyspaces: 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. It never dials; the parent package creates the session.

Index

Constants

View Source
const DefaultPort = 9142

DefaultPort is the Keyspaces TLS native-protocol port.

Variables

This section is empty.

Functions

func Endpoint

func Endpoint(region string) string

Endpoint returns the Keyspaces service endpoint host for region.

func New

func New(cfg *Config) (*gocql.ClusterConfig, error)

New 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.

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