cassandra

package
v0.0.57 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: Apache-2.0 Imports: 12 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 BatchObserver added in v0.0.50

type BatchObserver = gocql.BatchObserver

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 ConnectObserver added in v0.0.50

type ConnectObserver = gocql.ConnectObserver

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 FrameHeaderObserver added in v0.0.50

type FrameHeaderObserver = gocql.FrameHeaderObserver

type InsertBuilder

type InsertBuilder = qb.InsertBuilder

func Insert

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

type ObservedQuery added in v0.0.50

type ObservedQuery = gocql.ObservedQuery

type Option

type Option func(*client) error

Option represents the functional option for client. It wraps the gocql.ClusterConfig to the function option implementation. Please refer to the following link for more information. https://pkg.go.dev/github.com/gocql/gocql?tab=doc#ClusterConfig

func WithAuthProvider

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

func WithBatchObserver added in v0.0.50

func WithBatchObserver(obs BatchObserver) Option

func WithCQLVersion

func WithCQLVersion(version string) Option

WithCQLVersion returns the option to set the CQL version

func WithCompressor

func WithCompressor(compressor gocql.Compressor) Option

func WithConnectObserver added in v0.0.50

func WithConnectObserver(obs ConnectObserver) Option

func WithConnectTimeout

func WithConnectTimeout(dur string) Option

WithConnectTimeout returns the option to set the cassandra initial connection timeout

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

WithDialer returns the option to set the dialer

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 WithFrameHeaderObserver added in v0.0.50

func WithFrameHeaderObserver(obs FrameHeaderObserver) Option

func WithHostFilter added in v0.0.34

func WithHostFilter(flg bool) Option

func WithHosts

func WithHosts(hosts ...string) Option

WithHosts returns the option to set the hosts

func WithIgnorePeerAddr

func WithIgnorePeerAddr(ignorePeerAddr bool) Option

func WithKeyspace

func WithKeyspace(keyspace string) Option

WithKeyspace returns the option to set the keyspace

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

WithNumConns returns the option to set the number of connection per host

func WithPageSize

func WithPageSize(pageSize int) Option

func WithPassword

func WithPassword(password string) Option

func WithPort

func WithPort(port int) Option

WithPort returns the option to set the port number

func WithProtoVersion

func WithProtoVersion(version int) Option

WithProtoVersion returns the option to set the proto version

func WithQueryObserver added in v0.0.50

func WithQueryObserver(obs QueryObserver) 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

WithTimeout returns the option to set the cassandra connect timeout time

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 QueryObserver added in v0.0.50

type QueryObserver = gocql.QueryObserver

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