cassandra

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CQLSession added in v0.1.2

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

CQLSession implements a session to cassandra.

func NewCQLSession added in v0.1.2

func NewCQLSession(ips []string, keyspace string, consistency string, timeout string) (*CQLSession, error)

NewCQLSession returns a populated CQLSession struct, or an error using the underlying cassandra driver.

func (*CQLSession) Close added in v0.1.2

func (s *CQLSession) Close()

Close closes the underlying cassandra session.

func (*CQLSession) ExecIterQuery added in v0.1.2

func (s *CQLSession) ExecIterQuery(query string) (ScanIter, CloseIter)

ExecIterQuery performs an iterated query against the underlying session.

func (*CQLSession) ExecQuery added in v0.1.2

func (s *CQLSession) ExecQuery(query string) error

ExecQuery executes the provided query against the underlying cassandra session.

type CloseIter

type CloseIter func() error

CloseIter is a type returned from ExecIterQuery. When used it wraps the close of the underlying iterator.

type MockCassSession

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

MockCassSession is used in testing.

func (*MockCassSession) Close

func (s *MockCassSession) Close()

Close implements the interface for testing.

func (*MockCassSession) ExecIterQuery

func (s *MockCassSession) ExecIterQuery(query string) (ScanIter, CloseIter)

ExecIterQuery implements the interface for testing.

func (*MockCassSession) ExecQuery

func (s *MockCassSession) ExecQuery(query string) error

ExecQuery implements the interface for testing.

func (*MockCassSession) LastQuery

func (s *MockCassSession) LastQuery() string

LastQuery is used during tests to validate the generated query.

type ScanIter

type ScanIter func(...interface{}) bool

ScanIter defines the function type returned from ExecIterQuery.

type Session

type Session interface {
	ExecQuery(string) error
	ExecIterQuery(query string) (ScanIter, CloseIter)
	Close()
}

Session is an interface that describes the surface area of interacting with a cassandra store.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳