version

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(svc sdk.Service) sdk.Plugin

New creates a new version plugin.

Types

type Input added in v1.12.0

type Input struct {
	// JSON signals the caller wants JSON-shaped stdout. Plugin.Stdout reads
	// this directly from p.input.JSON when rendering the version payload.
	JSON bool
}

Input is the typed DTO carrying parsed CLI flags into the version plugin's lifecycle. cmd/tfui/version_command.go binds the root-persistent --json value into Input.JSON at RunE time and hands the value to Plugin.Activate.

type Plugin

type Plugin struct {
	sdk.PluginBase
	// contains filtered or unexported fields
}

Plugin implements the version info viewer.

func (*Plugin) Activate

func (p *Plugin) Activate(input Input) tea.Cmd

Activate stores the typed input and returns the initial command.

func (*Plugin) Cancel

func (p *Plugin) Cancel()

Cancel aborts any in-flight terraform operation.

func (*Plugin) Configure

func (p *Plugin) Configure(cfg map[string]interface{}) error

Configure applies plugin-specific options from config.

func (*Plugin) Hints

func (p *Plugin) Hints() []sdk.KeyHint

Hints returns key hints for the version view.

func (*Plugin) Init

func (p *Plugin) Init(deps *sdk.PluginDeps) tea.Cmd

Init wires the plugin to its shared dependencies.

func (*Plugin) Ready

func (p *Plugin) Ready() bool

func (*Plugin) Stdout added in v1.12.0

func (p *Plugin) Stdout() ([]byte, error)

Stdout produces stdout content for standalone/CI mode.

JSON mode is a passthrough: returns the raw `terraform version -json` bytes captured during the version fetch. The schema is terraform's, not tfui's. Human-readable mode renders tfui + terraform version info.

func (*Plugin) Update

func (p *Plugin) Update(msg tea.Msg) (sdk.Plugin, tea.Cmd)

Update processes messages.

func (*Plugin) View

func (p *Plugin) View(width, height int) string

View renders the version information.

type VersionResultMsg

type VersionResultMsg struct {
	Info *sdk.VersionInfo
	Err  error
}

VersionResultMsg is sent when the version fetch completes.

Jump to

Keyboard shortcuts

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