noop

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package noop is an in-memory Runtime used by unit tests of higher layers (sandbox manager, control plane). It does not actually start anything — it just tracks sandbox IDs and serves back the handles it was given.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runtime

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

func New

func New() *Runtime

func (*Runtime) AgentEndpoint

func (r *Runtime) AgentEndpoint(sandboxID string) (host string, port int, err error)

func (*Runtime) BuildImage

func (r *Runtime) BuildImage(ctx context.Context, req runtime.BuildRequest) error

func (*Runtime) CPUCount

func (r *Runtime) CPUCount(sandboxID string) int

CPUCount / MemoryMB return the requested cgroup caps so tests can assert the resource-limit plumbing reached the runtime. Zero for unknown sandboxes — same convention as Image().

func (*Runtime) Commit

func (r *Runtime) Commit(ctx context.Context, sandboxID, imageTag string) error

func (*Runtime) Create

func (*Runtime) Destroy

func (r *Runtime) Destroy(ctx context.Context, sandboxID string) error

func (*Runtime) HasImage

func (r *Runtime) HasImage(tag string) bool

HasImage reports whether an image tag has been registered via BuildImage or Commit. Exposed for tests that want to assert build plumbing.

func (*Runtime) Image

func (r *Runtime) Image(sandboxID string) string

Image returns the image tag the named sandbox was launched with, or "" if the sandbox is unknown. Exposed for tests.

func (*Runtime) IsPaused

func (r *Runtime) IsPaused(sandboxID string) bool

IsPaused is exposed for tests that exercise Pause/Unpause plumbing.

func (*Runtime) IsStopped

func (r *Runtime) IsStopped(sandboxID string) bool

IsStopped is exposed for tests that exercise Stop/Start plumbing.

func (*Runtime) ListManaged added in v0.2.0

func (r *Runtime) ListManaged(ctx context.Context) ([]runtime.ManagedContainer, error)

ListManaged returns every tracked sandbox as a ManagedContainer. Unit tests use this path to exercise Rehydrate logic without a real Docker daemon — seed entries with Create first, optionally transition them via Pause/Stop.

func (*Runtime) MemoryMB

func (r *Runtime) MemoryMB(sandboxID string) int

func (*Runtime) Name

func (r *Runtime) Name() string

func (*Runtime) Pause

func (r *Runtime) Pause(ctx context.Context, sandboxID string) error

func (*Runtime) ReadyCmd

func (r *Runtime) ReadyCmd(sandboxID string) string

func (*Runtime) Start

func (r *Runtime) Start(ctx context.Context, sandboxID string) error

func (*Runtime) StartCmd

func (r *Runtime) StartCmd(sandboxID string) string

StartCmd / ReadyCmd return the per-sandbox template commands that were forwarded through CreateRequest. Exposed for tests that exercise the template resolver path.

func (*Runtime) Stats

func (r *Runtime) Stats(ctx context.Context, sandboxID string) (*runtime.Stats, error)

func (*Runtime) Stop

func (r *Runtime) Stop(ctx context.Context, sandboxID string) error

func (*Runtime) Unpause

func (r *Runtime) Unpause(ctx context.Context, sandboxID string) error

Jump to

Keyboard shortcuts

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