cassandra

package
v0.0.0-...-0183129 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CassStorage

type CassStorage struct {
	// contains filtered or unexported fields
}

CassStorage implements Storage using Cassandra.

This name stutters because it's convenient to dot-import core, which defines 'Storage'.

func NewStorage

func NewStorage(ctx *Context, config CassandraDBConfig) (*CassStorage, error)

NewStorage creates new Storage implementation based on Cassandra.

The given Nodes should have the form ADDRESS:PORT, where the PORT is the CQL port (normally 9042, I think).

func (*CassStorage) Add

func (s *CassStorage) Add(ctx *Context, loc string, m *Pair) error

func (*CassStorage) Clear

func (s *CassStorage) Clear(ctx *Context, loc string) (int64, error)

func (*CassStorage) Close

func (s *CassStorage) Close(ctx *Context) error

func (*CassStorage) Delete

func (s *CassStorage) Delete(ctx *Context, loc string) error

func (*CassStorage) GetStats

func (s *CassStorage) GetStats(ctx *Context, loc string) (StorageStats, error)

func (*CassStorage) Health

func (s *CassStorage) Health(ctx *Context) error

func (*CassStorage) Load

func (s *CassStorage) Load(ctx *Context, loc string) ([]Pair, error)

func (*CassStorage) Remove

func (s *CassStorage) Remove(ctx *Context, loc string, k []byte) (int64, error)

type CassandraDBConfig

type CassandraDBConfig struct {
	Nodes []string

	Timeout        time.Duration
	BackoffRetries int
	BackoffMin     time.Duration
	BackoffMax     time.Duration
	// contains filtered or unexported fields
}

CassandraDBConfig does what'd you'd think.

This name stutters because it's convenient to dot-import core, which defines 'Storage'.

func ParseConfig

func ParseConfig(config string) (*CassandraDBConfig, error)

ParseConfig generates a CassandraDBConfig from a string. Configuration is parsed from a string of the follow format: host:port,host:port;username;password;keyspace

Jump to

Keyboard shortcuts

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