presenters

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NoDataFound

func NoDataFound(message string)

func OperationCancelled

func OperationCancelled()

func PrintDeletionSummary

func PrintDeletionSummary(results SummaryResults)

func PrintJSON added in v0.7.0

func PrintJSON(v interface{}) error

PrintJSON marshals v to indented JSON and prints to stdout.

func PrintQuiet added in v0.7.0

func PrintQuiet(items []string)

PrintQuiet prints each string on its own line to stdout.

func ProgressCounter

func ProgressCounter(current, total int, action, target string)

func RenderBranch

func RenderBranch(a *app.App, res BranchView)

func RenderCommitParents added in v0.7.0

func RenderCommitParents(_ *app.App, v CommitParentsView)

func RenderCommitsList added in v0.7.0

func RenderCommitsList(_ *app.App, v CommitsListView)

func RenderConnect

func RenderConnect(a *app.App, v ConnectView)

func RenderCopy

func RenderCopy(a *app.App, v CopyView)

func RenderDeploy added in v0.7.2

func RenderDeploy(a *app.App, v DeployView)

RenderDeploy prints human-friendly output for a deploy operation.

func RenderExecute

func RenderExecute(a *app.App, v ExecuteView)

func RenderInfo added in v0.7.0

func RenderInfo(_ *app.App, v InfoView)

func RenderPause

func RenderPause(a *app.App, v PauseView)

func RenderResume

func RenderResume(a *app.App, v ResumeView)

func RenderRun

func RenderRun(a *app.App, v RunView)

func RenderRunCommit

func RenderRunCommit(a *app.App, v RunCommitView)

func RenderStatus

func RenderStatus(a *app.App, res StatusView)

func RenderTagInfo added in v0.7.0

func RenderTagInfo(_ *app.App, t *vers.TagInfo)

func RenderTagList added in v0.7.0

func RenderTagList(_ *app.App, v TagListView)

func RenderTunnel added in v0.6.0

func RenderTunnel(a *app.App, v TunnelView)

func RenderVMList

func RenderVMList(vms []vers.Vm)

func RenderVMStatus

func RenderVMStatus(vm *vers.Vm)

func SectionHeader

func SectionHeader(title string)

func SuccessMessage

func SuccessMessage(message string)

Types

type BranchView

type BranchView struct {
	FromID       string   `json:"from_id"`
	FromName     string   `json:"from_name,omitempty"`
	NewID        string   `json:"new_id,omitempty"`
	NewIDs       []string `json:"new_ids"`
	NewAlias     string   `json:"new_alias,omitempty"`
	NewState     string   `json:"new_state,omitempty"`
	CheckoutDone bool     `json:"checkout_done,omitempty"`
	CheckoutErr  error    `json:"-"`
	UsedHEAD     bool     `json:"used_head,omitempty"`
}

type CommitParentsView added in v0.7.0

type CommitParentsView struct {
	CommitID string
	Parents  []vers.CommitListParentsResponse
}

type CommitsListView added in v0.7.0

type CommitsListView struct {
	Commits []vers.CommitInfo
	Total   int64
	Public  bool
}

type ConnectView

type ConnectView struct {
	UsedHEAD   bool
	HeadID     string
	VMName     string
	SSHHost    string
	SSHPort    string
	LocalRoute bool
}

type CopyView

type CopyView struct {
	UsedHEAD bool
	HeadID   string
	VMName   string
	Action   string
	Src      string
	Dest     string
}

type DeployView added in v0.7.2

type DeployView struct {
	ProjectID string `json:"project_id"`
	VmID      string `json:"vm_id"`
	Status    string `json:"status"`
}

DeployView contains the data returned from a deploy operation.

type ExecuteView

type ExecuteView struct {
	UsedHEAD bool
	HeadID   string
}

type InfoView added in v0.7.0

type InfoView struct {
	Metadata *vers.VmMetadataResponse
	UsedHEAD bool
}

type OutputFormat added in v0.7.0

type OutputFormat int

OutputFormat controls how command output is rendered.

const (
	FormatDefault OutputFormat = iota
	FormatQuiet                // just IDs/names, one per line
	FormatJSON                 // full JSON
)

func ParseFormat added in v0.7.0

func ParseFormat(quiet bool, formatStr string) OutputFormat

ParseFormat returns the output format from flag values.

type PauseView

type PauseView struct{ VMName, NewState string }

type ResumeView

type ResumeView struct{ VMName, NewState string }

type RunCommitView

type RunCommitView struct {
	RootVmID   string `json:"vm_id"`
	HeadTarget string `json:"head,omitempty"`
	CommitKey  string `json:"commit_key"`
}

type RunView

type RunView struct {
	RootVmID   string `json:"vm_id"`
	VmAlias    string `json:"alias,omitempty"`
	HeadTarget string `json:"head,omitempty"`
}

type StatusHead

type StatusHead struct {
	Show        bool
	Present     bool
	Empty       bool
	ID          string
	DisplayName string
	State       string
}

type StatusMode

type StatusMode int
const (
	StatusList StatusMode = iota
	StatusVM
)

type StatusView

type StatusView struct {
	Mode StatusMode
	Head StatusHead
	VM   *vers.Vm
	VMs  []vers.Vm
}

type SummaryResults

type SummaryResults struct {
	SuccessCount int
	FailCount    int
	Errors       []string
	ItemType     string
}

type TagListView added in v0.7.0

type TagListView struct {
	Tags []vers.TagInfo
}

type TunnelView added in v0.6.0

type TunnelView struct {
	UsedHEAD   bool
	HeadID     string
	VMName     string
	LocalPort  int
	RemoteHost string
	RemotePort int
}

TunnelView holds data for rendering tunnel status.

Jump to

Keyboard shortcuts

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