Documentation
¶
Overview ¶
Package uninstaller performs a complete one-command uninstall of vmflow: it removes the native service, deletes the binary, and purges owned config, logs, owned certificate caches, and the self-update cache. External TLS certificate and key files referenced by config are deliberately preserved.
The flow is plan → confirm → execute. Plan probes the system and returns the ordered list of items to remove (service first, the running binary last). Confirm asks for interactive consent. Execute requires service cleanup to succeed before removing files and tolerates already-absent paths so retries remain safe.
Style follows internal/service and internal/updater: error-return, progress streamed to an io.Writer, no logging inside the package.
Index ¶
- func Confirm(w io.Writer, r io.Reader) (bool, error)
- func ConfirmWithTranslator(w io.Writer, r io.Reader, translator *i18n.Translator) (bool, error)
- func Execute(w io.Writer, items []Item) error
- func ExecuteWithTranslator(w io.Writer, items []Item, translator *i18n.Translator) error
- func Print(w io.Writer, items []Item, warnings []string)
- func PrintWithTranslator(w io.Writer, items []Item, warnings []string, translator *i18n.Translator)
- type Item
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Confirm ¶
Confirm prompts on w and reads a yes/no answer from r. Returns true only for an explicit y/yes.
func ConfirmWithTranslator ¶
ConfirmWithTranslator prompts for explicit consent in the selected language.
func Execute ¶
Execute handles native service items first, then removes filesystem items in order. Already-absent paths are not errors, so re-running the command is safe. The running binary is removed last in plans produced by Plan.
func ExecuteWithTranslator ¶
ExecuteWithTranslator localizes progress headings without changing validation, paths, or returned errors.
func PrintWithTranslator ¶
PrintWithTranslator writes the localized plan while preserving paths and diagnostic warning text exactly as discovered by Plan.
Types ¶
type Item ¶
type Item struct {
Path string // filesystem path; empty for the service item
Kind string // service, binary, file, directory, owned config, or stats file
Note string // human-readable description shown in the plan
Self bool // marks the running binary; removed last
}
Item describes one artifact the uninstall removes.