Documentation ¶
Index ¶
- Constants
- func InitDriverImpl(driver string) func(DriverConfig) (Driver, error)
- func ResetEnvVars(envVars []unversioned.EnvVar)
- func SetEnvVars(envVars []unversioned.EnvVar) []unversioned.EnvVar
- type DockerDriver
- func (d *DockerDriver) Destroy()
- func (d *DockerDriver) GetConfig() (unversioned.Config, error)
- func (d *DockerDriver) ProcessCommand(envVars []unversioned.EnvVar, fullCommand []string) (string, string, int, error)
- func (d *DockerDriver) ReadDir(target string) ([]os.FileInfo, error)
- func (d *DockerDriver) ReadFile(target string) ([]byte, error)
- func (d *DockerDriver) SetEnv(envVars []unversioned.EnvVar) error
- func (d *DockerDriver) Setup(envVars []unversioned.EnvVar, fullCommands [][]string) error
- func (d *DockerDriver) StatFile(target string) (os.FileInfo, error)
- func (d *DockerDriver) Teardown(_ [][]string) error
- type Driver
- type DriverConfig
- type HostDriver
- func (d *HostDriver) Destroy()
- func (d *HostDriver) GetConfig() (unversioned.Config, error)
- func (d *HostDriver) ProcessCommand(envVars []unversioned.EnvVar, fullCommand []string) (string, string, int, error)
- func (d *HostDriver) ReadDir(path string) ([]os.FileInfo, error)
- func (d *HostDriver) ReadFile(path string) ([]byte, error)
- func (d *HostDriver) SetEnv(envVars []unversioned.EnvVar) error
- func (d *HostDriver) Setup(envVars []unversioned.EnvVar, fullCommands [][]string) error
- func (d *HostDriver) StatFile(path string) (os.FileInfo, error)
- func (d *HostDriver) Teardown(fullCommands [][]string) error
- type TarDriver
- func (d *TarDriver) Destroy()
- func (d *TarDriver) GetConfig() (unversioned.Config, error)
- func (d *TarDriver) ProcessCommand(_ []unversioned.EnvVar, _ []string) (string, string, int, error)
- func (d *TarDriver) ReadDir(path string) ([]os.FileInfo, error)
- func (d *TarDriver) ReadFile(path string) ([]byte, error)
- func (d *TarDriver) SetEnv(envVars []unversioned.EnvVar) error
- func (d *TarDriver) Setup(_ []unversioned.EnvVar, _ [][]string) error
- func (d *TarDriver) StatFile(path string) (os.FileInfo, error)
- func (d *TarDriver) Teardown(_ [][]string) error
Constants ¶
View Source
const ( Docker = "docker" Tar = "tar" Host = "host" )
Variables ¶
This section is empty.
Functions ¶
func InitDriverImpl ¶
func InitDriverImpl(driver string) func(DriverConfig) (Driver, error)
func ResetEnvVars ¶
func ResetEnvVars(envVars []unversioned.EnvVar)
func SetEnvVars ¶
func SetEnvVars(envVars []unversioned.EnvVar) []unversioned.EnvVar
given a list of environment variable key/value pairs, set these in the current environment. also, keep track of the previous values of these vars to reset after test execution.
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() (unversioned.Config, error)
func (*DockerDriver) ProcessCommand ¶
func (d *DockerDriver) ProcessCommand(envVars []unversioned.EnvVar, fullCommand []string) (string, string, int, error)
func (*DockerDriver) SetEnv ¶ added in v1.2.0
func (d *DockerDriver) SetEnv(envVars []unversioned.EnvVar) error
func (*DockerDriver) Setup ¶
func (d *DockerDriver) Setup(envVars []unversioned.EnvVar, fullCommands [][]string) error
func (*DockerDriver) Teardown ¶
func (d *DockerDriver) Teardown(_ [][]string) error
type Driver ¶
type Driver interface { Setup(envVars []unversioned.EnvVar, fullCommands [][]string) error // Teardown is optional and is only used in the host driver Teardown(fullCommands [][]string) error SetEnv(envVars []unversioned.EnvVar) error // 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(envVars []unversioned.EnvVar, fullCommand []string) (string, string, int, error) StatFile(path string) (os.FileInfo, error) ReadFile(path string) ([]byte, error) ReadDir(path string) ([]os.FileInfo, error) GetConfig() (unversioned.Config, error) Destroy() }
func NewDockerDriver ¶
func NewDockerDriver(args DriverConfig) (Driver, error)
func NewHostDriver ¶
func NewHostDriver(args DriverConfig) (Driver, error)
func NewTarDriver ¶
func NewTarDriver(args DriverConfig) (Driver, error)
type DriverConfig ¶
type DriverConfig struct { Image string // used by Docker/Tar drivers Save bool // used by Docker/Tar drivers Metadata string // used by Host driver Runtime string // used by Docker driver Platform string // used by Docker driver RunOpts unversioned.ContainerRunOptions // used by Docker driver }
type HostDriver ¶
type HostDriver struct { ConfigPath string // path to image metadata config on host fs GlobalVars []unversioned.EnvVar }
func (*HostDriver) Destroy ¶
func (d *HostDriver) Destroy()
func (*HostDriver) GetConfig ¶
func (d *HostDriver) GetConfig() (unversioned.Config, error)
func (*HostDriver) ProcessCommand ¶
func (d *HostDriver) ProcessCommand(envVars []unversioned.EnvVar, fullCommand []string) (string, string, int, error)
func (*HostDriver) SetEnv ¶ added in v1.2.0
func (d *HostDriver) SetEnv(envVars []unversioned.EnvVar) error
func (*HostDriver) Setup ¶
func (d *HostDriver) Setup(envVars []unversioned.EnvVar, fullCommands [][]string) error
func (*HostDriver) Teardown ¶
func (d *HostDriver) Teardown(fullCommands [][]string) error
type TarDriver ¶
func (*TarDriver) ProcessCommand ¶
Click to show internal directories.
Click to hide internal directories.