Documentation ¶
Overview ¶
The base environment for RDB testing
Flags ¶
This package has pre-defined flags of command:
-dsn_mysql - MySQL DSN used to intialize configuration of mysql connection
Index ¶
- func GetDbConfig(c *check.C) *commonDb.DbConfig
- func HasDbEnvForMysqlOrSkip(c *check.C) bool
- func InitDbFacade(c *check.C) *f.DbFacade
- func ReleaseDbFacade(c *check.C, dbFacade *f.DbFacade)
- func SetupByViableDbConfig(c *check.C, configFunc ViableDbConfigFunc) bool
- type GinkgoDb
- type ViableDbConfigFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDbConfig ¶
Gets the database configuration or skip the testing(depends on "gopkg.in/check.v1").
If the environment is not ready(flag is empty), this function returns "nil"
func HasDbEnvForMysqlOrSkip ¶
Checks whether or not skipping testing by viable arguments.
If the environment is not ready(flag is empty), this function returns false value.
func InitDbFacade ¶
Constructs "*db/facade/DbFacade" object by configuration of flag.
The checker object is used to trigger panic if the database cannot be opened.
If the environment is not ready(flag is empty), this function returns "nil"
func ReleaseDbFacade ¶
Releases "*db/facade/DbFacade" object by configuration of flag.
The checker object is used to trigger panic if the database cannot be released.
func SetupByViableDbConfig ¶
func SetupByViableDbConfig(c *check.C, configFunc ViableDbConfigFunc) bool
This function is used to:
- Check whether or not the configuration o "dsn_mysql" has been supplied
- If it does, supply the data of configuration to callback function
Types ¶
type GinkgoDb ¶
type GinkgoDb struct{}
func (*GinkgoDb) GetDbConfig ¶
func (*GinkgoDb) InitDbFacade ¶
Constructs "*db/facade/DbFacade" object by configuration of flag.
The checker object is used to trigger panic if the database cannot be opened.
If the environment is not ready(flag is empty), this function returns "nil"
func (*GinkgoDb) ReleaseDbFacade ¶
Releases "*db/facade/DbFacade" object by configuration of flag.
The checker object is used to trigger panic if the database cannot be released.
type ViableDbConfigFunc ¶
This callback is used to setup a viable database configuration for testing.