Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶
func Initialize(clusterHostName, systemKeyspace, appKeyspace string, connectionTimeout time.Duration)
Initialize waits for a Cassandra session, initializes Cassandra keyspace and creates tables if required. NOTE: Needs to be called only once on the app startup, won't fail if it is called multiple times but is not necessary.
Params:
clusterHostName: Cassandra cluster host systemKeyspace: System keyspace appKeyspace: Application keyspace connectionTimeout: timeout to get the connection
Types ¶
type Holder ¶
type Holder interface {
GetSession() SessionInterface
CloseSession()
}
Holder allows to store a close sessions
type Initializer ¶
Initializer is a common interface for functionality to start a new session
func New ¶
func New(clusterHostName, keyspace string) Initializer
New return a cassandra session Initializer
type IterInterface ¶
type QueryInterface ¶
type QueryInterface interface {
Exec() error
Scan(dest ...interface{}) error
Iter() IterInterface
PageState(state []byte) QueryInterface
PageSize(n int) QueryInterface
}
type SessionInterface ¶
type SessionInterface interface {
Query(stmt string, values ...interface{}) QueryInterface
Close()
}
SessionInterface is an interface to wrap gocql methods used in Motiv
Click to show internal directories.
Click to hide internal directories.