dockertest

package module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: MIT Imports: 10 Imported by: 0

README

Docker Test

Master CI

hard working man

This is a docker lib test which allow to run db containers for integration tests

Documentation

Index

Constants

View Source
const (
	MySQLUsername = "root"
	MySQLPassword = "root"

	PostgresUsername = "docker" // set up by the dockerfile of postgresImage
	PostgresPassword = "docker" // set up by the dockerfile of postgresImage
)

Variables

This section is empty.

Functions

func IP

func IP(containerID string) (string, error)

IP returns the IP address of the container.

func KillContainer

func KillContainer(container string) error

func Pull

func Pull(image string) error

Pull retrieves the docker image with 'docker pull'.

Types

type ContainerID

type ContainerID string

func StartMongoContainer added in v0.4.0

func StartMongoContainer() (c ContainerID, ip string)

StartMongoContainer

func StartMySQLContainer added in v0.4.0

func StartMySQLContainer(dbname string) (c ContainerID, ip string)

StartMySQLContainer sets up a real MySQL instance for testing purposes,

func StartPostgreSQLContainer added in v0.4.0

func StartPostgreSQLContainer(dbname string) (c ContainerID, ip string)

StartPostgreSQLContainer sets up a real PostgreSQL instance for testing purposes,

func (ContainerID) IP

func (c ContainerID) IP() (string, error)

func (ContainerID) Kill

func (c ContainerID) Kill() error

func (ContainerID) KillRemove

func (c ContainerID) KillRemove()

KillRemove calls Kill on the container, and then Remove if there was no error. It logs any error to t.

func (ContainerID) Remove

func (c ContainerID) Remove() error

Remove runs "docker rm" on the container

Jump to

Keyboard shortcuts

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