easycass

package
v0.0.0-...-7f6e482 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
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

func ExtractProperties(zippath string) (map[string]string, error)

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

func GetKeyspace(session *gocql.Session) string

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

func GetKeyspaceTableNames(session *gocql.Session, keyspace string) ([]string, error)

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

func GetSession(username, password, pathToZip string) (*gocql.Session, error)

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.

Jump to

Keyboard shortcuts

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