config

package
v1.62.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator added in v0.6.0

type Authenticator struct {
	Basic BasicAuthenticator `mapstructure:"basic"`
}

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

type BasicAuthenticator added in v0.6.0

type BasicAuthenticator struct {
	Username              string   `mapstructure:"username"`
	Password              string   `mapstructure:"password" json:"-"`
	AllowedAuthenticators []string `mapstructure:"allowed_authenticators"`
}

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

type Configuration

type Configuration struct {
	Schema     Schema     `mapstructure:"schema"`
	Connection Connection `mapstructure:"connection"`
	Query      Query      `mapstructure:"query"`
}

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

func DefaultConfiguration added in v1.59.0

func DefaultConfiguration() Configuration

func (*Configuration) ApplyDefaults

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

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

func (*Configuration) NewCluster

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

NewCluster creates a new gocql cluster from the configuration

func (*Configuration) NewSession

func (c *Configuration) NewSession() (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 Connection added in v1.62.0

type Connection struct {
	// Servers contains a list of hosts that are used to connect to the cluster.
	Servers []string `mapstructure:"servers" valid:"required,url"`
	// LocalDC contains the name of the local Data Center (DC) for DC-aware host selection
	LocalDC string `mapstructure:"local_dc"`
	// The port used when dialing to a cluster.
	Port int `mapstructure:"port"`
	// DisableAutoDiscovery, if set to true, will disable the cluster's auto-discovery features.
	DisableAutoDiscovery bool `mapstructure:"disable_auto_discovery"`
	// ConnectionsPerHost contains the maximum number of open connections for each host on the cluster.
	ConnectionsPerHost int `mapstructure:"connections_per_host"`
	// ReconnectInterval contains the regular interval after which the driver tries to connect to
	// nodes that are down.
	ReconnectInterval time.Duration `mapstructure:"reconnect_interval"`
	// SocketKeepAlive contains the keep alive period for the default dialer to the cluster.
	SocketKeepAlive time.Duration `mapstructure:"socket_keep_alive"`
	// TLS contains the TLS configuration for the connection to the cluster.
	TLS configtls.ClientConfig `mapstructure:"tls"`
	// Timeout contains the maximum time spent to connect to a cluster.
	Timeout time.Duration `mapstructure:"timeout"`
	// Authenticator contains the details of the authentication mechanism that is used for
	// connecting to a cluster.
	Authenticator Authenticator `mapstructure:"auth"`
	// ProtoVersion contains the version of the native protocol to use when connecting to a cluster.
	ProtoVersion int `mapstructure:"proto_version"`
}

type Query added in v1.62.0

type Query struct {
	// Timeout contains the maximum time spent executing a query.
	Timeout time.Duration `mapstructure:"timeout"`
	// MaxRetryAttempts indicates the maximum number of times a query will be retried for execution.
	MaxRetryAttempts int `mapstructure:"max_retry_attempts"`
	// Consistency specifies the consistency level which needs to be satisified before responding
	// to a query.
	Consistency string `mapstructure:"consistency"`
}

type Schema added in v1.62.0

type Schema struct {
	// Keyspace contains the namespace where Jaeger data will be stored.
	Keyspace string `mapstructure:"keyspace"`
	// DisableCompression, if set to true, disables the use of the default Snappy Compression
	// while connecting to the Cassandra Cluster. This is useful for connecting to clusters, like Azure Cosmos DB,
	// that do not support SnappyCompression.
	DisableCompression bool `mapstructure:"disable_compression"`
}

type SessionBuilder added in v0.6.0

type SessionBuilder interface {
	NewSession() (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