handlers

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: MIT Imports: 29 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskConfirmation

func AskConfirmation(a *app.App) bool

AskConfirmation uses the app prompter to confirm (fallback to default prompt if unavailable).

func HandleBranch

func HandleBranch(ctx context.Context, a *app.App, r BranchReq) (presenters.BranchView, error)

func HandleBuild

func HandleBuild(ctx context.Context, a *app.App, r BuildReq) (presenters.BuildView, error)

func HandleConnect

func HandleConnect(ctx context.Context, a *app.App, r ConnectReq) (presenters.ConnectView, error)

func HandleCopy

func HandleCopy(ctx context.Context, a *app.App, r CopyReq) (presenters.CopyView, error)

func HandleExecute

func HandleExecute(ctx context.Context, a *app.App, r ExecuteReq) (presenters.ExecuteView, error)

func HandleHistory

func HandleHistory(ctx context.Context, a *app.App, r HistoryReq) (presenters.HistoryView, error)

func HandleKill

func HandleKill(ctx context.Context, a *app.App, r KillReq) error

HandleKill orchestrates deletion flows. It currently prints via existing presenters/styles to minimize changes in Phase 1; a later phase can return DTOs for presenters to render.

func HandlePause

func HandlePause(ctx context.Context, a *app.App, r PauseReq) (presenters.PauseView, error)

func HandleResume

func HandleResume(ctx context.Context, a *app.App, r ResumeReq) (presenters.ResumeView, error)

func HandleRun

func HandleRun(ctx context.Context, a *app.App, r RunReq) (presenters.RunView, error)

func HandleRunCommit

func HandleRunCommit(ctx context.Context, a *app.App, r RunCommitReq) (presenters.RunCommitView, error)

func HandleStatus

func HandleStatus(ctx context.Context, a *app.App, req StatusReq) (presenters.StatusView, error)

HandleStatus performs the status command logic using services and utilities.

func HandleUpgrade

func HandleUpgrade(a *app.App, r UpgradeReq) error

Types

type BranchReq

type BranchReq struct {
	Target   string // vm id or alias; if empty, use HEAD
	Alias    string // alias for new VM
	Checkout bool   // whether to set HEAD to new VM
}

type BuildReq

type BuildReq struct{ Config *runconfig.Config }

type ConnectReq

type ConnectReq struct{ Target string }

type CopyReq

type CopyReq struct {
	Target      string
	Source      string
	Destination string
	Recursive   bool
}

type ExecuteReq

type ExecuteReq struct {
	Target  string
	Command []string
}

type HistoryReq

type HistoryReq struct{ Target string }

type KillDTO

type KillDTO struct {
	Scope        string              `json:"scope"` // "vms"
	Targets      []string            `json:"targets"`
	Recursive    bool                `json:"recursive"`
	DeletedIDs   []string            `json:"deletedIds,omitempty"`
	DeletedByRef map[string][]string `json:"deletedByRef,omitempty"` // input target -> deleted ids
	AffectedHead bool                `json:"affectedHead,omitempty"`
}

KillDTO is a structured summary suitable for MCP outputs.

func HandleKillDTO

func HandleKillDTO(ctx context.Context, a *app.App, r KillReq) (KillDTO, error)

HandleKillDTO performs non-interactive deletion with a structured result. It does not prompt and does not print; callers must enforce confirmation policy.

type KillReq

type KillReq struct {
	Targets          []string
	SkipConfirmation bool
	Recursive        bool
}

type PauseReq

type PauseReq struct{ Target string }

type PauseView

type PauseView struct{ VMName, NewState string }

type ResumeReq

type ResumeReq struct{ Target string }

type RunCommitReq

type RunCommitReq struct {
	CommitKey string
	VMAlias   string
}

type RunCommitView

type RunCommitView struct{ RootVmID, HeadTarget, CommitKey string }

type RunReq

type RunReq struct {
	MemSizeMib  int64
	VcpuCount   int64
	RootfsName  string
	KernelName  string
	FsSizeVmMib int64
	VMAlias     string
}

type RunView

type RunView struct{ RootVmID, VmAlias, HeadTarget string }

type StatusReq

type StatusReq struct {
	Target string // optional VM identifier; if set, show VM
}

StatusReq captures the parsed flags/args from the status command.

type UpgradeReq

type UpgradeReq struct {
	CurrentVersion string
	Repository     string
	CheckOnly      bool
	Prerelease     bool
	SkipChecksum   bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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