{"modulePath":"github.com/newstack-cloud/deploy-cli-sdk","version":"v0.10.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package driftui\n\n## Functions\n\n```go\nfunc BuildDriftItems(\n\tresult *container.ReconciliationCheckResult,\n\tinstanceState *state.InstanceState,\n) []splitpane.Item\n```\nBuildDriftItems creates DriftItems from a ReconciliationCheckResult. instanceState is optional - when provided, it enables resource state lookup for displaying computed fields/outputs.\n\n```go\nfunc HintForContext(ctx DriftContext) string\n```\nHintForContext returns the appropriate hint text for the given drift context.\n\n```go\nfunc HumanReadableAction(action container.ReconciliationAction) string\n```\nHumanReadableAction converts a ReconciliationAction to a human-readable label.\n\n```go\nfunc HumanReadableDriftType(t container.ReconciliationType) string\n```\nHumanReadableDriftType converts a ReconciliationType to a short uppercase label.\n\n```go\nfunc HumanReadableDriftTypeLabel(t container.ReconciliationType) string\n```\nHumanReadableDriftTypeLabel converts a ReconciliationType to a human-readable label.\n\n```go\nfunc SetCLIName(name string)\n```\nSetCLIName overrides the CLI name used in drift hints. Empty values are ignored so the \"bluelink\" default is preserved.\n\n```go\nfunc SortDriftItems(items []splitpane.Item)\n```\nSortDriftItems sorts items alphabetically by name.\n\n## Types\n\n```go\ntype DriftContext string\n```\nDriftContext determines the contextual hints shown in the footer.\n\n```go\nconst (\n\t// DriftContextStage is used when drift is detected during the stage command.\n\t// Hint: \"Use --skip-drift-check to skip drift detection\"\n\tDriftContextStage DriftContext = \"stage\"\n\t// DriftContextDeployStage is used when drift is detected during the staging phase of deploy --stage.\n\t// Hint: \"Use --skip-drift-check to skip drift detection\"\n\tDriftContextDeployStage DriftContext = \"deploy_stage\"\n\t// DriftContextDeploy is used when drift is detected during deployment (409 response).\n\t// Hint: \"Use --force to override drift check\"\n\tDriftContextDeploy DriftContext = \"deploy\"\n\t// DriftContextDestroy is used when drift is detected during destroy (409 response).\n\t// Hint: \"Use --force to override drift check\"\n\tDriftContextDestroy DriftContext = \"destroy\"\n)\n```\n\n```go\ntype DriftDetailsRenderer struct {\n\tMaxExpandDepth       int\n\tNavigationStackDepth int\n}\n```\nDriftDetailsRenderer implements splitpane.DetailsRenderer for drift review UI.\n\n```go\nfunc (r *DriftDetailsRenderer) RenderDetails(item splitpane.Item, width int, s *styles.Styles) string\n```\nRenderDetails renders the right pane content for a selected drift item.\n\n```go\ntype DriftDetectedMsg struct {\n\t// ReconciliationResult contains the full drift/interrupted state detection result.\n\tReconciliationResult *container.ReconciliationCheckResult\n\t// Message explains what was detected.\n\tMessage string\n\t// InstanceID is the ID of the blueprint instance.\n\tInstanceID string\n\t// ChangesetID is the ID of the changeset (for continuing deployment after reconciliation).\n\tChangesetID string\n\t// InstanceState is the current instance state (for displaying computed fields).\n\tInstanceState *state.InstanceState\n}\n```\nDriftDetectedMsg is sent when drift is detected during staging or deployment. For staging: triggered by the DriftDetected streaming event. For deployment: triggered by a 409 DriftBlockedResponse.\n\n```go\ntype DriftFooterRenderer struct {\n\tContext DriftContext\n}\n```\nDriftFooterRenderer implements splitpane.FooterRenderer for drift review UI.\n\n```go\nfunc (r *DriftFooterRenderer) RenderFooter(model *splitpane.Model, s *styles.Styles) string\n```\nRenderFooter renders the drift review footer with options and contextual hint.\n\n```go\ntype DriftItem struct {\n\tType         DriftItemType\n\tName         string\n\tResourceType string // For resources: the resource type (e.g., \"aws/s3/bucket\")\n\tChildPath    string // Path to child blueprint (e.g., \"childA\" or \"childA.childB\")\n\tDriftType    container.ReconciliationType\n\t// Changes for resources\n\tResourceResult *container.ResourceReconcileResult\n\t// ResourceState from instance state (for computed fields/outputs)\n\tResourceState *state.ResourceState\n\t// Changes for links\n\tLinkResult  *container.LinkReconcileResult\n\tRecommended container.ReconciliationAction\n\t// For hierarchical display\n\tDepth       int\n\tParentChild string\n\t// Children for child blueprint summary items\n\tChildren []*DriftItem\n}\n```\nDriftItem represents a resource or link with drift for the split pane.\n\n```go\nfunc (d *DriftItem) CanDrillDown() bool\n```\nCanDrillDown returns true if the item can be drilled into.\n\n```go\nfunc (d *DriftItem) GetAction() string\n```\nGetAction returns the action badge text.\n\n```go\nfunc (d *DriftItem) GetChildren() []splitpane.Item\n```\nGetChildren returns child items when expanded.\n\n```go\nfunc (d *DriftItem) GetDepth() int\n```\nGetDepth returns the nesting depth for indentation.\n\n```go\nfunc (d *DriftItem) GetID() string\n```\nGetID returns a unique identifier for the item.\n\n```go\nfunc (d *DriftItem) GetIcon(selected bool) string\n```\nGetIcon returns an icon for the item.\n\n```go\nfunc (d *DriftItem) GetIconStyled(s *styles.Styles, styled bool) string\n```\nGetIconStyled returns a styled icon for the item.\n\n```go\nfunc (d *DriftItem) GetItemType() string\n```\nGetItemType returns the type for section grouping.\n\n```go\nfunc (d *DriftItem) GetName() string\n```\nGetName returns the display name for the item.\n\n```go\nfunc (d *DriftItem) GetParentID() string\n```\nGetParentID returns the parent item ID.\n\n```go\nfunc (d *DriftItem) IsExpandable() bool\n```\nIsExpandable returns true if the item can be expanded in-place.\n\n```go\ntype DriftItemType string\n```\nDriftItemType represents the type of drift item.\n\n```go\nconst (\n\tDriftItemTypeResource DriftItemType = \"resource\"\n\tDriftItemTypeLink     DriftItemType = \"link\"\n\tDriftItemTypeChild    DriftItemType = \"child\"\n)\n```\n\n```go\ntype DriftSectionGrouper struct {\n\tMaxExpandDepth int\n}\n```\nDriftSectionGrouper implements splitpane.SectionGrouper for drift review UI.\n\n```go\nfunc (g *DriftSectionGrouper) GroupItems(\n\titems []splitpane.Item,\n\tisExpanded func(id string) bool,\n) []splitpane.Section\n```\nGroupItems organizes drift items into sections: Resources, Links, Child Blueprints.\n\n```go\ntype HeadlessDriftPrinter struct {\n\t// contains filtered or unexported fields\n}\n```\nHeadlessDriftPrinter prints drift information in headless mode.\n\n```go\nfunc NewHeadlessDriftPrinter(printer *headless.Printer, context DriftContext) *HeadlessDriftPrinter\n```\nNewHeadlessDriftPrinter creates a new headless drift printer.\n\n```go\nfunc (p *HeadlessDriftPrinter) PrintDriftDetected(result *container.ReconciliationCheckResult)\n```\nPrintDriftDetected prints the full drift detection output.\n\n```go\ntype ReconciliationCompleteMsg struct {\n\t// InstanceID is the ID of the blueprint instance that was reconciled.\n\tInstanceID string\n\t// ResourcesUpdated is the number of resources that were successfully updated.\n\tResourcesUpdated int\n\t// LinksUpdated is the number of links that were successfully updated.\n\tLinksUpdated int\n}\n```\nReconciliationCompleteMsg is sent after successful reconciliation.\n\n```go\ntype ReconciliationErrorMsg struct {\n\t// Err is the error that occurred during reconciliation.\n\tErr error\n}\n```\nReconciliationErrorMsg is sent when reconciliation fails.\n\n","path":"github.com/newstack-cloud/deploy-cli-sdk/tui/driftui","name":"driftui","synopsis":"","isRedistributable":true}
