handlers

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 28 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 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 HandleRepoCreate added in v0.8.0

func HandleRepoCreate(ctx context.Context, a *app.App, r RepoCreateReq) (*vers.CreateRepositoryResponse, error)

func HandleRepoDelete added in v0.8.0

func HandleRepoDelete(ctx context.Context, a *app.App, r RepoDeleteReq) error

func HandleRepoFork added in v0.8.0

func HandleRepoFork(ctx context.Context, a *app.App, r RepoForkReq) (*vers.ForkRepositoryResponse, error)

func HandleRepoGet added in v0.8.0

func HandleRepoGet(ctx context.Context, a *app.App, r RepoGetReq) (*vers.RepositoryInfo, error)

func HandleRepoList added in v0.8.0

func HandleRepoList(ctx context.Context, a *app.App, _ RepoListReq) (*vers.ListRepositoriesResponse, error)

func HandleRepoSetVisibility added in v0.8.0

func HandleRepoSetVisibility(ctx context.Context, a *app.App, r RepoSetVisibilityReq) error

func HandleRepoTagCreate added in v0.8.0

func HandleRepoTagCreate(ctx context.Context, a *app.App, r RepoTagCreateReq) (*vers.CreateRepoTagResponse, error)

func HandleRepoTagDelete added in v0.8.0

func HandleRepoTagDelete(ctx context.Context, a *app.App, r RepoTagDeleteReq) error

func HandleRepoTagGet added in v0.8.0

func HandleRepoTagGet(ctx context.Context, a *app.App, r RepoTagGetReq) (*vers.RepoTagInfo, error)

func HandleRepoTagList added in v0.8.0

func HandleRepoTagList(ctx context.Context, a *app.App, r RepoTagListReq) (*vers.ListRepoTagsResponse, error)

func HandleRepoTagUpdate added in v0.8.0

func HandleRepoTagUpdate(ctx context.Context, a *app.App, r RepoTagUpdateReq) 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
	Name        string
	Description string
	// Tags is a list of raw "<repo>:<tag>" references to write after the
	// commit lands. Each entry creates the tag if it does not yet exist,
	// or updates an existing tag to point at the new commit.
	Tags []string
	// Public, when true, publishes the new commit (sets is_public=true)
	// after the commit and any tag writes succeed.
	Public bool
}

type CommitCreateView added in v0.7.0

type CommitCreateView = presenters.CommitCreateView

CommitCreateView is re-exported from the presenters package so callers can keep importing it from handlers as before.

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 CommitTagWritten added in v0.12.0

type CommitTagWritten = presenters.CommitTagWritten

CommitTagWritten is re-exported for the same reason.

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
	WorkingDir string
	Env        map[string]string
	TimeoutSec uint64
	UseSSH     bool
	Stdin      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 RepoCreateReq added in v0.8.0

type RepoCreateReq struct {
	Name        string
	Description string
}

type RepoDeleteReq added in v0.8.0

type RepoDeleteReq struct {
	Name string
}

type RepoForkReq added in v0.8.0

type RepoForkReq struct {
	SourceOrg  string
	SourceRepo string
	SourceTag  string
	RepoName   string
	TagName    string
}

type RepoGetReq added in v0.8.0

type RepoGetReq struct {
	Name string
}

type RepoListReq added in v0.8.0

type RepoListReq struct{}

type RepoSetVisibilityReq added in v0.8.0

type RepoSetVisibilityReq struct {
	Name     string
	IsPublic bool
}

type RepoTagCreateReq added in v0.8.0

type RepoTagCreateReq struct {
	RepoName    string
	TagName     string
	CommitID    string
	Description string
}

type RepoTagDeleteReq added in v0.8.0

type RepoTagDeleteReq struct {
	RepoName string
	TagName  string
}

type RepoTagGetReq added in v0.8.0

type RepoTagGetReq struct {
	RepoName string
	TagName  string
}

type RepoTagListReq added in v0.8.0

type RepoTagListReq struct {
	RepoName string
}

type RepoTagUpdateReq added in v0.8.0

type RepoTagUpdateReq struct {
	RepoName    string
	TagName     string
	CommitID    string
	Description 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 is either a commit ID (UUID) or, when IsRef is true, a
	// repository reference in "repo_name:tag_name" format.
	CommitKey string
	VMAlias   string
	Wait      bool
	// IsRef switches the underlying API payload from {"commit_id": ...} to
	// {"ref": ...}, which enables resolving own-org repository tags like
	// "my-app:latest" instead of raw commit UUIDs.
	IsRef 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