handlers

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 27 Imported by: 0

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 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 HandleTunnel added in v0.6.0

func HandleTunnel(ctx context.Context, a *app.App, r TunnelReq) (presenters.TunnelView, error)

HandleTunnel sets up an SSH port-forwarding tunnel to the VM. It blocks until ctx is cancelled (e.g. Ctrl-C).

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
	Count    int    // number of branches to create
}

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 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 TunnelReq added in v0.6.0

type TunnelReq struct {
	Target     string // VM ID, alias, or empty for HEAD
	LocalPort  int    // local port to listen on (0 = auto)
	RemoteHost string // remote host (from the VM's perspective), default "localhost"
	RemotePort int    // remote port to forward to
}

TunnelReq holds the parameters for a tunnel 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