drivers

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDriverImpl

func InitDriverImpl(driver string) func(string) (Driver, error)

Types

type DockerDriver

type DockerDriver struct {
	// contains filtered or unexported fields
}

func (*DockerDriver) Destroy

func (d *DockerDriver) Destroy()

func (*DockerDriver) GetConfig

func (d *DockerDriver) GetConfig(t *testing.T) (unversioned.Config, error)

func (*DockerDriver) ProcessCommand

func (d *DockerDriver) ProcessCommand(t *testing.T, envVars []unversioned.EnvVar, fullCommand []string) (string, string, int)

func (*DockerDriver) ReadDir

func (d *DockerDriver) ReadDir(t *testing.T, target string) ([]os.FileInfo, error)

func (*DockerDriver) ReadFile

func (d *DockerDriver) ReadFile(t *testing.T, target string) ([]byte, error)

func (*DockerDriver) Setup

func (d *DockerDriver) Setup(t *testing.T, envVars []unversioned.EnvVar, fullCommands []unversioned.Command)

func (*DockerDriver) StatFile

func (d *DockerDriver) StatFile(t *testing.T, target string) (os.FileInfo, error)

type Driver

type Driver interface {
	Setup(t *testing.T, envVars []unversioned.EnvVar, fullCommand []unversioned.Command)

	// given an array of command parts, construct a full command and execute it against the
	// current environment. a list of environment variables can be passed to be set in the
	// environment before the command is executed. additionally, a boolean flag is passed
	// to specify whether or not we care about the output of the command.
	ProcessCommand(t *testing.T, envVars []unversioned.EnvVar, fullCommand []string) (string, string, int)

	StatFile(t *testing.T, path string) (os.FileInfo, error)

	ReadFile(t *testing.T, path string) ([]byte, error)

	ReadDir(t *testing.T, path string) ([]os.FileInfo, error)

	GetConfig(t *testing.T) (unversioned.Config, error)

	Destroy()
}

func NewDockerDriver

func NewDockerDriver(image string) (Driver, error)

func NewTarDriver

func NewTarDriver(imageName string) (Driver, error)

type TarDriver

type TarDriver struct {
	Image pkgutil.Image
}

func (*TarDriver) Destroy

func (d *TarDriver) Destroy()

func (*TarDriver) GetConfig

func (d *TarDriver) GetConfig(t *testing.T) (unversioned.Config, error)

func (*TarDriver) ProcessCommand

func (d *TarDriver) ProcessCommand(t *testing.T, envVars []unversioned.EnvVar, fullCommand []string) (string, string, int)

func (*TarDriver) ReadDir

func (d *TarDriver) ReadDir(t *testing.T, path string) ([]os.FileInfo, error)

func (*TarDriver) ReadFile

func (d *TarDriver) ReadFile(t *testing.T, path string) ([]byte, error)

func (*TarDriver) Setup

func (d *TarDriver) Setup(t *testing.T, envVars []unversioned.EnvVar, fullCommand []unversioned.Command)

func (*TarDriver) StatFile

func (d *TarDriver) StatFile(t *testing.T, path string) (os.FileInfo, error)

Jump to

Keyboard shortcuts

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