cassandra

package
v0.9.12 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Yugabyte = "yugabyte"
)

Variables

This section is empty.

Functions

func NewCassandra added in v0.5.0

func NewCassandra(config Config, metricsIn metric.Measures, lc fx.Lifecycle, logger *zap.Logger) (store.S, error)

Types

type Client added in v0.5.0

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

func CreateCassandraClient

func CreateCassandraClient(config Config, measures metric.Measures) (*Client, error)

func (*Client) Close added in v0.5.0

func (s *Client) Close()

func (*Client) Delete added in v0.5.0

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

nolint:dupl

func (*Client) Get added in v0.5.0

func (s *Client) Get(key model.Key) (store.OwnableItem, error)

nolint:dupl

func (*Client) GetAll added in v0.5.0

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

func (*Client) Ping added in v0.5.0

func (s *Client) Ping() error

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

func (*Client) Push added in v0.5.0

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

type Config added in v0.5.0

type Config 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