cqldb

package
v2.25.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultPort = 9142

	NullValue = "null"

	UUIDType   = "UUID"
	Int64Type  = "bigint"
	BytesType  = "blob"
	StringType = "text"

	WhereClause = "WHERE"
	FromClause  = "FROM"

	SelectCommand = "SELECT"
)

Variables

This section is empty.

Functions

func EncodeToBlob

func EncodeToBlob(data []byte, buffer *strings.Builder)

Types

type Client

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

Client implements an Client for CqlDB.

func New

func New(ctx context.Context, cfg Config, tls *tls.Config, logger log.Logger, _ trace.TracerProvider) (*Client, error)

NewStore creates a new Client.

func (*Client) AddCloseFunc

func (s *Client) AddCloseFunc(f func())

func (*Client) Clear

func (s *Client) Clear(ctx context.Context) error

Clear clears the event storage.

func (*Client) Close

func (s *Client) Close()

Close closes the database session.

func (*Client) CreateIndexes

func (s *Client) CreateIndexes(ctx context.Context, table string, indexes []Index) error

func (*Client) DropKeyspace

func (s *Client) DropKeyspace(ctx context.Context) error

Drops the whole database

func (*Client) DropTable

func (s *Client) DropTable(ctx context.Context, table string) error

Drops selected collection from database

func (*Client) Keyspace

func (s *Client) Keyspace() string

func (*Client) Session

func (s *Client) Session() *gocql.Session

Get mongodb client

func (*Client) SetOnClear

func (s *Client) SetOnClear(onClear OnClearFn)

Set the function called on Clear

type Config

type Config struct {
	Hosts                 []string                 `yaml:"hosts" json:"hosts"`
	Port                  int                      `yaml:"port" json:"port"`
	NumConns              int                      `yaml:"numConnections" json:"numConnections"`
	ConnectTimeout        time.Duration            `yaml:"connectTimeout" json:"connectTimeout"`
	ReconnectionPolicy    ReconnectionPolicyConfig `yaml:"reconnectionPolicy" json:"reconnectionPolicy"`
	UseHostnameResolution bool                     `yaml:"useHostnameResolution" json:"useHostnameResolution"`
	Keyspace              KeyspaceConfig           `yaml:"keyspace" json:"keyspace"`
	TLS                   client.Config            `yaml:"tls" json:"tls"`
}

func (*Config) Validate

func (c *Config) Validate() error

type ConstantReconnectionPolicyConfig

type ConstantReconnectionPolicyConfig struct {
	Interval   time.Duration `yaml:"interval" json:"interval"`
	MaxRetries int           `yaml:"maxRetries" json:"maxRetries"`
}

func (*ConstantReconnectionPolicyConfig) Validate

type Index

type Index struct {
	Name            string
	PartitionKey    string
	SecondaryColumn string
}

type KeyspaceConfig

type KeyspaceConfig struct {
	Name        string                 `yaml:"name" json:"name"`
	Create      bool                   `yaml:"create" json:"create"`
	Replication map[string]interface{} `yaml:"replication" json:"replication"`
}

func (*KeyspaceConfig) Validate

func (c *KeyspaceConfig) Validate() error

type OnClearFn

type OnClearFn = func(context.Context) error

type ReconnectionPolicyConfig

type ReconnectionPolicyConfig struct {
	Constant ConstantReconnectionPolicyConfig `yaml:"constant" json:"constant"`
}

func (*ReconnectionPolicyConfig) Validate

func (c *ReconnectionPolicyConfig) Validate() error

type Store added in v2.19.1

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

Store implements an Store for cqldb.

func NewStore added in v2.19.1

func NewStore(table string, client *Client, logger log.Logger) *Store

func (*Store) AddCloseFunc added in v2.19.1

func (s *Store) AddCloseFunc(f func())

func (*Store) Clear added in v2.19.1

func (s *Store) Clear(ctx context.Context) error

func (*Store) ClearTable added in v2.19.1

func (s *Store) ClearTable(ctx context.Context) error

Clear documents in collections, but don't drop the database or the collections

func (*Store) Close added in v2.19.1

func (s *Store) Close(_ context.Context) error

Close closes the database session.

func (*Store) Session added in v2.19.1

func (s *Store) Session() *gocql.Session

func (*Store) Table added in v2.19.1

func (s *Store) Table() string

Jump to

Keyboard shortcuts

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