Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Docker repository. Repository = "mysql" // Default tag. DefaultTag = "8.0.19" // Default database name. DefaultDBName = "tst" // Default root password. DefaultRootPassword = "123456" // Default container expire time. DefaultExpire uint = 120 )
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { // Tag of the repository. Default: DefaultTag. Tag string // The database created when MySQL server starts. Default: DefaultDBName. DBName string // The root password. Default: DefaultRootPassword. RootPassword string // If specified, MySQL data will be mount to this host directory. Default: "". // NOTE: The directory must be either contain an existing MySQL database or completely empty. HostDataPath string // If specified, SQL files inside this host directory will be loaded when MySQL server initialize. Default: "". // NOTE: These files will not be loaded if HostDataPath is specified and contains an existing database. HostInitSQLPath string // If specified, the port 3306/tcp will be mapped to it. Default: random port. HostPort uint16 // Expire time (in seconds) of the container. Default: DefaultExpire. Expire uint // BaseRunOptions is the base options, will be overrided by above. BaseRunOptions dockertest.RunOptions }
Options is options to run a MySQL test server.
type Resource ¶
type Resource struct { // MySQL docker container. *dockertest.Resource // Actual options. Options }
Resource represents a test MySQL server.
func RunFromPool ¶
RunFromPool runs a test MySQL server. If pool is nil, tstsvc.DefaultPool() will be used. If opts is nil, the default options will be used.
Click to show internal directories.
Click to hide internal directories.