Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockExecRuntime ¶
type MockExecRuntime struct { SyscallExecRuntime // contains filtered or unexported fields }
MockExecRuntime wraps a SyscallExecRuntime, intercepting the exec call for testing
func WithMockExec ¶
func WithMockExec(e SyscallExecRuntime, execResult error) *MockExecRuntime
WithMockExec wraps a specified SyscallExecRuntime with a mocked exec function for testing
type MockSpec ¶
MockSpec provides a simple mock for an OCI spec to be used in testing. It also implements the SpecModifier interface.
func NewMockSpec ¶
NewMockSpec constructs a MockSpec to be used in testing as a Spec
func (*MockSpec) Flush ¶
Flush invokes the mocked Load function to return the predefined error / result
func (*MockSpec) Load ¶
Load invokes the mocked Load function to return the predefined error / result
func (*MockSpec) Modify ¶
func (s *MockSpec) Modify(f SpecModifier) error
Modify applies the specified SpecModifier to the spec and invokes the mocked modify function to return the predefined error / result.
type Runtime ¶
Runtime is an interface for a runtime shim. The Exec method accepts a list of command line arguments, and returns an error / nil.
func NewSyscallExecRuntime ¶
NewSyscallExecRuntime creates a SyscallExecRuntime for the specified path with the standard logger
type Spec ¶
type Spec interface { Load() error Flush() error Modify(SpecModifier) error }
Spec defines the operations to be performed on an OCI specification
func NewSpecFromFile ¶
NewSpecFromFile creates an object that encapsulates a file-backed OCI spec. This can be used to read from the file, modify the spec, and write to the same file.
type SpecModifier ¶
SpecModifier is a function that accepts a pointer to an OCI Srec and returns an error. The intention is that the function would modify the spec in-place.
type SyscallExecRuntime ¶
type SyscallExecRuntime struct {
// contains filtered or unexported fields
}
SyscallExecRuntime wraps the path that a binary and defines the semanitcs for how to exec into it. This can be used to wrap an OCI-compliant low-level runtime binary, allowing it to be used through the Runtime internface.
func (SyscallExecRuntime) Exec ¶
func (s SyscallExecRuntime) Exec(args []string) error
Exec exces into the binary at the path from the SyscallExecRuntime struct, passing it the supplied arguments after ensuring that the first argument is the path of the target binary.