Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterDriver ¶
type ClusterDriver struct { // If defined, the #CreateSession function will throw this error. CreateSessionError string // This function gets executed by #CreateSession function // and can be used for mocking tests. // This function is always executed by #CreateSession if defined. MockCreateSession func() }
ClusterDriver creates a mock gocql.ClusterConfig.
func (*ClusterDriver) CreateSession ¶
func (cd *ClusterDriver) CreateSession() (*cql.Session, error)
CreateSession mocks the session-creation function for CassandraDriver. This function internally executes #MockCreationSession function.
type Iterx ¶
type Iterx struct { CqlQuery driver.QueryI MockClose func() error MockSelect func(dest interface{}) error }
Iterx mocks the gocqlx Iterx
type Query ¶
type Query struct { // If defined, the #Exec function will throw this error. ExecError string MockExec func() MockGetPageSize func() uint MockSetPageSize func(size uint) MockRelease func() WrappedQuery *cql.Query // contains filtered or unexported fields }
Query mocks the implementation for session-query.
func (*Query) GetPageSize ¶
GetPageSize mocks fetching the current page-size. Being a mock, this doesn't actually store/track current page style. Use the function #SetPageSize along with this to completely mock page-size.
func (*Query) GoCqlQuery ¶ added in v1.1.1
GoCqlQuery mocks the getter for wrapped GoCql-Query. The WrappedQuery member of Query must be explicitely set, else this will return a gocql.Query with just statement set.
func (*Query) Release ¶
func (q *Query) Release()
Release mocks the #Release function driver.Query. It releases the query. Released queries cannot be reused.
func (*Query) SetPageSize ¶
SetPageSize mocks the #SetPageSize function of driver.Query. SetPageSize tells the iterator to fetch the result in pages of size n. This is useful for iterating over large result sets.
type Queryx ¶
type Queryx struct { ColumnNames []string ExecError string CqlQuery driver.QueryI // Mock functions, called when respective implementations are executed MockBindMap func(arg map[string]interface{}) MockBindStruct func() MockExecRelease func() }
Queryx mocks the gocqlx Queryx
func (*Queryx) BindMap ¶
BindMap mocks the map-binding for QueryxI. This binds query named parameters using Map.
func (*Queryx) BindStruct ¶
BindStruct mocks the struct-binding for QueryxI. This binds query named parameters to values from arg using mapper. If value cannot be found an error is reported.
func (*Queryx) ExecRelease ¶
ExecRelease mocks the query execution and release for QueryxI