keyspaces

package
v0.0.0-...-e45c2a7 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package keyspaces is for working with AWS Keyspaces (for Apache Cassandra).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(l Logger)

SetLogger allows calling code to set a desired Logger to receive logs from this package (eg: log.Default())

Types

type Keyspaces

type Keyspaces struct {
	// contains filtered or unexported fields
}

func New

func New(host, certPath string) (Keyspaces, error)

New returns a Keyspaces struct which wraps a Keyspaces session. host to connect to eg: cassandra.ap-southeast-2.amazonaws.com:9142 certPath is the path of the required Starfield digital certificate to connect to Keyspaces using SSL/TLS (found here: https://certs.secureserver.net/repository/sf-class2-root.crt)

func (*Keyspaces) ExecuteQuery

func (k *Keyspaces) ExecuteQuery(query string, values []interface{}) error

ExecuteQuery executes the provided query on the database.

func (*Keyspaces) QueryDatabase

func (k *Keyspaces) QueryDatabase(query string, values []interface{}) gocql.Scanner

QueryDatabase queries the database with provided query, and returns a Scanner to iterate through the results.

func (*Keyspaces) RefreshSessionEvery

func (k *Keyspaces) RefreshSessionEvery(d time.Duration)

RefreshSessionEvery starts up a loop that replaces the client's session with a new one regularly. This can be only set once.

type Logger

type Logger interface {
	Println(v ...interface{})
	Printf(format string, v ...interface{})
}

Jump to

Keyboard shortcuts

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