db_wrapper

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iter

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

Iter is a wrapper for an iter for mockability.

func (*Iter) Close

func (i *Iter) Close() error

Close wraps iter's Close method

func (*Iter) MapScan

func (i *Iter) MapScan(m map[string]interface{}) bool

MapScan wraps iter's MapScan method

func (*Iter) PageState

func (i *Iter) PageState() []byte

PageState wraps iter's PageState method

func (*Iter) Scan

func (i *Iter) Scan(dest ...interface{}) bool

Scan wraps iter's Scan method

type IterInterface

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

IterInterface allows gomock mock of gocql.Iter

func NewIter

func NewIter(iter *gocql.Iter) IterInterface

NewIter instantiates a new Iter

type Query

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

Query is a wrapper for a query for mockability.

func (*Query) Bind

func (q *Query) Bind(v ...interface{}) QueryInterface

Bind wraps the query's Bind method

func (*Query) Consistency

func (q *Query) Consistency(c gocql.Consistency) QueryInterface

Consistency wraps the query's Consistency method

func (*Query) Exec

func (q *Query) Exec() error

Exec wraps the query's Exec method

func (*Query) Iter

func (q *Query) Iter() IterInterface

Iter wraps the query's Iter method

func (*Query) MapScan

func (q *Query) MapScan(m map[string]interface{}) error

MapScan wraps the query's MapScan method

func (*Query) PageSize

func (q *Query) PageSize(n int) QueryInterface

PageSize wraps the query's PageSize method

func (*Query) PageState

func (q *Query) PageState(state []byte) QueryInterface

PageState wraps the query's PageState method

func (*Query) RetryPolicy

func (q *Query) RetryPolicy(policy gocql.RetryPolicy) QueryInterface

RetryPolicy wraps the query's RetryPolicy method

func (*Query) Scan

func (q *Query) Scan(dest ...interface{}) error

Scan wraps the query's Scan method

type QueryInterface

type QueryInterface interface {
	Bind(...interface{}) QueryInterface
	Exec() error
	Iter() IterInterface
	Scan(...interface{}) error
	MapScan(m map[string]interface{}) error
	Consistency(c gocql.Consistency) QueryInterface
	PageState(state []byte) QueryInterface
	PageSize(n int) QueryInterface
	RetryPolicy(policy gocql.RetryPolicy) QueryInterface
}

QueryInterface allows gomock mock of gocql.Query

func NewQuery

func NewQuery(query *gocql.Query) QueryInterface

NewQuery instantiates a new Query

type Session

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

Session is a wrapper for a session for mockability.

func (*Session) Close

func (s *Session) Close()

Close wraps the session's Close method

func (*Session) ExecuteBatch

func (s *Session) ExecuteBatch(batch *gocql.Batch) error

ExecuteBatch wraps the session's ExecuteBatch method

func (*Session) Query

func (s *Session) Query(stmt string, values ...interface{}) QueryInterface

Query wraps the session's Query method

type SessionInterface

type SessionInterface interface {
	Query(string, ...interface{}) QueryInterface
	ExecuteBatch(batch *gocql.Batch) error
	Close()
}

SessionInterface allows gomock mock of gocql.Session

func NewSession

func NewSession(session *gocql.Session) SessionInterface

NewSession instantiates a new Session

Jump to

Keyboard shortcuts

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