v1.58.1 Latest Latest

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

Go to latest
Published: Jun 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 70




This section is empty.


This section is empty.


This section is empty.


type Authenticator added in v0.6.0

type Authenticator struct {
	Basic BasicAuthenticator `yaml:"basic" mapstructure:",squash"`

Authenticator holds the authentication properties needed to connect to a Cassandra cluster

type BasicAuthenticator added in v0.6.0

type BasicAuthenticator struct {
	Username string `yaml:"username" mapstructure:"username"`
	Password string `yaml:"password" mapstructure:"password" json:"-"`

BasicAuthenticator holds the username and password for a password authenticator for a Cassandra cluster

type Configuration

type Configuration struct {
	Servers              []string       `valid:"required,url" mapstructure:"servers"`
	Keyspace             string         `mapstructure:"keyspace"`
	LocalDC              string         `mapstructure:"local_dc"`
	ConnectionsPerHost   int            `mapstructure:"connections_per_host"`
	Timeout              time.Duration  `mapstructure:"-"`
	ConnectTimeout       time.Duration  `mapstructure:"connection_timeout"`
	ReconnectInterval    time.Duration  `mapstructure:"reconnect_interval"`
	SocketKeepAlive      time.Duration  `mapstructure:"socket_keep_alive"`
	MaxRetryAttempts     int            `mapstructure:"max_retry_attempts"`
	ProtoVersion         int            `mapstructure:"proto_version"`
	Consistency          string         `mapstructure:"consistency"`
	DisableCompression   bool           `mapstructure:"disable_compression"`
	Port                 int            `mapstructure:"port"`
	Authenticator        Authenticator  `mapstructure:",squash"`
	DisableAutoDiscovery bool           `mapstructure:"-"`
	TLS                  tlscfg.Options `mapstructure:"tls"`

Configuration describes the configuration properties needed to connect to a Cassandra cluster

func (*Configuration) ApplyDefaults

func (c *Configuration) ApplyDefaults(source *Configuration)

ApplyDefaults copies settings from source unless its own value is non-zero.

func (*Configuration) Close added in v1.47.0

func (c *Configuration) Close() error

func (*Configuration) NewCluster

func (c *Configuration) NewCluster(logger *zap.Logger) (*gocql.ClusterConfig, error)

NewCluster creates a new gocql cluster from the configuration

func (*Configuration) NewSession

func (c *Configuration) NewSession(logger *zap.Logger) (cassandra.Session, error)

NewSession creates a new Cassandra session

func (*Configuration) String

func (c *Configuration) String() string

func (*Configuration) Validate added in v1.56.0

func (c *Configuration) Validate() error

type SessionBuilder added in v0.6.0

type SessionBuilder interface {
	NewSession(logger *zap.Logger) (cassandra.Session, error)

SessionBuilder creates new cassandra.Session

Jump to

Keyboard shortcuts

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