Documentation ¶
Index ¶
- Constants
- func EncodeToBlob(data []byte, buffer *strings.Builder)
- type Client
- func (s *Client) AddCloseFunc(f func())
- func (s *Client) Clear(ctx context.Context) error
- func (s *Client) Close()
- func (s *Client) CreateIndexes(ctx context.Context, table string, indexes []Index) error
- func (s *Client) DropKeyspace(ctx context.Context) error
- func (s *Client) DropTable(ctx context.Context, table string) error
- func (s *Client) Keyspace() string
- func (s *Client) Session() *gocql.Session
- func (s *Client) SetOnClear(onClear OnClearFn)
- type Config
- type ConstantReconnectionPolicyConfig
- type Index
- type KeyspaceConfig
- type OnClearFn
- type ReconnectionPolicyConfig
- type Store
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 ¶
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) CreateIndexes ¶
func (*Client) DropKeyspace ¶
Drops the whole database
func (*Client) SetOnClear ¶
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"` }
type ConstantReconnectionPolicyConfig ¶
type ConstantReconnectionPolicyConfig struct { Interval time.Duration `yaml:"interval" json:"interval"` MaxRetries int `yaml:"maxRetries" json:"maxRetries"` }
func (*ConstantReconnectionPolicyConfig) Validate ¶
func (c *ConstantReconnectionPolicyConfig) Validate() error
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 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 (*Store) AddCloseFunc ¶ added in v2.19.1
func (s *Store) AddCloseFunc(f func())
func (*Store) ClearTable ¶ added in v2.19.1
Clear documents in collections, but don't drop the database or the collections
Click to show internal directories.
Click to hide internal directories.