cassandra

package
v0.0.37 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: Apache-2.0 Imports: 11 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
	ErrUnavailable          = gocql.ErrUnavailable
	ErrUnsupported          = gocql.ErrUnsupported
	ErrTooManyStmts         = gocql.ErrTooManyStmts
	ErrUseStmt              = gocql.ErrUseStmt
	ErrSessionClosed        = gocql.ErrSessionClosed
	ErrNoConnections        = gocql.ErrNoConnections
	ErrNoKeyspace           = gocql.ErrNoKeyspace
	ErrKeyspaceDoesNotExist = gocql.ErrKeyspaceDoesNotExist
	ErrNoMetadata           = gocql.ErrNoMetadata
	ErrNoHosts              = gocql.ErrNoHosts
	ErrNoConnectionsStarted = gocql.ErrNoConnectionsStarted
	ErrHostQueryFailed      = gocql.ErrHostQueryFailed
)

Functions

func NewConvictionPolicy added in v0.0.27

func NewConvictionPolicy() gocql.ConvictionPolicy

func Select

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

func WrapErrorWithKeys added in v0.0.26

func WrapErrorWithKeys(err error, keys ...string) error

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
	Query(stmt string, names []string) *Queryx
}

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

func In added in v0.0.26

func In(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 InsertBuilder

type InsertBuilder = qb.InsertBuilder

func Insert

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

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 WithDCAwareRouting added in v0.0.32

func WithDCAwareRouting(dcAwareRouting bool) Option

func WithDCHostFilter added in v0.0.34

func WithDCHostFilter(dc 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 WithDisableInitialHostLookup

func WithDisableInitialHostLookup(disableInitialHostLookup bool) Option

func WithDisableNodeStatusEvents

func WithDisableNodeStatusEvents(disableNodeStatusEvents bool) Option

func WithDisableSchemaEvents

func WithDisableSchemaEvents(disableSchemaEvents bool) Option

func WithDisableSkipMetadata

func WithDisableSkipMetadata(disableSkipMetadata bool) Option

func WithDisableTopologyEvents

func WithDisableTopologyEvents(disableTopologyEvents bool) Option

func WithEnableHostVerification

func WithEnableHostVerification(enableHostVerification bool) Option

func WithHostFilter added in v0.0.34

func WithHostFilter(flg bool) Option

func WithHosts

func WithHosts(hosts ...string) Option

func WithIgnorePeerAddr

func WithIgnorePeerAddr(ignorePeerAddr bool) 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 WithNonLocalReplicasFallback added in v0.0.32

func WithNonLocalReplicasFallback(nonLocalReplicasFallBack bool) 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 string) Option

func WithShuffleReplicas added in v0.0.32

func WithShuffleReplicas(shuffleReplicas bool) 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 WithTokenAwareHostPolicy added in v0.0.34

func WithTokenAwareHostPolicy(tokenAwareHostPolicy bool) Option

func WithUsername

func WithUsername(username string) Option

func WithWhiteListHostFilter added in v0.0.34

func WithWhiteListHostFilter(list []string) Option

func WithWriteCoalesceWaitTime

func WithWriteCoalesceWaitTime(writeCoalesceWaitTime string) Option

type Queryx

type Queryx = gocqlx.Queryx

type Session

type Session = gocql.Session

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