Documentation
¶
Index ¶
- type MockRuntime
- func (m *MockRuntime) Create(ctx context.Context, id string, cfg runtime.SandboxConfig) error
- func (m *MockRuntime) Exec(ctx context.Context, id string, opts runtime.ExecOpts) (*runtime.ExecResult, error)
- func (m *MockRuntime) ExecStream(ctx context.Context, id string, opts runtime.ExecOpts) (runtime.ExecStream, error)
- func (m *MockRuntime) Info(ctx context.Context, id string) (*runtime.SandboxInfo, error)
- func (m *MockRuntime) List(ctx context.Context) ([]runtime.SandboxInfo, error)
- func (m *MockRuntime) ListDir(ctx context.Context, id string, path string) ([]runtime.FileInfo, error)
- func (m *MockRuntime) ListSnapshots(ctx context.Context, sandboxID string) ([]runtime.SnapshotInfo, error)
- func (m *MockRuntime) MkDir(ctx context.Context, id string, path string) error
- func (m *MockRuntime) Ping(ctx context.Context) error
- func (m *MockRuntime) ReadFile(ctx context.Context, id string, path string) ([]byte, error)
- func (m *MockRuntime) Remove(ctx context.Context, id string) error
- func (m *MockRuntime) RemoveFile(ctx context.Context, id string, path string) error
- func (m *MockRuntime) RemoveSnapshot(ctx context.Context, snapshotID string) error
- func (m *MockRuntime) Restore(ctx context.Context, snapshotID string) (string, error)
- func (m *MockRuntime) Snapshot(ctx context.Context, id string, name string) (*runtime.SnapshotInfo, error)
- func (m *MockRuntime) Start(ctx context.Context, id string) error
- func (m *MockRuntime) Stats(ctx context.Context, id string) (*runtime.SandboxStats, error)
- func (m *MockRuntime) Stop(ctx context.Context, id string, timeout time.Duration) error
- func (m *MockRuntime) WriteFile(ctx context.Context, id string, path string, content []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockRuntime ¶
type MockRuntime struct {
Created map[string]runtime.SandboxConfig
Started map[string]bool
Stopped map[string]bool
Removed map[string]bool
ExecFn func(ctx context.Context, id string, opts runtime.ExecOpts) (*runtime.ExecResult, error)
}
MockRuntime implements runtime.Runtime for testing.
func (*MockRuntime) Create ¶
func (m *MockRuntime) Create(ctx context.Context, id string, cfg runtime.SandboxConfig) error
func (*MockRuntime) Exec ¶
func (m *MockRuntime) Exec(ctx context.Context, id string, opts runtime.ExecOpts) (*runtime.ExecResult, error)
func (*MockRuntime) ExecStream ¶
func (m *MockRuntime) ExecStream(ctx context.Context, id string, opts runtime.ExecOpts) (runtime.ExecStream, error)
func (*MockRuntime) Info ¶
func (m *MockRuntime) Info(ctx context.Context, id string) (*runtime.SandboxInfo, error)
func (*MockRuntime) List ¶
func (m *MockRuntime) List(ctx context.Context) ([]runtime.SandboxInfo, error)
func (*MockRuntime) ListSnapshots ¶
func (m *MockRuntime) ListSnapshots(ctx context.Context, sandboxID string) ([]runtime.SnapshotInfo, error)
func (*MockRuntime) RemoveFile ¶
func (*MockRuntime) RemoveSnapshot ¶
func (m *MockRuntime) RemoveSnapshot(ctx context.Context, snapshotID string) error
func (*MockRuntime) Snapshot ¶
func (m *MockRuntime) Snapshot(ctx context.Context, id string, name string) (*runtime.SnapshotInfo, error)
func (*MockRuntime) Stats ¶
func (m *MockRuntime) Stats(ctx context.Context, id string) (*runtime.SandboxStats, error)
Click to show internal directories.
Click to hide internal directories.