config

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2018 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 `yaml:"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 `yaml:"username"`
	Password string `yaml:"password"`
}

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

type Configuration

type Configuration struct {
	Servers            []string      `validate:"nonzero"`
	Keyspace           string        `validate:"nonzero"`
	ConnectionsPerHost int           `validate:"min=1" yaml:"connections_per_host"`
	Timeout            time.Duration `validate:"min=500"`
	SocketKeepAlive    time.Duration `validate:"min=0" yaml:"socket_keep_alive"`
	MaxRetryAttempts   int           `validate:"min=0" yaml:"max_retry_attempt"`
	ProtoVersion       int           `yaml:"proto_version"`
	Consistency        string        `yaml:"consistency"`
	Port               int           `yaml:"port"`
	Authenticator      Authenticator `yaml:"authenticator"`
	TLS                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) NewCluster

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

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

type SessionBuilder added in v0.6.0

type SessionBuilder interface {
	NewSession() (cassandra.Session, error)
}

SessionBuilder creates new cassandra.Session

type TLS added in v1.0.0

type TLS struct {
	Enabled                bool
	ServerName             string
	CertPath               string
	KeyPath                string
	CaPath                 string
	EnableHostVerification bool
}

TLS Config

Jump to

Keyboard shortcuts

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