test

package
v3.15.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2018 License: Apache-2.0, Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbForTest *sql.DB

Functions

func DefaultListenAndExecute

func DefaultListenAndExecute(
	rcvr interface{}, rpcCallback func(*RpcTestEnv),
)

func ExecuteInTx

func ExecuteInTx(txCallback func(*sql.Tx))

IoC execution(in transaction)

func ExecuteOrFail

func ExecuteOrFail(query string, args ...interface{}) sql.Result

IoC execution

func ExecuteQueriesOrFailInTx

func ExecuteQueriesOrFailInTx(queries ...string)

IoC execution(in transaction)

func InitDb

func InitDb(c *check.C)

func QueryForRow

func QueryForRow(
	rowCallback func(row *sql.Row),
	sqlQuery string, args ...interface{},
)

IoC Callback for row This method would use sql.DB.QueryRow method to retrive data

func QueryForRows

func QueryForRows(
	rowsCallback func(row *sql.Rows),
	sqlQuery string, args ...interface{},
)

IoC Callback for rows This method would use sql.DB.Query method to retrive data

func ReleaseDb

func ReleaseDb(c *check.C)

Types

type RpcTestEnv

type RpcTestEnv struct {
	Port      int
	RpcClient *rpc.Client
	// contains filtered or unexported fields
}

func (*RpcTestEnv) ListenAndExecute

func (rpcTestEnvInstance *RpcTestEnv) ListenAndExecute(
	rcvr interface{}, rpcCallback func(*RpcTestEnv),
)

Jump to

Keyboard shortcuts

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