scylladb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingHosts = errors.New("scylladb: hosts is empty")

Functions

This section is empty.

Types

type ClientSession

type ClientSession struct {
	*gocql.Session
}

ClientSession wraps the scylladb session.

func New

func New(opt *Options) (*ClientSession, error)

New creates a scylladb session with the given configuration. Returns ErrMissingHosts if len(opts.Hosts) == 0. The remaining options aren't validaded.

type Options

type Options struct {
	// Hosts can have one of the formats <ip/domain>:<port>
	// or <ip/domain>. The default port is 9042
	Hosts []string

	Username string
	Password string

	// HostConns represents the number
	// of connections per host.
	HostConns int

	// Timeout limits a query or batch execution.
	Timeout time.Duration
	// ConnectTimeout is the available
	// time to stablish a connection.
	ConnectTimeout time.Duration
	// ReconnectInterval represents the interval between
	// each attempt on reconnecting to a known down node.
	ReconnectInterval time.Duration

	// Reconnection specifies a constant try and error reconnection
	// policy to use before trying to mark a host as down.
	Reconnection struct {
		MaxRetries int
		Interval   time.Duration
	}
}

Options contains a subset of CQL options.

Jump to

Keyboard shortcuts

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