{"modulePath":"github.com/newstack-cloud/deploy-cli-sdk","version":"v0.10.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package destroyui\n\n## Constants\n\n```go\nconst (\n\tItemTypeResource = shared.ItemTypeResource\n\tItemTypeChild    = shared.ItemTypeChild\n\tItemTypeLink     = shared.ItemTypeLink\n\n\tActionCreate   = shared.ActionCreate\n\tActionUpdate   = shared.ActionUpdate\n\tActionDelete   = shared.ActionDelete\n\tActionRecreate = shared.ActionRecreate\n\tActionRetain   = shared.ActionRetain\n\tActionNoChange = shared.ActionNoChange\n)\n```\nRe-export constants.\n\n```go\nconst MaxExpandDepth = 2\n```\nMaxExpandDepth is the maximum nesting depth for expanding child blueprints.\n\n## Functions\n\n```go\nfunc BuildDriftItems(result *container.ReconciliationCheckResult, instanceState *state.InstanceState) []splitpane.Item\n```\nBuildDriftItems builds split-pane items from drift reconciliation results.\n\n```go\nfunc InstanceStatusToAction(status core.InstanceStatus) string\n```\nInstanceStatusToAction converts an instance status to a human-readable action string.\n\n```go\nfunc IsFailedInstanceStatus(status core.InstanceStatus) bool\n```\nIsFailedInstanceStatus returns true if the child blueprint is in a failed state.\n\n```go\nfunc IsFailedLinkStatus(status core.LinkStatus) bool\n```\nIsFailedLinkStatus returns true if the link is in a failed state.\n\n```go\nfunc IsFailedResourceStatus(status core.ResourceStatus) bool\n```\nIsFailedResourceStatus returns true if the resource is in a failed state.\n\n```go\nfunc IsFailedStatus(status core.InstanceStatus) bool\n```\nIsFailedStatus returns true if the instance status should result in a non-zero exit code.\n\n```go\nfunc IsInProgressInstanceStatus(status core.InstanceStatus) bool\n```\nIsInProgressInstanceStatus returns true if the instance status indicates the child blueprint is still being processed (not in a terminal state).\n\n```go\nfunc IsInProgressLinkStatus(status core.LinkStatus) bool\n```\nIsInProgressLinkStatus returns true if the link status indicates the link is still being processed (not in a terminal state).\n\n```go\nfunc IsInProgressResourceStatus(status core.ResourceStatus) bool\n```\nIsInProgressResourceStatus returns true if the resource status indicates the resource is still being processed (not in a terminal state).\n\n```go\nfunc IsInterruptedInstanceStatus(status core.InstanceStatus) bool\n```\nIsInterruptedInstanceStatus returns true if the child blueprint was interrupted.\n\n```go\nfunc IsInterruptedLinkStatus(status core.LinkStatus) bool\n```\nIsInterruptedLinkStatus returns true if the link was interrupted.\n\n```go\nfunc IsInterruptedResourceStatus(status core.ResourceStatus) bool\n```\nIsInterruptedResourceStatus returns true if the resource was interrupted.\n\n```go\nfunc IsRetainedResourceStatus(status core.ResourceStatus) bool\n```\nIsRetainedResourceStatus returns true if the resource was retained — its state was removed from the blueprint instance but the underlying infrastructure was preserved in the provider.\n\n```go\nfunc IsRollingBackOrFailedStatus(status core.InstanceStatus) bool\n```\nIsRollingBackOrFailedStatus returns true if the instance status indicates a rollback is in progress or has completed/failed.\n\n```go\nfunc IsRollingBackStatus(status core.InstanceStatus) bool\n```\nIsRollingBackStatus returns true if the instance is actively rolling back.\n\n```go\nfunc IsSuccessInstanceStatus(status core.InstanceStatus) bool\n```\nIsSuccessInstanceStatus returns true if the child blueprint completed successfully.\n\n```go\nfunc IsSuccessLinkStatus(status core.LinkStatus) bool\n```\nIsSuccessLinkStatus returns true if the link completed successfully.\n\n```go\nfunc IsSuccessResourceStatus(status core.ResourceStatus) bool\n```\nIsSuccessResourceStatus returns true if the resource completed successfully.\n\n```go\nfunc LinkStatusToAction(status core.LinkStatus) string\n```\nLinkStatusToAction converts a link status to a human-readable action string.\n\n```go\nfunc ResourceStatusToAction(status core.ResourceStatus) string\n```\nResourceStatusToAction converts a resource status to a human-readable action string.\n\n```go\nfunc ToSplitPaneItems(items []DestroyItem) []splitpane.Item\n```\nToSplitPaneItems converts DestroyItems to splitpane.Items.\n\n## Types\n\n```go\ntype ActionType = shared.ActionType\n```\nType aliases for shared types.\n\n```go\ntype ChangeSummary struct {\n\tCreate   int\n\tUpdate   int\n\tDelete   int\n\tRecreate int\n\tRetain   int\n}\n```\nChangeSummary holds counts of different change types.\n\n```go\ntype ChangesetFetchedMsg struct {\n\tChanges *changes.BlueprintChanges\n}\n```\nChangesetFetchedMsg is sent when changeset changes have been fetched.\n\n```go\ntype ChildDestroyItem struct {\n\tName             string\n\tParentInstanceID string\n\tChildInstanceID  string\n\tAction           ActionType\n\tStatus           core.InstanceStatus\n\tFailureReasons   []string\n\tGroup            int\n\tDurations        *state.InstanceCompletionDuration\n\tTimestamp        int64\n\tDepth            int\n\tSkipped          bool\n\tChanges          *changes.BlueprintChanges\n}\n```\nChildDestroyItem represents a child blueprint being destroyed.\n\n```go\nfunc (c *ChildDestroyItem) GetAction() shared.ActionType\n```\n\n```go\nfunc (c *ChildDestroyItem) GetChildStatus() core.InstanceStatus\n```\n\n```go\nfunc (c *ChildDestroyItem) SetSkipped(skipped bool)\n```\n\n```go\ntype ConfirmDestroyMsg struct {\n\tConfirmed bool\n}\n```\nConfirmDestroyMsg is a message to confirm destroy after staging review.\n\n```go\ntype DeployChangesetErrorMsg struct{}\n```\nDeployChangesetErrorMsg is sent when destroy fails because the changeset was created for a deploy operation, not a destroy operation.\n\n```go\ntype DestroyAppConfig struct {\n\t// Context is bound to the engine calls the destroy model makes so they are\n\t// cancelled when the command context is cancelled (e.g. on Ctrl+C).\n\tContext                context.Context\n\tDestroyEngine          engine.DeployEngine\n\tLogger                 *zap.Logger\n\tChangesetID            string\n\tInstanceID             string\n\tInstanceName           string\n\tBlueprintFile          string\n\tIsDefaultBlueprintFile bool\n\tForce                  bool\n\tStageFirst             bool\n\tAutoApprove            bool\n\tSkipPrompts            bool\n\tStyles                 *stylespkg.Styles\n\tHeadless               bool\n\tHeadlessWriter         io.Writer\n\tJSONMode               bool\n\tPreflight              tea.Model\n\t// OperationConfig carries provider/transformer/context-variable values\n\t// (including the deploy target) sent to the engine when staging destroy\n\t// changes and destroying an instance.\n\tOperationConfig *types.BlueprintOperationConfig\n}\n```\nDestroyAppConfig holds the configuration for creating a new destroy application.\n\n```go\ntype DestroyConfigFormInitialValues struct {\n\tInstanceName string\n\tInstanceID   string\n\tChangesetID  string\n\tStageFirst   bool\n\tAutoApprove  bool\n}\n```\nDestroyConfigFormInitialValues holds the initial values for the destroy config form.\n\n```go\ntype DestroyConfigFormModel struct {\n\t// contains filtered or unexported fields\n}\n```\nDestroyConfigFormModel provides a combined form for destroy configuration.\n\n```go\nfunc NewDestroyConfigFormModel(\n\tinitialValues DestroyConfigFormInitialValues,\n\tstyles *stylespkg.Styles,\n) *DestroyConfigFormModel\n```\nNewDestroyConfigFormModel creates a new destroy config form model.\n\n```go\nfunc (m DestroyConfigFormModel) Init() tea.Cmd\n```\nInit initializes the model.\n\n```go\nfunc (m DestroyConfigFormModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)\n```\nUpdate handles messages.\n\n```go\nfunc (m DestroyConfigFormModel) View() string\n```\nView renders the model.\n\n```go\ntype DestroyConfigMsg struct {\n\tInstanceName string\n\tInstanceID   string\n\tChangesetID  string\n\tStageFirst   bool\n\tAutoApprove  bool\n}\n```\nDestroyConfigMsg is sent when the user completes the destroy configuration form.\n\n```go\ntype DestroyDetailsRenderer struct {\n\tMaxExpandDepth           int\n\tNavigationStackDepth     int\n\tPreDestroyInstanceState  *state.InstanceState\n\tPostDestroyInstanceState *state.InstanceState\n\tFinished                 bool\n}\n```\nDestroyDetailsRenderer implements splitpane.DetailsRenderer for destroy UI.\n\n```go\nfunc (r *DestroyDetailsRenderer) RenderDetails(item splitpane.Item, width int, s *styles.Styles) string\n```\nRenderDetails renders the right pane content for a selected item.\n\n```go\ntype DestroyErrorMsg struct {\n\tErr error\n}\n```\nDestroyErrorMsg is a message containing an error from the destroy process.\n\n```go\ntype DestroyEventMsg types.BlueprintInstanceEvent\n```\nDestroyEventMsg is a message containing a destroy event.\n\n```go\ntype DestroyFooterRenderer struct {\n\tInstanceID          string\n\tInstanceName        string\n\tChangesetID         string\n\tCurrentStatus       core.InstanceStatus\n\tFinalStatus         core.InstanceStatus\n\tFinished            bool\n\tSpinnerView         string\n\tHasInstanceState    bool\n\tDestroyedElements   []DestroyedElement\n\tElementFailures     []ElementFailure\n\tInterruptedElements []InterruptedElement\n\tRetainedElements    []RetainedElement\n}\n```\nDestroyFooterRenderer renders the footer for the destroy split-pane.\n\n```go\nfunc (r *DestroyFooterRenderer) RenderFooter(model *splitpane.Model, s *styles.Styles) string\n```\nRenderFooter renders the footer content.\n\n```go\ntype DestroyItem struct {\n\tType          ItemType\n\tResource      *ResourceDestroyItem\n\tChild         *ChildDestroyItem\n\tLink          *LinkDestroyItem\n\tParentChild   string\n\tDepth         int\n\tPath          string\n\tChanges       *changes.BlueprintChanges\n\tInstanceState *state.InstanceState\n\t// contains filtered or unexported fields\n}\n```\nDestroyItem is the unified item type for the split-pane.\n\n```go\nfunc (d *DestroyItem) AppendChildItems(items []splitpane.Item, parentSkipped bool) []splitpane.Item\n```\nAppendChildItems adds child blueprint items from this child's changes to the list.\n\n```go\nfunc (d *DestroyItem) AppendResourceItems(items []splitpane.Item, parentSkipped bool) []splitpane.Item\n```\nAppendResourceItems adds resource items from this child's changes to the list.\n\n```go\nfunc (d *DestroyItem) BuildChildPath(childName string) string\n```\nBuildChildPath builds a path for a child element based on this item's path.\n\n```go\nfunc (d *DestroyItem) CanDrillDown() bool\n```\nCanDrillDown returns true if the item can be drilled into.\n\n```go\nfunc (d *DestroyItem) GetAction() string\n```\nGetAction returns the action badge text.\n\n```go\nfunc (d *DestroyItem) GetChildren() []splitpane.Item\n```\nGetChildren returns child items when expanded.\n\n```go\nfunc (d *DestroyItem) GetDepth() int\n```\nGetDepth returns the nesting depth for indentation.\n\n```go\nfunc (d *DestroyItem) GetID() string\n```\nGetID returns a unique identifier for the item.\n\n```go\nfunc (d *DestroyItem) GetIcon(selected bool) string\n```\nGetIcon returns a status icon for the item.\n\n```go\nfunc (d *DestroyItem) GetIconStyled(s *styles.Styles, styled bool) string\n```\nGetIconStyled returns a styled icon for the item.\n\n```go\nfunc (d *DestroyItem) GetItemType() string\n```\nGetItemType returns the type for section grouping.\n\n```go\nfunc (d *DestroyItem) GetLinkResourceNames() (string, string)\n```\nGetLinkResourceNames returns the resource names for a link item.\n\n```go\nfunc (d *DestroyItem) GetName() string\n```\nGetName returns the display name for the item. Links read as \"a → b\" rather than as their logical \"a::b\" name, which stays the identifier.\n\n```go\nfunc (d *DestroyItem) GetOrCreateChildItem(name string, action ActionType, changes *changes.BlueprintChanges, skipped bool) *ChildDestroyItem\n```\nGetOrCreateChildItem looks up a child item from the shared map, or creates one if it doesn't exist.\n\n```go\nfunc (d *DestroyItem) GetOrCreateResourceItem(name string, action ActionType, skipped bool) *ResourceDestroyItem\n```\nGetOrCreateResourceItem looks up a resource item from the shared map, or creates one if it doesn't exist.\n\n```go\nfunc (d *DestroyItem) GetParentID() string\n```\nGetParentID returns the parent item ID.\n\n```go\nfunc (d *DestroyItem) GetResourceGroup() *shared.ResourceGroup\n```\nGetResourceGroup returns the abstract resource group for this item, if any.\n\n```go\nfunc (d *DestroyItem) IsExpandable() bool\n```\nIsExpandable returns true if the item can be expanded in-place.\n\n```go\ntype DestroyModel struct {\n\t// contains filtered or unexported fields\n}\n```\nDestroyModel is the model for the destroy view with real-time split-pane.\n\n```go\nfunc NewDestroyModel(cfg DestroyModelConfig) DestroyModel\n```\nNewDestroyModel creates a new destroy model.\n\n```go\nfunc (m *DestroyModel) DestroyedElements() []DestroyedElement\n```\nDestroyedElements returns the elements that completed destruction.\n\n```go\nfunc (m *DestroyModel) Err() error\n```\nErr returns the error stored in the model.\n\n```go\nfunc (m *DestroyModel) FinalStatus() core.InstanceStatus\n```\nFinalStatus returns the final instance status after destroy.\n\n```go\nfunc (m *DestroyModel) Force() bool\n```\nForce returns whether force mode is enabled.\n\n```go\nfunc (m DestroyModel) Init() tea.Cmd\n```\nInit initializes the destroy model.\n\n```go\nfunc (m *DestroyModel) Items() []DestroyItem\n```\nItems returns the destroy items.\n\n```go\nfunc (m *DestroyModel) ResourcesByName() map[string]*ResourceDestroyItem\n```\nResourcesByName returns the resources lookup map.\n\n```go\nfunc (m *DestroyModel) RetainedElements() []RetainedElement\n```\nRetainedElements returns the elements that were retained during destroy (state cleared, underlying infrastructure preserved).\n\n```go\nfunc (m *DestroyModel) SetChangesetChanges(changesetChanges *changes.BlueprintChanges)\n```\nSetChangesetChanges sets the changeset changes and rebuilds items from them.\n\n```go\nfunc (m *DestroyModel) SetPreDestroyInstanceState(instanceState *state.InstanceState)\n```\nSetPreDestroyInstanceState sets the pre-destroy instance state.\n\n```go\nfunc (m DestroyModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)\n```\nUpdate handles messages for the destroy model.\n\n```go\nfunc (m DestroyModel) View() string\n```\nView renders the destroy model.\n\n```go\ntype DestroyModelConfig struct {\n\tContext          context.Context\n\tDestroyEngine    engine.DeployEngine\n\tLogger           *zap.Logger\n\tChangesetID      string\n\tInstanceID       string\n\tInstanceName     string\n\tForce            bool\n\tStyles           *stylespkg.Styles\n\tIsHeadless       bool\n\tHeadlessWriter   io.Writer\n\tChangesetChanges *changes.BlueprintChanges\n\tJSONMode         bool\n\t// OperationConfig carries provider/transformer/context-variable values\n\t// (including the deploy target) sent to the engine when destroying an\n\t// instance, so provider plugins run against the correct deploy target.\n\tOperationConfig *types.BlueprintOperationConfig\n}\n```\nDestroyModelConfig holds the configuration for creating a new DestroyModel.\n\n```go\ntype DestroySectionGrouper struct {\n\tshared.SectionGrouper\n}\n```\nDestroySectionGrouper groups items into sections for the destroy UI.\n\n```go\ntype DestroyStagingFooterRenderer struct {\n\tChangesetID      string\n\tSummary          ChangeSummary\n\tHasExportChanges bool\n}\n```\nDestroyStagingFooterRenderer renders the footer during staging in destroy flow.\n\n```go\nfunc (r *DestroyStagingFooterRenderer) RenderFooter(model *splitpane.Model, s *styles.Styles) string\n```\nRenderFooter renders the staging confirmation footer.\n\n```go\ntype DestroyStartedMsg struct {\n\tInstanceID string\n}\n```\nDestroyStartedMsg is a message indicating that destroy has started.\n\n```go\ntype DestroyStreamClosedMsg struct{}\n```\nDestroyStreamClosedMsg is sent when the destroy event stream is closed.\n\n```go\ntype DestroyedElement struct {\n\tElementName string\n\tElementPath string\n\tElementType string\n\t// AbstractGroup holds the abstract resource this element was expanded from,\n\t// used to group the element under its source type in the destroy overview.\n\tAbstractGroup *shared.ResourceGroup\n}\n```\nDestroyedElement represents an element that was destroyed successfully.\n\n```go\ntype DriftDetailsRenderer = driftui.DriftDetailsRenderer\n```\nType aliases for drift UI components from driftui package\n\n```go\ntype DriftFooterRenderer = driftui.DriftFooterRenderer\n```\nType aliases for drift UI components from driftui package\n\n```go\ntype DriftSectionGrouper = driftui.DriftSectionGrouper\n```\nType aliases for drift UI components from driftui package\n\n```go\ntype ElementFailure = shared.ElementFailure\n```\nRe-export shared result types for backwards compatibility.\n\n```go\ntype InstanceResolvedMsg struct {\n\tInstanceID   string\n\tInstanceName string\n\tErr          error\n}\n```\nInstanceResolvedMsg is a message indicating instance identifiers have been resolved. Err is set when the instance name could not be looked up, in which case nothing is staged.\n\n```go\ntype InterruptedElement = shared.InterruptedElement\n```\nRe-export shared result types for backwards compatibility.\n\n```go\ntype ItemType = shared.ItemType\n```\nType aliases for shared types.\n\n```go\ntype LinkDestroyItem struct {\n\tLinkID               string\n\tLinkName             string\n\tResourceAName        string\n\tResourceBName        string\n\tAction               ActionType\n\tStatus               core.LinkStatus\n\tPreciseStatus        core.PreciseLinkStatus\n\tFailureReasons       []string\n\tCurrentStageAttempt  int\n\tCanRetryCurrentStage bool\n\tDurations            *state.LinkCompletionDurations\n\tTimestamp            int64\n\tSkipped              bool\n}\n```\nLinkDestroyItem represents a link being destroyed.\n\n```go\nfunc (l *LinkDestroyItem) GetAction() shared.ActionType\n```\n\n```go\nfunc (l *LinkDestroyItem) GetLinkStatus() core.LinkStatus\n```\n\n```go\nfunc (l *LinkDestroyItem) SetSkipped(skipped bool)\n```\n\n```go\ntype MainModel struct {\n\tError error\n\t// contains filtered or unexported fields\n}\n```\nMainModel is the top-level model for the destroy command TUI. It manages the session state and delegates to sub-models.\n\n```go\nfunc NewDestroyApp(cfg DestroyAppConfig) (*MainModel, error)\n```\nNewDestroyApp creates a new destroy application with the given configuration.\n\n```go\nfunc (m MainModel) GetEngine() shared.InstanceLookup\n```\nGetEngine returns the engine for the InstanceResolver interface.\n\n```go\nfunc (m MainModel) GetInstanceID() string\n```\nGetInstanceID returns the instance ID for the InstanceResolver interface.\n\n```go\nfunc (m MainModel) GetInstanceName() string\n```\nGetInstanceName returns the instance name for the InstanceResolver interface.\n\n```go\nfunc (m MainModel) Init() tea.Cmd\n```\nInit initializes the main model.\n\n```go\nfunc (m MainModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)\n```\nUpdate handles messages for the main model.\n\n```go\nfunc (m MainModel) View() string\n```\nView renders the main model.\n\n```go\ntype PostDestroyInstanceStateFetchedMsg struct {\n\tInstanceState *state.InstanceState\n}\n```\nPostDestroyInstanceStateFetchedMsg is sent when instance state has been fetched after destroy.\n\n```go\ntype PreDestroyInstanceStateFetchedMsg struct {\n\tInstanceState *state.InstanceState\n}\n```\nPreDestroyInstanceStateFetchedMsg is sent when instance state has been fetched before destroy.\n\n```go\ntype ResourceDestroyItem struct {\n\tName           string\n\tResourceID     string\n\tResourceType   string\n\tDisplayName    string\n\tAction         ActionType\n\tStatus         core.ResourceStatus\n\tPreciseStatus  core.PreciseResourceStatus\n\tFailureReasons []string\n\tAttempt        int\n\tCanRetry       bool\n\tGroup          int\n\tDurations      *state.ResourceCompletionDurations\n\tTimestamp      int64\n\tSkipped        bool\n\tChanges        *provider.Changes\n\tResourceState  *state.ResourceState\n}\n```\nResourceDestroyItem represents a resource being destroyed with real-time status.\n\n```go\nfunc (r *ResourceDestroyItem) AbstractGroup() *shared.ResourceGroup\n```\nAbstractGroup returns the abstract resource this resource was expanded from, resolved from the change set and any recorded state. Returns nil for resources that were not produced by a transformer.\n\n```go\nfunc (r *ResourceDestroyItem) GetAction() shared.ActionType\n```\n\n```go\nfunc (r *ResourceDestroyItem) GetResourceStatus() core.ResourceStatus\n```\n\n```go\nfunc (r *ResourceDestroyItem) SetSkipped(skipped bool)\n```\n\n```go\ntype RetainedElement = shared.RetainedElement\n```\nRe-export shared result types for backwards compatibility.\n\n```go\ntype StartDestroyMsg struct{}\n```\nStartDestroyMsg is a message to initiate destroy.\n\n","path":"github.com/newstack-cloud/deploy-cli-sdk/tui/destroyui","name":"destroyui","synopsis":"","isRedistributable":true}
