cassandra

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package redis provides implementation of Go API for redis interface

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = gocql.ErrNotFound
)

Functions

func Select

func Select(table string, columns []string, cmps ...Cmp) (stmt string, names []string)

Types

type BatchBuilder

type BatchBuilder = qb.BatchBuilder

func Batch

func Batch() *BatchBuilder

type Cassandra

type Cassandra interface {
	Open(ctx context.Context) error
	Close(ctx context.Context) error
	Lister
	Getter
	Setter
	Deleter
	Querier
}

func New

func New(opts ...Option) (Cassandra, error)

type Cmp

type Cmp = qb.Cmp

func Contains

func Contains(column string) Cmp

func Eq

func Eq(column string) Cmp

type DeleteBuilder

type DeleteBuilder = qb.DeleteBuilder

func Delete

func Delete(table string, cmps ...Cmp) *DeleteBuilder

type Deleter

type Deleter interface {
	DeleteByKeys(keys ...string) ([]string, error)
	DeleteByValues(values ...string) ([]string, error)
}

type Getter

type Getter interface {
	GetValue(string) (string, error)
	GetKey(string) (string, error)
	MultiGetValue(...string) ([]string, error)
	MultiGetKey(...string) ([]string, error)
}

type InsertBuilder

type InsertBuilder = qb.InsertBuilder

func Insert

func Insert(table string, columns ...string) *InsertBuilder

type Lister

type Lister interface {
}

type Option

type Option func(*client) error

func WithAuthProvider

func WithAuthProvider(authProvider func(h *gocql.HostInfo) (gocql.Authenticator, error)) Option

func WithCQLVersion

func WithCQLVersion(version string) Option

func WithCompressor

func WithCompressor(compressor gocql.Compressor) Option

func WithConnectTimeout

func WithConnectTimeout(dur string) Option

func WithConsistency

func WithConsistency(consistency string) Option

func WithDC

func WithDC(name string) Option

func WithDefaultIdempotence

func WithDefaultIdempotence(defaultIdempotence bool) Option

func WithDefaultTimestamp

func WithDefaultTimestamp(defaultTimestamp bool) Option

func WithDialer added in v0.0.2

func WithDialer(der gocql.Dialer) Option

func WithDisableDCAwareRouting

func WithDisableDCAwareRouting() Option

func WithDisableInitialHostLookup

func WithDisableInitialHostLookup(disableInitialHostLookup bool) Option

func WithDisableNodeStatusEvents

func WithDisableNodeStatusEvents(disableNodeStatusEvents bool) Option

func WithDisableNonLocalReplicasFallback

func WithDisableNonLocalReplicasFallback() Option

func WithDisableSchemaEvents

func WithDisableSchemaEvents(disableSchemaEvents bool) Option

func WithDisableShuffleReplicas

func WithDisableShuffleReplicas() Option

func WithDisableSkipMetadata

func WithDisableSkipMetadata(disableSkipMetadata bool) Option

func WithDisableTopologyEvents

func WithDisableTopologyEvents(disableTopologyEvents bool) Option

func WithEnableDCAwareRouting

func WithEnableDCAwareRouting() Option

func WithEnableHostVerification

func WithEnableHostVerification(enableHostVerification bool) Option

func WithEnableNonLocalReplicasFallback

func WithEnableNonLocalReplicasFallback() Option

func WithEnableShuffleReplicas

func WithEnableShuffleReplicas() Option

func WithHosts

func WithHosts(hosts ...string) Option

func WithIgnorePeerAddr

func WithIgnorePeerAddr(ignorePeerAddr bool) Option

func WithKVTable

func WithKVTable(kvTable string) Option

func WithKeyspace

func WithKeyspace(keyspace string) Option

func WithMaxPreparedStmts

func WithMaxPreparedStmts(maxPreparedStmts int) Option

func WithMaxRoutingKeyInfo

func WithMaxRoutingKeyInfo(maxRoutingKeyInfo int) Option

func WithMaxWaitSchemaAgreement

func WithMaxWaitSchemaAgreement(maxWaitSchemaAgreement string) Option

func WithNumConns

func WithNumConns(numConns int) Option

func WithPageSize

func WithPageSize(pageSize int) Option

func WithPassword

func WithPassword(password string) Option

func WithPort

func WithPort(port int) Option

func WithProtoVersion

func WithProtoVersion(version int) Option

func WithReconnectInterval

func WithReconnectInterval(reconnectInterval string) Option

func WithReconnectionPolicyInitialInterval

func WithReconnectionPolicyInitialInterval(initialInterval string) Option

func WithReconnectionPolicyMaxRetries

func WithReconnectionPolicyMaxRetries(maxRetries int) Option

func WithRetryPolicyMaxDuration

func WithRetryPolicyMaxDuration(maxDuration string) Option

func WithRetryPolicyMinDuration

func WithRetryPolicyMinDuration(minDuration string) Option

func WithRetryPolicyNumRetries

func WithRetryPolicyNumRetries(n int) Option

func WithSerialConsistency

func WithSerialConsistency(consistency gocql.SerialConsistency) Option

func WithSocketKeepalive

func WithSocketKeepalive(socketKeepalive string) Option

func WithTLS

func WithTLS(tls *tls.Config) Option

func WithTLSCAPath

func WithTLSCAPath(caPath string) Option

func WithTLSCertPath

func WithTLSCertPath(certPath string) Option

func WithTLSKeyPath

func WithTLSKeyPath(keyPath string) Option

func WithTimeout

func WithTimeout(dur string) Option

func WithUsername

func WithUsername(username string) Option

func WithVKTable

func WithVKTable(vkTable string) Option

func WithWriteCoalesceWaitTime

func WithWriteCoalesceWaitTime(writeCoalesceWaitTime string) Option

type Querier

type Querier interface {
	Query(stmt string, names []string) *Queryx
}

type Queryx

type Queryx = gocqlx.Queryx

type Session

type Session = gocql.Session

type Setter

type Setter interface {
	Set(string, string) error
	MultiSet(map[string]string) error
}

type UpdateBuilder

type UpdateBuilder = qb.UpdateBuilder

func Update

func Update(table string) *UpdateBuilder

Jump to

Keyboard shortcuts

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