Documentation ¶
Overview ¶
Copyright (C) 2019-2023 vdaas.org vald team <vald@vdaas.org>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package redis provides implementation of Go API for redis interface
Index ¶
- Variables
- func NewConvictionPolicy() gocql.ConvictionPolicy
- func Select(table string, columns []string, cmps ...Cmp) (stmt string, names []string)
- func WrapErrorWithKeys(err error, keys ...string) error
- type BatchBuilder
- type BatchObserver
- type Cassandra
- type ClusterConfig
- type Cmp
- type ConnectObserver
- type DeleteBuilder
- type Deleter
- type DialerMock
- type FrameHeaderObserver
- type InsertBuilder
- type MockClusterConfig
- type ObservedQuery
- type Option
- func WithAuthProvider(authProvider func(h *gocql.HostInfo) (gocql.Authenticator, error)) Option
- func WithBatchObserver(obs BatchObserver) Option
- func WithCQLVersion(version string) Option
- func WithCompressor(compressor gocql.Compressor) Option
- func WithConnectObserver(obs ConnectObserver) Option
- func WithConnectTimeout(dur string) Option
- func WithConsistency(consistency string) Option
- func WithDC(name string) Option
- func WithDCAwareRouting(dcAwareRouting bool) Option
- func WithDCHostFilter(dc string) Option
- func WithDefaultIdempotence(defaultIdempotence bool) Option
- func WithDefaultTimestamp(defaultTimestamp bool) Option
- func WithDialer(der net.Dialer) Option
- func WithDisableInitialHostLookup(disableInitialHostLookup bool) Option
- func WithDisableNodeStatusEvents(disableNodeStatusEvents bool) Option
- func WithDisableSchemaEvents(disableSchemaEvents bool) Option
- func WithDisableSkipMetadata(disableSkipMetadata bool) Option
- func WithDisableTopologyEvents(disableTopologyEvents bool) Option
- func WithEnableHostVerification(enableHostVerification bool) Option
- func WithFrameHeaderObserver(obs FrameHeaderObserver) Option
- func WithHostFilter(flg bool) Option
- func WithHosts(hosts ...string) Option
- func WithIgnorePeerAddr(ignorePeerAddr bool) Option
- func WithKeyspace(keyspace string) Option
- func WithMaxPreparedStmts(maxPreparedStmts int) Option
- func WithMaxRoutingKeyInfo(maxRoutingKeyInfo int) Option
- func WithMaxWaitSchemaAgreement(maxWaitSchemaAgreement string) Option
- func WithNonLocalReplicasFallback(nonLocalReplicasFallBack bool) Option
- func WithNumConns(numConns int) Option
- func WithPageSize(pageSize int) Option
- func WithPassword(password string) Option
- func WithPort(port int) Option
- func WithProtoVersion(version int) Option
- func WithQueryObserver(obs QueryObserver) Option
- func WithReconnectInterval(reconnectInterval string) Option
- func WithReconnectionPolicyInitialInterval(initialInterval string) Option
- func WithReconnectionPolicyMaxRetries(maxRetries int) Option
- func WithRetryPolicyMaxDuration(maxDuration string) Option
- func WithRetryPolicyMinDuration(minDuration string) Option
- func WithRetryPolicyNumRetries(n int) Option
- func WithSerialConsistency(consistency string) Option
- func WithShuffleReplicas(shuffleReplicas bool) Option
- func WithSocketKeepalive(socketKeepalive string) Option
- func WithTLS(tls *tls.Config) Option
- func WithTLSCAPath(caPath string) Option
- func WithTLSCertPath(certPath string) Option
- func WithTLSKeyPath(keyPath string) Option
- func WithTimeout(dur string) Option
- func WithTokenAwareHostPolicy(tokenAwareHostPolicy bool) Option
- func WithUsername(username string) Option
- func WithWhiteListHostFilter(list []string) Option
- func WithWriteCoalesceWaitTime(writeCoalesceWaitTime string) Option
- type QueryObserver
- type Queryx
- type Session
- type UpdateBuilder
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound is a alias of gocql.ErrNotFound. ErrNotFound = gocql.ErrNotFound ErrUnavailable = gocql.ErrUnavailable // ErrUnsupported is a alias of gocql.ErrUnsupported. ErrUnsupported = gocql.ErrUnsupported // ErrTooManyStmts is a alias of gocql.ErrTooManyStmts. ErrTooManyStmts = gocql.ErrTooManyStmts // ErrUseStmt is a alias of gocql.ErrUseStmt. ErrUseStmt = gocql.ErrUseStmt // ErrSessionClosed is a alias of gocql.ErrSessionClosed. ErrSessionClosed = gocql.ErrSessionClosed // ErrNoConnections is a alias of gocql.ErrNoConnections. ErrNoConnections = gocql.ErrNoConnections // ErrNoKeyspace is a alias of gocql.ErrNoKeyspace. ErrNoKeyspace = gocql.ErrNoKeyspace // ErrKeyspaceDoesNotExist is a alias of gocql.ErrKeyspaceDoesNotExist. ErrKeyspaceDoesNotExist = gocql.ErrKeyspaceDoesNotExist // ErrNoMetadata is a alias of gocql.ErrNoMetadata. ErrNoMetadata = gocql.ErrNoMetadata // ErrNoHosts is a alias of gocql.ErrNoHosts. ErrNoHosts = gocql.ErrNoHosts // ErrNoConnectionsStarted is a alias of gocql.ErrNoConnectionsStarted. ErrNoConnectionsStarted = gocql.ErrNoConnectionsStarted // ErrHostQueryFailed is a alias of gocql.ErrHostQueryFailed. ErrHostQueryFailed = gocql.ErrHostQueryFailed )
Functions ¶
func NewConvictionPolicy ¶ added in v0.0.27
func NewConvictionPolicy() gocql.ConvictionPolicy
NewConvictionPolicy returns the implementation of gocql.ConvictionPolicy.
func WrapErrorWithKeys ¶ added in v0.0.26
WrapErrorWithKeys wraps the cassandra error to Vald internal error.
Types ¶
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 }
Cassandra represent an interface to query on cassandra.
type ClusterConfig ¶ added in v0.0.63
ClusterConfig represent an interface of cassandra cluster configuation.
type ConnectObserver ¶ added in v0.0.50
type ConnectObserver = gocql.ConnectObserver
type DeleteBuilder ¶
type DeleteBuilder = qb.DeleteBuilder
DeleteBuilder is a alias of qb.DeleteBuilder.
func Delete ¶
func Delete(table string, cmps ...Cmp) *DeleteBuilder
Delete returns the delete builder.
type DialerMock ¶ added in v1.0.5
type DialerMock struct {
DialContextFunc func(ctx context.Context, network, addr string) (net.Conn, error)
}
func (*DialerMock) DialContext ¶ added in v1.0.5
func (*DialerMock) StartDialerCache ¶ added in v1.0.5
func (*DialerMock) StartDialerCache(context.Context)
type FrameHeaderObserver ¶ added in v0.0.50
type FrameHeaderObserver = gocql.FrameHeaderObserver
type InsertBuilder ¶
type InsertBuilder = qb.InsertBuilder
InsertBuilder is a alias of qb.InsertBuilder.
func Insert ¶
func Insert(table string, columns ...string) *InsertBuilder
Insert returns the insert builder.
type MockClusterConfig ¶ added in v0.0.63
func (*MockClusterConfig) CreateSession ¶ added in v0.0.63
func (m *MockClusterConfig) CreateSession() (*gocql.Session, error)
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 ¶
WithAuthProvider returns the option to set the auth provider.
func WithBatchObserver ¶ added in v0.0.50
func WithBatchObserver(obs BatchObserver) Option
WithBatchObserver returns the option to set batch observer.
func WithCQLVersion ¶
WithCQLVersion returns the option to set the CQL version.
func WithCompressor ¶
func WithCompressor(compressor gocql.Compressor) Option
WithCompressor returns the option to set the compressor.
func WithConnectObserver ¶ added in v0.0.50
func WithConnectObserver(obs ConnectObserver) Option
WithConnectObserver returns the option to set connect observer.
func WithConnectTimeout ¶
WithConnectTimeout returns the option to set the cassandra initial connection timeout.
func WithConsistency ¶
WithConsistency returns the option to set the cassandra consistency level.
func WithDCAwareRouting ¶ added in v0.0.32
WithDCAwareRouting returns the option to set the data center aware routing enable flag.
func WithDCHostFilter ¶ added in v0.0.34
WithDCHostFilter returns the option to set the DC host filter.
func WithDefaultIdempotence ¶
WithDefaultIdempotence returns the option to set default idempotence flag.
func WithDefaultTimestamp ¶
WithDefaultTimestamp returns the option to set the default timestamp enable flag.
func WithDialer ¶ added in v0.0.2
WithDialer returns the option to set the dialer.
func WithDisableInitialHostLookup ¶
WithDisableInitialHostLookup returns the option to set disable initial host lookup flag.
func WithDisableNodeStatusEvents ¶
WithDisableNodeStatusEvents returns the option to set disable node status events flag.
func WithDisableSchemaEvents ¶
WithDisableSchemaEvents returns the option to set disable schema events flag.
func WithDisableSkipMetadata ¶
WithDisableSkipMetadata returns the option to set disable skip metadata flag.
func WithDisableTopologyEvents ¶
WithDisableTopologyEvents returns the option to set disable topology events flag.
func WithEnableHostVerification ¶
WithEnableHostVerification returns the option to set the host verification enable flag.
func WithFrameHeaderObserver ¶ added in v0.0.50
func WithFrameHeaderObserver(obs FrameHeaderObserver) Option
WithFrameHeaderObserver returns the option to set FrameHeader observer.
func WithHostFilter ¶ added in v0.0.34
WithHostFilter returns the option to set the host filter enable flag.
func WithIgnorePeerAddr ¶
WithIgnorePeerAddr returns the option to set ignore peer address flag.
func WithKeyspace ¶
WithKeyspace returns the option to set the keyspace.
func WithMaxPreparedStmts ¶
WithMaxPreparedStmts returns the option to set the max prepared statement.
func WithMaxRoutingKeyInfo ¶
WithMaxRoutingKeyInfo returns the option to set the max routing key info.
func WithMaxWaitSchemaAgreement ¶
WithMaxWaitSchemaAgreement returns the option to set the max wait schema agreement.
func WithNonLocalReplicasFallback ¶ added in v0.0.32
WithNonLocalReplicasFallback returns the option to set the non local replicas fallback enable flag.
func WithNumConns ¶
WithNumConns returns the option to set the number of connection per host.
func WithPageSize ¶
WithPageSize returns the option to set the page size.
func WithPassword ¶
WithPassword returns the option to set the password.
func WithProtoVersion ¶
WithProtoVersion returns the option to set the proto version.
func WithQueryObserver ¶ added in v0.0.50
func WithQueryObserver(obs QueryObserver) Option
WithQueryObserver returns the option to set query observer.
func WithReconnectInterval ¶
WithReconnectInterval returns the option to set the reconnect interval.
func WithReconnectionPolicyInitialInterval ¶
WithReconnectionPolicyInitialInterval returns the option to set the reconnect initial interval.
func WithReconnectionPolicyMaxRetries ¶
WithReconnectionPolicyMaxRetries returns the option to set the reconnect max retries.
func WithRetryPolicyMaxDuration ¶
WithRetryPolicyMaxDuration returns the option to set the retry max duration.
func WithRetryPolicyMinDuration ¶
WithRetryPolicyMinDuration returns the option to set the retry min duration.
func WithRetryPolicyNumRetries ¶
WithRetryPolicyNumRetries returns the option to set the number of retries.
func WithSerialConsistency ¶
WithSerialConsistency returns the option to set the cassandra serial consistency level.
func WithShuffleReplicas ¶ added in v0.0.32
WithShuffleReplicas returns the option to set the shuffle replicas enable flag.
func WithSocketKeepalive ¶
WithSocketKeepalive returns the option to set the socket keepalive time.
func WithTLSCAPath ¶
WithTLSCAPath returns the option to set the TLS CA path.
func WithTLSCertPath ¶
WithTLSCertPath returns the option to set the TLS cert path.
func WithTLSKeyPath ¶
WithTLSKeyPath returns the option to set the TLS key path.
func WithTimeout ¶
WithTimeout returns the option to set the cassandra connect timeout time.
func WithTokenAwareHostPolicy ¶ added in v0.0.34
WithTokenAwareHostPolicy returns the option to set the token aware host policy enable flag.
func WithUsername ¶
WithUsername returns the option to set the username.
func WithWhiteListHostFilter ¶ added in v0.0.34
WithWhiteListHostFilter returns the option to set the white list host filter.
func WithWriteCoalesceWaitTime ¶
WithWriteCoalesceWaitTime returns the option to set the write coalesce wait time.
type QueryObserver ¶ added in v0.0.50
type QueryObserver = gocql.QueryObserver
type UpdateBuilder ¶
type UpdateBuilder = qb.UpdateBuilder
UpdateBuilder is a alias of qb.UpdateBuilder.