handlers

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 24 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 HandleCommitDelete added in v0.7.0

func HandleCommitDelete(ctx context.Context, a *app.App, r CommitDeleteReq) error

func HandleCommitParents added in v0.7.0

func HandleCommitParents(ctx context.Context, a *app.App, r CommitParentsReq) (presenters.CommitParentsView, error)

func HandleCommitUpdate added in v0.7.0

func HandleCommitUpdate(ctx context.Context, a *app.App, r CommitUpdateReq) (*vers.CommitInfo, error)

func HandleCommitsList added in v0.7.0

func HandleCommitsList(ctx context.Context, a *app.App, r CommitsListReq) (presenters.CommitsListView, 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 HandleDeploy added in v0.7.2

func HandleDeploy(ctx context.Context, a *app.App, r DeployReq) (presenters.DeployView, error)

func HandleEnvDelete added in v0.7.2

func HandleEnvDelete(ctx context.Context, a *app.App, req EnvDeleteReq) error

HandleEnvDelete handles deleting an environment variable

func HandleEnvList added in v0.7.2

func HandleEnvList(ctx context.Context, a *app.App, req EnvListReq) (map[string]string, error)

HandleEnvList handles listing environment variables

func HandleEnvSet added in v0.7.2

func HandleEnvSet(ctx context.Context, a *app.App, req EnvSetReq) error

HandleEnvSet handles setting an environment variable

func HandleExecute

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

func HandleInfo added in v0.7.0

func HandleInfo(ctx context.Context, a *app.App, r InfoReq) (presenters.InfoView, error)

func HandleKill

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

func HandlePause

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

func HandleResize added in v0.7.0

func HandleResize(ctx context.Context, a *app.App, r ResizeReq) (string, 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 HandleTagCreate added in v0.7.0

func HandleTagCreate(ctx context.Context, a *app.App, r TagCreateReq) (*vers.CreateTagResponse, error)

func HandleTagDelete added in v0.7.0

func HandleTagDelete(ctx context.Context, a *app.App, r TagDeleteReq) error

func HandleTagGet added in v0.7.0

func HandleTagGet(ctx context.Context, a *app.App, r TagGetReq) (*vers.TagInfo, error)

func HandleTagList added in v0.7.0

func HandleTagList(ctx context.Context, a *app.App, r TagListReq) (presenters.TagListView, error)

func HandleTagUpdate added in v0.7.0

func HandleTagUpdate(ctx context.Context, a *app.App, r TagUpdateReq) error

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
	Wait     bool   // block until new VMs are running
}

type CommitCreateReq added in v0.7.0

type CommitCreateReq struct {
	Target string
}

type CommitCreateView added in v0.7.0

type CommitCreateView struct {
	CommitID string `json:"commit_id"`
	VmID     string `json:"vm_id"`
	UsedHEAD bool   `json:"used_head,omitempty"`
}

func HandleCommitCreate added in v0.7.0

func HandleCommitCreate(ctx context.Context, a *app.App, r CommitCreateReq) (CommitCreateView, error)

type CommitDeleteReq added in v0.7.0

type CommitDeleteReq struct {
	CommitID string
}

CommitDeleteReq is the request for deleting a commit.

type CommitParentsReq added in v0.7.0

type CommitParentsReq struct {
	CommitID string
}

CommitParentsReq is the request for listing parent commits.

type CommitUpdateReq added in v0.7.0

type CommitUpdateReq struct {
	CommitID string
	IsPublic bool
}

CommitUpdateReq is the request for updating a commit.

type CommitsListReq added in v0.7.0

type CommitsListReq struct {
	Public bool
}

CommitsListReq is the request for listing commits.

type ConnectReq

type ConnectReq struct{ Target string }

type CopyReq

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

type DeployReq added in v0.7.2

type DeployReq struct {
	Repo             string
	Name             string
	Branch           string
	InstallCommand   string
	BuildCommand     string
	RunCommand       string
	WorkingDirectory string
	Wait             bool
}

DeployReq is the request for deploying a GitHub repo.

type EnvDeleteReq added in v0.7.2

type EnvDeleteReq struct {
	Key string
}

EnvDeleteReq captures the request for deleting an env var

type EnvListReq added in v0.7.2

type EnvListReq struct{}

EnvListReq captures the request for listing env vars

type EnvSetReq added in v0.7.2

type EnvSetReq struct {
	Key   string
	Value string
}

EnvSetReq captures the request for setting an env var

type ExecuteReq

type ExecuteReq struct {
	Target  string
	Command []string
}

type InfoReq added in v0.7.0

type InfoReq struct {
	Target string
}

type KillDTO

type KillDTO struct {
	Scope        string   `json:"scope"`
	Targets      []string `json:"targets"`
	DeletedIDs   []string `json:"deleted_ids,omitempty"`
	AffectedHead bool     `json:"affected_head,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.

type KillReq

type KillReq struct {
	Targets          []string
	SkipConfirmation bool
}

type PauseReq

type PauseReq struct{ Target string }

type ResizeReq added in v0.7.0

type ResizeReq struct {
	Target    string
	FsSizeMib int64
}

type ResumeReq

type ResumeReq struct {
	Target string
	Wait   bool
}

type RunCommitReq

type RunCommitReq struct {
	CommitKey string
	VMAlias   string
	Wait      bool
}

type RunReq

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

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 TagCreateReq added in v0.7.0

type TagCreateReq struct {
	TagName     string
	CommitID    string
	Description string
}

TagCreateReq is the request for creating a tag.

type TagDeleteReq added in v0.7.0

type TagDeleteReq struct {
	TagName string
}

TagDeleteReq is the request for deleting a tag.

type TagGetReq added in v0.7.0

type TagGetReq struct {
	TagName string
}

TagGetReq is the request for getting a tag.

type TagListReq added in v0.7.0

type TagListReq struct{}

TagListReq is the request for listing tags.

type TagUpdateReq added in v0.7.0

type TagUpdateReq struct {
	TagName     string
	CommitID    string
	Description string
}

TagUpdateReq is the request for updating a tag.

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
}

Jump to

Keyboard shortcuts

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