databasetest

package
Version: v0.0.0-...-fdd12d1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package databasetest provides tools for launching and preparing databases in Docker containers to be used in tests. It has direct dependencies on the testing package to show that it should not be used for production code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpContainerLogs

func DumpContainerLogs(t *testing.T, c *Container)

DumpContainerLogs runs "docker logs" against the container and send it to t.Log

func StopContainer

func StopContainer(t *testing.T, c *Container)

StopContainer stops and removes the specified container.

Types

type Container

type Container struct {
	ID   string
	Host string // IP:Port
}

Container tracks information about a docker container started for tests.

func StartContainer

func StartContainer(t *testing.T) *Container

StartContainer runs a postgres container to execute commands.

Source Files

Jump to

Keyboard shortcuts

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