Documentation
¶
Index ¶
- func New(svc sdk.Service) sdk.Plugin
- type ImportRequestMsg
- type Input
- type Plugin
- func (p *Plugin) Activate(input Input) tea.Cmd
- func (p *Plugin) Configure(_ map[string]interface{}) error
- func (p *Plugin) HandleContextChanged(ev sdk.ContextChangedEvent) tea.Cmd
- func (p *Plugin) Hints() []sdk.KeyHint
- func (p *Plugin) Init(deps *sdk.PluginDeps) tea.Cmd
- func (p *Plugin) Update(msg tea.Msg) (sdk.Plugin, tea.Cmd)
- func (p *Plugin) View(_, _ int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ImportRequestMsg ¶
type ImportRequestMsg struct {
Address string
}
ImportRequestMsg requests navigation to the import plugin with a pre-filled address.
type Input ¶ added in v1.12.0
type Input struct {
// Addr is the resource address to import (terraform's first positional
// argument).
Addr string
// ID is the cloud provider identifier the resource maps to (terraform's
// second positional argument).
ID string
// JSON signals the caller wants JSON-shaped stdout. Import has no stdout
// content today; the field exists for symmetry with other plugins.
JSON bool
}
Input is the typed DTO carrying parsed CLI flags into the import plugin's lifecycle. cmd/tfui/import_command.go binds positional args directly into Addr / ID and hands the value to Plugin.Activate.
type Plugin ¶
type Plugin struct {
sdk.PluginBase
sdk.ActionRunner
// contains filtered or unexported fields
}
Plugin implements the standalone import verb. Its input prelude is a two-step form (address, then ID) or a direct confirm; the run/result/render lifecycle is delegated to the embedded ActionRunner.
func (*Plugin) Activate ¶
Activate stores the typed input and either confirms directly (address + ID both supplied) or opens the two-step form.
func (*Plugin) HandleContextChanged ¶ added in v1.10.0
func (p *Plugin) HandleContextChanged(ev sdk.ContextChangedEvent) tea.Cmd
HandleContextChanged resets the runner and clears targets on a context switch.