Documentation ¶
Index ¶
- Variables
- func WaitForTables(db Cassandra, timeout time.Duration, tables ...string) error
- type Cassandra
- type CassandraConfig
- type TestErrorCassandra
- func (c *TestErrorCassandra) Close() error
- func (c *TestErrorCassandra) Config() CassandraConfig
- func (c *TestErrorCassandra) ExecuteBatch(batchType gocql.BatchType, queries []string, params [][]interface{}) error
- func (c *TestErrorCassandra) ExecuteQuery(queryString string, queryParams ...interface{}) error
- func (c *TestErrorCassandra) ExecuteUnloggedBatch(queries []string, params [][]interface{}) error
- func (c *TestErrorCassandra) IterQuery(queryString string, queryParams []interface{}, outParams ...interface{}) func() (int, bool, error)
- func (c *TestErrorCassandra) Query(consistency gocql.Consistency, queryString string, queryParams ...interface{}) *gocql.Query
- func (c *TestErrorCassandra) ScanCASQuery(queryString string, queryParams []interface{}, outParams ...interface{}) (bool, error)
- func (c *TestErrorCassandra) ScanQuery(queryString string, queryParams []interface{}, outParams ...interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var NotFound = errors.New("Not found")
Functions ¶
Types ¶
type Cassandra ¶
type Cassandra interface { Query(gocql.Consistency, string, ...interface{}) *gocql.Query ExecuteQuery(string, ...interface{}) error ExecuteBatch(gocql.BatchType, []string, [][]interface{}) error ExecuteUnloggedBatch([]string, [][]interface{}) error ScanQuery(string, []interface{}, ...interface{}) error ScanCASQuery(string, []interface{}, ...interface{}) (bool, error) IterQuery(string, []interface{}, ...interface{}) func() (int, bool, error) Close() error Config() CassandraConfig }
func NewCassandra ¶
func NewCassandra(config CassandraConfig) (Cassandra, error)
type CassandraConfig ¶
type CassandraConfig struct { // Required Parameters Nodes []string // addresses for the initial connections DataCenter string // data center name Keyspace string // initial keyspace ReadConsistency string // consistency for read operations WriteConsistency string // consistency for write operations Timeout string `config:"optional"` // connection timeout (default: 600ms) ConnectTimeout string `config:"optional" yaml:"connect_timeout"` // initial connection timeout (default: 600ms) KeepAlive string `config:"optional"` // The keepalive period to use default: 0 NumConns int `config:"optional"` // number of connections per host (default: 2) Port int `config:"optional"` // port to connect to, default: 9042 NumRetries int `config:"optional" yaml:"num_retries"` // number of retries in case of connection timeout DisableInitialHostLookup bool `config:"optional"` // Don't preform ip address discovery on the cluster, just use the Nodes provided PreferRPCAddress bool `config:"optional" yaml:"prefer_rpc_address"` // Prefer to connect to rpc_addresses during cluster discovery // TestMode affects whether a keyspace creation will be attempted on Cassandra initialization. TestMode bool `config:"optional"` }
CassandraConfig is a json and yaml friendly configuration struct
func (CassandraConfig) String ¶
func (c CassandraConfig) String() string
type TestErrorCassandra ¶
type TestErrorCassandra struct{}
func (*TestErrorCassandra) Close ¶
func (c *TestErrorCassandra) Close() error
func (*TestErrorCassandra) Config ¶
func (c *TestErrorCassandra) Config() CassandraConfig
func (*TestErrorCassandra) ExecuteBatch ¶
func (c *TestErrorCassandra) ExecuteBatch(batchType gocql.BatchType, queries []string, params [][]interface{}) error
func (*TestErrorCassandra) ExecuteQuery ¶
func (c *TestErrorCassandra) ExecuteQuery(queryString string, queryParams ...interface{}) error
func (*TestErrorCassandra) ExecuteUnloggedBatch ¶
func (c *TestErrorCassandra) ExecuteUnloggedBatch(queries []string, params [][]interface{}) error
func (*TestErrorCassandra) IterQuery ¶
func (c *TestErrorCassandra) IterQuery(queryString string, queryParams []interface{}, outParams ...interface{}) func() (int, bool, error)
func (*TestErrorCassandra) Query ¶
func (c *TestErrorCassandra) Query(consistency gocql.Consistency, queryString string, queryParams ...interface{}) *gocql.Query
func (*TestErrorCassandra) ScanCASQuery ¶
func (c *TestErrorCassandra) ScanCASQuery(queryString string, queryParams []interface{}, outParams ...interface{}) (bool, error)
func (*TestErrorCassandra) ScanQuery ¶
func (c *TestErrorCassandra) ScanQuery(queryString string, queryParams []interface{}, outParams ...interface{}) error
Click to show internal directories.
Click to hide internal directories.