Documentation
¶
Index ¶
- func GetBasedir() (string, error)
- type DockerEnv
- func (de *DockerEnv) AddDirectory(path string)
- func (de *DockerEnv) FixPermissions(path string) error
- func (de *DockerEnv) HasBinary(string) bool
- func (de *DockerEnv) IsAvailable() bool
- func (de *DockerEnv) PathFromEnv(path string) (string, error)
- func (de *DockerEnv) PathToEnv(path string) (string, error)
- func (de *DockerEnv) String() string
- func (de *DockerEnv) WrapCommand(cmd *exec.Cmd) error
- type ExecEnv
- type NativeEnv
- func (ne *NativeEnv) FixPermissions(string) error
- func (ne *NativeEnv) HasBinary(name string) bool
- func (ne *NativeEnv) IsAvailable() bool
- func (ne *NativeEnv) PathFromEnv(path string) (string, error)
- func (ne *NativeEnv) PathToEnv(path string) (string, error)
- func (ne *NativeEnv) String() string
- func (ne *NativeEnv) WrapCommand(*exec.Cmd) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBasedir ¶
GetBasedir finds the Git repository root directory and use that as base. If one cannot be found, uses the current working directory.
Types ¶
type DockerEnv ¶
type DockerEnv struct {
// contains filtered or unexported fields
}
DockerEnv is a Docker-based execution environment that executes all commands inside a Docker container using the configured image.
func NewDockerEnv ¶
NewDockerEnv creates a new Docker-based execution environment.
func (*DockerEnv) AddDirectory ¶
AddDirectory exposes a host directory to the container under the same path.
func (*DockerEnv) FixPermissions ¶
FixPermissions implements ExecEnv.
func (*DockerEnv) IsAvailable ¶
IsAvailable implements ExecEnv.
func (*DockerEnv) PathFromEnv ¶
PathFromEnv implements ExecEnv.
type ExecEnv ¶
type ExecEnv interface { // WrapCommand modifies an existing `exec.Cmd` such that it runs in this environment. WrapCommand(cmd *exec.Cmd) error // PathFromEnv converts the given path from inside the environment into a path outside the // environment. PathFromEnv(path string) (string, error) // PathToEnv converts the given path from outside the environment into a path inside the // environment. PathToEnv(path string) (string, error) // FixPermissions ensures that the user executing this process owns the file at the given path // outside the environment. FixPermissions(path string) error // HasBinary returns true iff the given binary name is available in this environment. HasBinary(name string) bool // IsAvailable returns true iff the given execution environment is available. IsAvailable() bool }
ExecEnv is an execution environment.
type NativeEnv ¶
type NativeEnv struct{}
NativeEnv is the native execution environment that executes all commands directly.
func NewNativeEnv ¶
func NewNativeEnv() *NativeEnv
NewNativeEnv creates a new native execution environment.
func (*NativeEnv) FixPermissions ¶
FixPermissions implements ExecEnv.
func (*NativeEnv) IsAvailable ¶
IsAvailable implements ExecEnv.
func (*NativeEnv) PathFromEnv ¶
PathFromEnv implements ExecEnv.