cassandra

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewCluster = func(config *gocql.ClusterConfig) IClusterConfig {
	return config
}
View Source
var NewSession = func(opt config.Cassandra) (ISession, error) {
	cluster := gocql.NewCluster(opt.CassandraHosts...)
	if err := extendOptions(cluster, opt); err != nil {
		return nil, err
	}
	return NewCluster(cluster).CreateSession()
}

NewSession method

Functions

This section is empty.

Types

type IClusterConfig

type IClusterConfig interface {
	CreateSession() (*gocql.Session, error)
}

IClusterConfig interface

type ISession

type ISession interface {
	SetConsistency(cons gocql.Consistency)
	SetPageSize(n int)
	SetPrefetch(p float64)
	SetTrace(trace gocql.Tracer)
	Query(stmt string, values ...interface{}) *gocql.Query
	Bind(stmt string, b func(q *gocql.QueryInfo) ([]interface{}, error)) *gocql.Query
	Close()
	Closed() bool
	KeyspaceMetadata(string) (*gocql.KeyspaceMetadata, error)
	ExecuteBatch(batch *gocql.Batch) error
	ExecuteBatchCAS(batch *gocql.Batch, dest ...interface{}) (applied bool, iter *gocql.Iter, err error)
	MapExecuteBatchCAS(batch *gocql.Batch, dest map[string]interface{}) (applied bool, iter *gocql.Iter, err error)
	NewBatch(typ gocql.BatchType) *gocql.Batch
}

ISession interface

func NewExtendCassandraDatabase

func NewExtendCassandraDatabase(logger *zap.Logger, opt config.Cassandra) (ISession, func(), error)

Jump to

Keyboard shortcuts

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