Documentation ¶
Index ¶
- Variables
- func ClearDataset(session *gocql.Session, table string) error
- func CreateEventTable(session *gocql.Session, keyspace, table string) error
- func CreateSession(config gocql.ClusterConfig) (*gocql.Session, error)
- func DropTable(session *gocql.Session, table string) error
- func InsertEvent(session *gocql.Session, table string, event model.Event) error
- type Cluster
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidEvent is returned by InsertEvent when there is an attempt to // insert an invalid model.Tracker into the database. ErrInvalidEvent = errors.New("cassandra: cannot insert invalid event into the database") )
Functions ¶
func ClearDataset ¶
ClearDataset will truncate a given table, removing all items presented in it.
func CreateEventTable ¶
CreateTable creates a table in the Cassandra cluster which the given session created a connection with.
func CreateSession ¶
func CreateSession(config gocql.ClusterConfig) (*gocql.Session, error)
CreateSession wraps the gocql.NewSession function. It returns a *gocql.Session, which can be used to run queries in an existing Cassandra cluster.
Types ¶
type Cluster ¶
Cluster defines the basic configurations for creation and management of Apache Cassandra databases clusters.
- Hosts defines the addresses of Cassandra's cluster nodes
- Keyspace defines the cluster keyspace (name, identification, alias...)
- ProtocolVersion defines the version of Cassandra communication protocol
func (Cluster) Create ¶
func (c Cluster) Create() gocql.ClusterConfig
CreateCluster wraps the gocql.NewCluster function. It returns a *gocql.ClusterConfig which can be used to create sessions to connect to existing Cassandra clusters.
Click to show internal directories.
Click to hide internal directories.