Documentation ¶
Index ¶
- func CreateStoreSession(storeConfig *CassandraConn, keySpace string) (*gocql.Session, error)
- func DeleteStmt(opts ...OptFunc) (string, error)
- func InsertStmt(opts ...OptFunc) (string, error)
- func NewCassandraConnector(config *Config, scope tally.Scope) (orm.Connector, error)
- func SelectStmt(opts ...OptFunc) (string, error)
- func UpdateStmt(opts ...OptFunc) (string, error)
- type CassandraConn
- type Config
- type OptFunc
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateStoreSession ¶
func CreateStoreSession( storeConfig *CassandraConn, keySpace string) (*gocql.Session, error)
CreateStoreSession is to create clusters and connections
func DeleteStmt ¶
DeleteStmt creates delete statement
func InsertStmt ¶
InsertStmt creates insert statement
func NewCassandraConnector ¶
NewCassandraConnector initializes a Cassandra Connector
func SelectStmt ¶
SelectStmt creates select statement
func UpdateStmt ¶
UpdateStmt creates update statement
Types ¶
type CassandraConn ¶
type CassandraConn struct { ContactPoints []string `yaml:"contactPoints"` Port int `yaml:"port"` Username string `yaml:"username"` Password string `yaml:"password"` Consistency string `yaml:"consistency"` SerialConsistency string `yaml:"serialConsistency"` ConnectionsPerHost int `yaml:"connectionsPerHost"` Timeout time.Duration `yaml:"timeout"` SocketKeepalive time.Duration `yaml:"socketKeepalive"` ProtoVersion int `yaml:"protoVersion"` TTL time.Duration `yaml:"ttl"` LocalDCOnly bool `yaml:"localDCOnly"` // deprecated DataCenter string `yaml:"dataCenter"` // data center filter PageSize int `yaml:"pageSize"` RetryCount int `yaml:"retryCount"` HostPolicy string `yaml:"hostPolicy"` TimeoutLimit int `yaml:"timeoutLimit"` // number of timeouts allowed CQLVersion string `yaml:"cqlVersion"` // set only on C* 3.x MaxGoRoutines int `yaml:"maxGoroutines"` // a capacity limit }
CassandraConn describes the properties to manage a Cassandra connection.
type Config ¶
type Config struct { CassandraConn *CassandraConn `yaml:"connection"` StoreName string `yaml:"store_name"` Migrations string `yaml:"migrations"` }
Config is the config for cassandra Store
type OptFunc ¶
type OptFunc func(Option)
OptFunc is the interface to set option
func Conditions ¶
func Conditions(v interface{}) OptFunc
Conditions set the `where` clause to the cql statement
func IfNotExist ¶
func IfNotExist(v interface{}) OptFunc
IfNotExist sets the `if not exist` clause to the cql statement
Click to show internal directories.
Click to hide internal directories.