Documentation ¶
Index ¶
- Constants
- func ExtractProperties(zippath string) (map[string]string, error)
- func GetKeyspace(session *gocql.Session) string
- func GetKeyspaceTableNames(session *gocql.Session, keyspace string) ([]string, error)
- func GetSession(username, password, pathToZip string) (*gocql.Session, error)
- func NewCluster(username, password, pathToZip string) (*gocql.ClusterConfig, error)
- func NewClusterFromProperties(...) (*gocql.ClusterConfig, error)
Constants ¶
const ( PropertyHostname = "hostname" PropertyPort = "port" PropertyKeyspace = "keyspace" PropertyCert = "certPEMBlock" PropertyKey = "keyPemBlock" PropertyCaCrt = "pemCerts" )
Names of properties returned by ExtractProperties()
Variables ¶
This section is empty.
Functions ¶
func ExtractProperties ¶
ExtractProperties parses through various files in the creds zip and returns a map of properties needed in order to connect to the database. Values of cert related properties are encoded in base64.
func GetKeyspace ¶
GetKeyspace returns the default keyspace which was specified when the database was created. This will return an empty string if the session has not yet been properly initialized.
func GetKeyspaceTableNames ¶
GetKeyspaceTableNames returns a slice containing the names of all the tables found associated with the specified keyspace. If there are problems finding the information, an error is returned. If the keyspace does not exist or does not contain any tables, an empty slice will be returned.
func GetSession ¶
GetSession creates and returns a gocql.Session that can be used to access the database.
func NewCluster ¶
func NewCluster(username, password, pathToZip string) (*gocql.ClusterConfig, error)
NewCluster creates a returns a Cluster Config that and be modified and used to create a session.
func NewClusterFromProperties ¶
func NewClusterFromProperties(username, password, hostname, port, keyspace, certPEMBlock, keyPemBlock, pemCerts string) (*gocql.ClusterConfig, error)
NewClusterFromProperties creates a returns a Cluster Config that and be modified and used to create a session. The certPEMBlock, keyPemBlock, and pemCerts property values should be base64 encoded.
Types ¶
This section is empty.