scylladbh

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2020 License: MIT Imports: 5 Imported by: 0

README

scylladbh

A scylla database connector helper. This library was made to help configure the gocql or gocqlx libraries.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNullConf - raised when the configuration is null
	ErrNullConf error = fmt.Errorf("configuration is null")

	// ErrNoNodes - raised when there are no nodes configured
	ErrNoNodes error = fmt.Errorf("no nodes configured")
)

Functions

func NewDockerSession added in v1.1.0

func NewDockerSession(configuration *Configuration, dockerInspectIPPath string) (*gocql.Session, error)

NewDockerSession - connects to a scylla cluster in docker (use nodes parameter to name the pods)

func NewDockerSessionX added in v1.1.0

func NewDockerSessionX(configuration *Configuration, dockerInspectIPPath string) (*gocqlx.Session, error)

NewDockerSessionX - connects to a scylla cluster in docker (use nodes parameter to name the pods)

func NewSession

func NewSession(configuration *Configuration) (*gocql.Session, error)

NewSession - creates a new session using gocql

func NewSessionX

func NewSessionX(configuration *Configuration) (*gocqlx.Session, error)

NewSessionX - creates a new session using gocqlx

Types

type Configuration

type Configuration struct {
	Nodes             []string       `json:"nodes,omitempty"`
	Port              int            `json:"port,omitempty"`
	NumConnections    int            `json:"numConnections,omitempty"`
	ReconnectInterval funks.Duration `json:"reconnectInterval,omitempty"`
	Keyspace          string         `json:"keyspace,omitempty"`
	Username          string         `json:"username,omitempty"`
	Password          string         `json:"password,omitempty"`
	ProtoVersion      int            `json:"protoVersion,omitempty"`
	Timeout           funks.Duration `json:"timeout,omitempty"`
	Consistency       Consistency    `json:"consistency,omitempty"`
}

Configuration - the connection configuration

type Consistency added in v1.1.3

type Consistency string

Consistency - the consistency wrapper

const (
	// Any - scylladb consistency
	Any Consistency = "any"
	// One - scylladb consistency
	One Consistency = "one"
	// Two - scylladb consistency
	Two Consistency = "two"
	// Three - scylladb consistency
	Three Consistency = "three"
	// Quorum - scylladb consistency
	Quorum Consistency = "quorum"
	// All - scylladb consistency
	All Consistency = "all"
	// LocalQuorum - scylladb consistency
	LocalQuorum Consistency = "localQuorum"
	// EachQuorum - scylladb consistency
	EachQuorum Consistency = "eachQuorum"
	// LocalOne - scylladb consistency
	LocalOne Consistency = "localOne"
)

Jump to

Keyboard shortcuts

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