cassandra

package
v0.0.0-...-e119815 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2019 License: MIT Imports: 5 Imported by: 10

README

GoDoc

Manage Cassandra schema

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKeyspace

func CreateKeyspace(c *gocql.ClusterConfig, ks string, rs string, rf int) error

CreateKeyspace creates a keyspace if necessary ks -> keyspace name rs -> replication strategy class rf -> replication factor

func CreateKeyspaceWithNetworkTopologyStrategy

func CreateKeyspaceWithNetworkTopologyStrategy(c *gocql.ClusterConfig, ks string, rfmap map[string]uint) error

CreateKeyspaceWithNetworkTopologyStrategy creates a keyspace if necesary with NetworkTopologyStrategy ks -> keyspace name rfmap -> map of datacenter name to replication factor for that DC

func CreateRequiredTables

func CreateRequiredTables(c *gocql.ClusterConfig, rt []CTable) error

CreateRequiredTables ensures all the tables passed in are created if necessary

func CreateRequiredTypes

func CreateRequiredTypes(c *gocql.ClusterConfig, rt []UDT) error

CreateRequiredTypes ensures all the types passed in are created if necessary

func CreateTable

func CreateTable(c *gocql.ClusterConfig, t CTable) error

CreateTable creates a table

func CreateUDT

func CreateUDT(c *gocql.ClusterConfig, u UDT) error

CreateUDT creates a user-defined type

func DropKeyspace

func DropKeyspace(c *gocql.ClusterConfig, ks string) error

DropKeyspace deletes a keyspace and all data associated with it

func GetKeyspaces

func GetKeyspaces(c *gocql.ClusterConfig) ([]string, error)

GetKeyspaces returns all extant keyspaces

func GetTables

func GetTables(c *gocql.ClusterConfig) ([]string, error)

GetTables returns all tables in configured keyspace

Types

type CTable

type CTable struct {
	Name    string
	Columns []string
	Options string
}

CTable is a Cassandra table definition

type UDT

type UDT struct {
	Name    string
	Columns []string
}

UDT is a user-defined type

Jump to

Keyboard shortcuts

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