cassandra

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Yugabyte = "yugabyte"
)

Variables

This section is empty.

Functions

func ProvideCassandra

func ProvideCassandra(unmarshaller config.Unmarshaller, metricsIn metric.Measures, lc fx.Lifecycle, logger log.Logger) (store.S, error)

Types

type CassandraClient

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

func CreateCassandraClient

func CreateCassandraClient(config CassandraConfig, measures metric.Measures, logger log.Logger) (*CassandraClient, error)

func (*CassandraClient) Close

func (s *CassandraClient) Close()

func (*CassandraClient) Delete

func (s *CassandraClient) Delete(key model.Key) (store.OwnableItem, error)

func (*CassandraClient) Get

func (*CassandraClient) GetAll

func (s *CassandraClient) GetAll(bucket string) (map[string]store.OwnableItem, error)

func (*CassandraClient) Ping

func (s *CassandraClient) Ping() error

Ping is for pinging the database to verify that the connection is still good.

func (*CassandraClient) Push

func (s *CassandraClient) Push(key model.Key, item store.OwnableItem) error

type CassandraConfig

type CassandraConfig struct {
	// Hosts to  connect to. Must have at least one
	Hosts []string

	// Database aka Keyspace for cassandra
	Database string

	// OpTimeout
	OpTimeout time.Duration

	// SSLRootCert used for enabling tls to the cluster. SSLKey, and SSLCert must also be set.
	SSLRootCert string
	// SSLKey used for enabling tls to the cluster. SSLRootCert, and SSLCert must also be set.
	SSLKey string
	// SSLCert used for enabling tls to the cluster. SSLRootCert, and SSLRootCert must also be set.
	SSLCert string
	// If you want to verify the hostname and server cert (like a wildcard for cass cluster) then you should turn this on
	// This option is basically the inverse of InSecureSkipVerify
	// See InSecureSkipVerify in http://golang.org/pkg/crypto/tls/ for more info
	EnableHostVerification bool

	// Username to authenticate into the cluster. Password must also be provided.
	Username string
	// Password to authenticate into the cluster. Username must also be provided.
	Password string

	// NumRetries for connecting to the db
	NumRetries int

	// WaitTimeMult the amount of time to wait before retrying to connect to the db
	WaitTimeMult time.Duration

	// MaxConnsPerHost max number of connections per host
	MaxConnsPerHost int
}

Jump to

Keyboard shortcuts

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