gocql

package
v1.23.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 27 Imported by: 2

Documentation

Overview

Package gocql is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureCassandraCluster added in v1.20.1

func ConfigureCassandraCluster(cfg config.Cassandra, cluster *gocql.ClusterConfig) error

Modifies the input cluster config in place.

func ConvertError

func ConvertError(
	operation string,
	err error,
) error

func IsNotFoundError

func IsNotFoundError(err error) bool

func NewCassandraCluster

func NewCassandraCluster(
	cfg config.Cassandra,
	resolver resolver.ServiceResolver,
) (*gocql.ClusterConfig, error)

func NewSession

func NewSession(
	newClusterConfigFunc func() (*gocql.ClusterConfig, error),
	logger log.Logger,
	metricsHandler metrics.Handler,
) (*session, error)

func UUIDToString

func UUIDToString(
	item interface{},
) string

func UUIDsToStringSlice added in v1.14.0

func UUIDsToStringSlice(
	item interface{},
) []string

Types

type Batch

type Batch interface {
	Query(string, ...interface{})
	WithContext(context.Context) Batch
	WithTimestamp(int64) Batch
}

Batch is the interface for batch operation.

type BatchType

type BatchType byte

BatchType is the type of the Batch operation

const (
	LoggedBatch BatchType = iota
	UnloggedBatch
	CounterBatch
)

Definition of all BatchTypes

type Consistency

type Consistency uint16

Consistency is the consistency level used by a Query

const (
	Any Consistency = iota
	One
	Two
	Three
	Quorum
	All
	LocalQuorum
	EachQuorum
	LocalOne
)

Definition of all Consistency levels

type Iter

type Iter interface {
	Scan(...interface{}) bool
	MapScan(map[string]interface{}) bool
	PageState() []byte
	Close() error
}

Iter is the interface for executing and iterating over all resulting rows.

type MockBatch

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

MockBatch is a mock of Batch interface.

func NewMockBatch

func NewMockBatch(ctrl *gomock.Controller) *MockBatch

NewMockBatch creates a new mock instance.

func (*MockBatch) EXPECT

func (m *MockBatch) EXPECT() *MockBatchMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockBatch) Query

func (m *MockBatch) Query(arg0 string, arg1 ...interface{})

Query mocks base method.

func (*MockBatch) WithContext

func (m *MockBatch) WithContext(arg0 context.Context) Batch

WithContext mocks base method.

func (*MockBatch) WithTimestamp

func (m *MockBatch) WithTimestamp(arg0 int64) Batch

WithTimestamp mocks base method.

type MockBatchMockRecorder

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

MockBatchMockRecorder is the mock recorder for MockBatch.

func (*MockBatchMockRecorder) Query

func (mr *MockBatchMockRecorder) Query(arg0 interface{}, arg1 ...interface{}) *gomock.Call

Query indicates an expected call of Query.

func (*MockBatchMockRecorder) WithContext

func (mr *MockBatchMockRecorder) WithContext(arg0 interface{}) *gomock.Call

WithContext indicates an expected call of WithContext.

func (*MockBatchMockRecorder) WithTimestamp

func (mr *MockBatchMockRecorder) WithTimestamp(arg0 interface{}) *gomock.Call

WithTimestamp indicates an expected call of WithTimestamp.

type MockIter

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

MockIter is a mock of Iter interface.

func NewMockIter

func NewMockIter(ctrl *gomock.Controller) *MockIter

NewMockIter creates a new mock instance.

func (*MockIter) Close

func (m *MockIter) Close() error

Close mocks base method.

func (*MockIter) EXPECT

func (m *MockIter) EXPECT() *MockIterMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockIter) MapScan

func (m *MockIter) MapScan(arg0 map[string]interface{}) bool

MapScan mocks base method.

func (*MockIter) PageState

func (m *MockIter) PageState() []byte

PageState mocks base method.

func (*MockIter) Scan

func (m *MockIter) Scan(arg0 ...interface{}) bool

Scan mocks base method.

type MockIterMockRecorder

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

MockIterMockRecorder is the mock recorder for MockIter.

func (*MockIterMockRecorder) Close

func (mr *MockIterMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockIterMockRecorder) MapScan

func (mr *MockIterMockRecorder) MapScan(arg0 interface{}) *gomock.Call

MapScan indicates an expected call of MapScan.

func (*MockIterMockRecorder) PageState

func (mr *MockIterMockRecorder) PageState() *gomock.Call

PageState indicates an expected call of PageState.

func (*MockIterMockRecorder) Scan

func (mr *MockIterMockRecorder) Scan(arg0 ...interface{}) *gomock.Call

Scan indicates an expected call of Scan.

type MockQuery

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

MockQuery is a mock of Query interface.

func NewMockQuery

func NewMockQuery(ctrl *gomock.Controller) *MockQuery

NewMockQuery creates a new mock instance.

func (*MockQuery) Bind

func (m *MockQuery) Bind(arg0 ...interface{}) Query

Bind mocks base method.

func (*MockQuery) Consistency

func (m *MockQuery) Consistency(arg0 Consistency) Query

Consistency mocks base method.

func (*MockQuery) EXPECT

func (m *MockQuery) EXPECT() *MockQueryMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockQuery) Exec

func (m *MockQuery) Exec() error

Exec mocks base method.

func (*MockQuery) Iter

func (m *MockQuery) Iter() Iter

Iter mocks base method.

func (*MockQuery) MapScan

func (m *MockQuery) MapScan(arg0 map[string]interface{}) error

MapScan mocks base method.

func (*MockQuery) MapScanCAS

func (m *MockQuery) MapScanCAS(arg0 map[string]interface{}) (bool, error)

MapScanCAS mocks base method.

func (*MockQuery) PageSize

func (m *MockQuery) PageSize(arg0 int) Query

PageSize mocks base method.

func (*MockQuery) PageState

func (m *MockQuery) PageState(arg0 []byte) Query

PageState mocks base method.

func (*MockQuery) Scan

func (m *MockQuery) Scan(arg0 ...interface{}) error

Scan mocks base method.

func (*MockQuery) ScanCAS

func (m *MockQuery) ScanCAS(arg0 ...interface{}) (bool, error)

ScanCAS mocks base method.

func (*MockQuery) WithContext

func (m *MockQuery) WithContext(arg0 context.Context) Query

WithContext mocks base method.

func (*MockQuery) WithTimestamp

func (m *MockQuery) WithTimestamp(arg0 int64) Query

WithTimestamp mocks base method.

type MockQueryMockRecorder

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

MockQueryMockRecorder is the mock recorder for MockQuery.

func (*MockQueryMockRecorder) Bind

func (mr *MockQueryMockRecorder) Bind(arg0 ...interface{}) *gomock.Call

Bind indicates an expected call of Bind.

func (*MockQueryMockRecorder) Consistency

func (mr *MockQueryMockRecorder) Consistency(arg0 interface{}) *gomock.Call

Consistency indicates an expected call of Consistency.

func (*MockQueryMockRecorder) Exec

func (mr *MockQueryMockRecorder) Exec() *gomock.Call

Exec indicates an expected call of Exec.

func (*MockQueryMockRecorder) Iter

func (mr *MockQueryMockRecorder) Iter() *gomock.Call

Iter indicates an expected call of Iter.

func (*MockQueryMockRecorder) MapScan

func (mr *MockQueryMockRecorder) MapScan(arg0 interface{}) *gomock.Call

MapScan indicates an expected call of MapScan.

func (*MockQueryMockRecorder) MapScanCAS

func (mr *MockQueryMockRecorder) MapScanCAS(arg0 interface{}) *gomock.Call

MapScanCAS indicates an expected call of MapScanCAS.

func (*MockQueryMockRecorder) PageSize

func (mr *MockQueryMockRecorder) PageSize(arg0 interface{}) *gomock.Call

PageSize indicates an expected call of PageSize.

func (*MockQueryMockRecorder) PageState

func (mr *MockQueryMockRecorder) PageState(arg0 interface{}) *gomock.Call

PageState indicates an expected call of PageState.

func (*MockQueryMockRecorder) Scan

func (mr *MockQueryMockRecorder) Scan(arg0 ...interface{}) *gomock.Call

Scan indicates an expected call of Scan.

func (*MockQueryMockRecorder) ScanCAS

func (mr *MockQueryMockRecorder) ScanCAS(arg0 ...interface{}) *gomock.Call

ScanCAS indicates an expected call of ScanCAS.

func (*MockQueryMockRecorder) WithContext

func (mr *MockQueryMockRecorder) WithContext(arg0 interface{}) *gomock.Call

WithContext indicates an expected call of WithContext.

func (*MockQueryMockRecorder) WithTimestamp

func (mr *MockQueryMockRecorder) WithTimestamp(arg0 interface{}) *gomock.Call

WithTimestamp indicates an expected call of WithTimestamp.

type MockSession

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

MockSession is a mock of Session interface.

func NewMockSession

func NewMockSession(ctrl *gomock.Controller) *MockSession

NewMockSession creates a new mock instance.

func (*MockSession) AwaitSchemaAgreement

func (m *MockSession) AwaitSchemaAgreement(ctx context.Context) error

AwaitSchemaAgreement mocks base method.

func (*MockSession) Close

func (m *MockSession) Close()

Close mocks base method.

func (*MockSession) EXPECT

func (m *MockSession) EXPECT() *MockSessionMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSession) ExecuteBatch

func (m *MockSession) ExecuteBatch(arg0 Batch) error

ExecuteBatch mocks base method.

func (*MockSession) MapExecuteBatchCAS

func (m *MockSession) MapExecuteBatchCAS(arg0 Batch, arg1 map[string]interface{}) (bool, Iter, error)

MapExecuteBatchCAS mocks base method.

func (*MockSession) NewBatch

func (m *MockSession) NewBatch(arg0 BatchType) Batch

NewBatch mocks base method.

func (*MockSession) Query

func (m *MockSession) Query(arg0 string, arg1 ...interface{}) Query

Query mocks base method.

type MockSessionMockRecorder

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

MockSessionMockRecorder is the mock recorder for MockSession.

func (*MockSessionMockRecorder) AwaitSchemaAgreement

func (mr *MockSessionMockRecorder) AwaitSchemaAgreement(ctx interface{}) *gomock.Call

AwaitSchemaAgreement indicates an expected call of AwaitSchemaAgreement.

func (*MockSessionMockRecorder) Close

func (mr *MockSessionMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockSessionMockRecorder) ExecuteBatch

func (mr *MockSessionMockRecorder) ExecuteBatch(arg0 interface{}) *gomock.Call

ExecuteBatch indicates an expected call of ExecuteBatch.

func (*MockSessionMockRecorder) MapExecuteBatchCAS

func (mr *MockSessionMockRecorder) MapExecuteBatchCAS(arg0, arg1 interface{}) *gomock.Call

MapExecuteBatchCAS indicates an expected call of MapExecuteBatchCAS.

func (*MockSessionMockRecorder) NewBatch

func (mr *MockSessionMockRecorder) NewBatch(arg0 interface{}) *gomock.Call

NewBatch indicates an expected call of NewBatch.

func (*MockSessionMockRecorder) Query

func (mr *MockSessionMockRecorder) Query(arg0 interface{}, arg1 ...interface{}) *gomock.Call

Query indicates an expected call of Query.

type Query

type Query interface {
	Exec() error
	Scan(...interface{}) error
	ScanCAS(...interface{}) (bool, error)
	MapScan(map[string]interface{}) error
	MapScanCAS(map[string]interface{}) (bool, error)
	Iter() Iter
	PageSize(int) Query
	PageState([]byte) Query
	WithContext(context.Context) Query
	WithTimestamp(int64) Query
	Consistency(Consistency) Query
	Bind(...interface{}) Query
}

Query is the interface for query object.

type SerialConsistency

type SerialConsistency uint16

SerialConsistency is the serial consistency level used by a Query

const (
	Serial SerialConsistency = iota
	LocalSerial
)

Definition of all SerialConsistency levels

type Session

type Session interface {
	Query(string, ...interface{}) Query
	NewBatch(BatchType) Batch
	ExecuteBatch(Batch) error
	MapExecuteBatchCAS(Batch, map[string]interface{}) (bool, Iter, error)
	AwaitSchemaAgreement(ctx context.Context) error
	Close()
}

Session is the interface for interacting with the database.

Jump to

Keyboard shortcuts

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