MCPcopy Index your code
hub / github.com/docker/docker-agent / WithSnapshotController

Function WithSnapshotController

pkg/app/app.go:117–121  ·  view source on GitHub ↗

WithSnapshotController plumbs in the [builtins.SnapshotController] the App uses to drive /undo, /snapshots, /reset. Pass the same controller to the runtime via runtime.WithAutoInjector so the instance that captures the checkpoints is the one the TUI commands drive. Pass nil (or omit the option) for

(c builtins.SnapshotController)

Source from the content-addressed store, hash-verified

115// snapshots; the App then reports SnapshotsEnabled()==false and the
116// related commands silently no-op.
117func WithSnapshotController(c builtins.SnapshotController) Opt {
118 return func(a *App) {
119 a.snapshotController = c
120 }
121}
122
123func New(ctx context.Context, rt runtime.Runtime, sess *session.Session, opts ...Opt) *App {
124 app := &App{

Callers 4

buildAppOptsMethod · 0.92
createSessionSpawnerMethod · 0.92
TestApp_UndoLastSnapshotFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestApp_UndoLastSnapshotFunction · 0.68