envs

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package envs is the set of any environments you want to up & down when testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

type Runner interface {
	// Up runner to setup environment.
	Up(tb testing.TB) error

	// Down runner to teardown envirment.
	Down(tb testing.TB) error
}

Runner is a executor to up & down the environment required for testing.

type Runners

type Runners []Runner

Runners is alias of array of Runner and support functions to operation easily.

runners := New()
runners = runners.Add(runner1, runner2)
err := runners.Up(t)
assert.Nil(t, err)
err = runners.Down(t)
assert.Nil(t, err)

func New

func New() Runners

func (Runners) Add

func (rs Runners) Add(runners ...Runner) Runners

Add non-nil runners.

func (Runners) Down

func (rs Runners) Down(tb testing.TB) error

Down with reverse order.

func (Runners) Up

func (rs Runners) Up(tb testing.TB) error

Up with forwarding order.

Directories

Path Synopsis
Package dockercompose is a runner to up & down environment through Docker-Compose.
Package dockercompose is a runner to up & down environment through Docker-Compose.
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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