Documentation
¶
Overview ¶
Package internal provides shared utilities for the e3cnc-tui Go binary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPaths ¶
DefaultPaths returns standard E3CNC paths relative to the user's home.
func InstallJournalPath ¶
func InstallJournalPath() string
InstallJournalPath returns the path to the install journal.
func WriteInstallJournal ¶
func WriteInstallJournal(j InstallJournal) error
WriteInstallJournal writes an install journal entry to disk.
Types ¶
type CommandDef ¶
type CommandDef struct {
Name string `json:"name"`
Aliases []string `json:"aliases"`
Destructive bool `json:"destructive"`
Blocking bool `json:"blocking"`
Interactive bool `json:"interactive"`
Flags []FlagDef `json:"flags"`
}
CommandDef represents a single command definition from commands.json.
type CommandsManifest ¶
type CommandsManifest struct {
Version string `json:"version"`
Commands []CommandDef `json:"commands"`
}
CommandsManifest is the root structure of commands.json.
func LoadCommands ¶
func LoadCommands() (*CommandsManifest, error)
LoadCommands reads and parses commands.json. It searches the repo checkout path relative to the binary location.
func (*CommandsManifest) AllCommandNames ¶
func (m *CommandsManifest) AllCommandNames() []string
AllCommandNames returns all command names and aliases.
func (*CommandsManifest) FindCommand ¶
func (m *CommandsManifest) FindCommand(name string) *CommandDef
FindCommand looks up a command by name or alias. Returns nil if not found.
func (*CommandsManifest) IsKnownCommand ¶
func (m *CommandsManifest) IsKnownCommand(name string) bool
IsKnownCommand checks if a string is a known command name or alias.
type FlagDef ¶
type FlagDef struct {
Name string `json:"name"`
Type string `json:"type"`
Short string `json:"short,omitempty"`
Help string `json:"help"`
Default any `json:"default,omitempty"`
Positional bool `json:"positional,omitempty"`
}
FlagDef represents a single flag for a command.
type InstallJournal ¶
type InstallJournal struct {
InstallID string `json:"install_id"`
InstanceName string `json:"instance_name"`
StartedAt time.Time `json:"started_at"`
CompletedAt time.Time `json:"completed_at,omitempty"`
LastStep int `json:"last_step"`
TotalSteps int `json:"total_steps"`
Status string `json:"status"` // "running", "completed", "failed"
Error string `json:"error,omitempty"`
RolledBack bool `json:"rolled_back,omitempty"`
}
InstallJournal tracks an install attempt with step-by-step status.
func ReadInstallJournal ¶
func ReadInstallJournal() InstallJournal
ReadInstallJournal reads the install journal from disk. Returns an empty journal if none exists.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package bootstrap handles fresh-install system provisioning.
|
Package bootstrap handles fresh-install system provisioning. |
|
Package commands provides Go-native implementations of all E3CNC CLI commands.
|
Package commands provides Go-native implementations of all E3CNC CLI commands. |
|
Package deploy provides release management, health checks, and backup/restore.
|
Package deploy provides release management, health checks, and backup/restore. |
|
Package domain defines shared types and interfaces for the E3CNC CLI domain layer.
|
Package domain defines shared types and interfaces for the E3CNC CLI domain layer. |
|
Package instance provides the E3CNC instance model and filesystem helpers.
|
Package instance provides the E3CNC instance model and filesystem helpers. |
|
Package rootrun provides a single, shared, non-interactive boundary for executing commands as root (used by install, runtime service management, and health checks).
|
Package rootrun provides a single, shared, non-interactive boundary for executing commands as root (used by install, runtime service management, and health checks). |