cassandra

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ClusterHosts []string
	// Keyspace to be used when doing I/O to cassandra.
	Keyspace string
}

type Connection

type Connection struct {
	Session *gocql.Session
	Config
}

func GetConnection

func GetConnection(config Config) (*Connection, error)

GetConnection will create(& return) a new Connection to Cassandra if there is not one yet, otherwise, will just return existing singleton connection.

type TransactionSession

type TransactionSession struct {
	TransactionID *btree.UUID
	Started       *bool
}

func (*TransactionSession) Begin

func (trans *TransactionSession) Begin() error

func (*TransactionSession) CommitPhase1

func (trans *TransactionSession) CommitPhase1() error

CommitPhase1 commits all changes to each Btree modified during transaction.

func (*TransactionSession) CommitPhase2

func (trans *TransactionSession) CommitPhase2() error

CommitPhase2 finalize commits of each Btree modified during transaction.

func (*TransactionSession) Rollback

func (trans *TransactionSession) Rollback() error

Rollback undoes any changes done to each Btree modified during transaction.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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