ui

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FailureEmoji           = "❌"
	SuccessEmoji           = "✅"
	FireEmoji              = "🔥"
	TargetEmoji            = "🎯"
	ResourceHighlightStyle = lipgloss.NewStyle().
							Bold(true).
							Foreground(lipgloss.Color("202"))
	BoldWarningTextStyle = lipgloss.NewStyle().
							Padding(1).
							Bold(true).
							Italic(true).
							Foreground(lipgloss.Color("202"))
	BlinkingWarningStyle = lipgloss.NewStyle().
							Bold(true).
							Italic(true).
							Blink(true).
							Underline(true).
							Foreground(lipgloss.Color("201"))
)

Functions

func GetOutputWriter added in v0.43.0

func GetOutputWriter(outputFile string) (io.Writer, func() error, error)

GetOutputWriter returns a writer for the specified output file or stdout if empty

func PrintGeneralErrorReport

func PrintGeneralErrorReport(w io.Writer)

func PrintRunReport

func PrintRunReport(w io.Writer)

func RenderGcpInspectAsJSON added in v0.43.0

func RenderGcpInspectAsJSON(project *gcp.GcpProjectResources, w io.Writer) error

RenderGcpInspectAsJSON renders GCP inspection results as JSON

func RenderGcpResourcesAsTable added in v0.42.0

func RenderGcpResourcesAsTable(account *gcp.GcpProjectResources) error

func RenderGcpResourcesAsTableWithFormat added in v0.43.0

func RenderGcpResourcesAsTableWithFormat(account *gcp.GcpProjectResources, outputFormat string, outputFile string) error

RenderGcpResourcesAsTableWithFormat renders GCP resources in the specified format

func RenderInspectAsJSON added in v0.43.0

func RenderInspectAsJSON(account *aws.AwsAccountResources, query *aws.Query, w io.Writer) error

RenderInspectAsJSON renders AWS inspection results as JSON

func RenderNukeConfirmationPrompt added in v0.33.0

func RenderNukeConfirmationPrompt(prompt string, numRetryCount int) (bool, error)

func RenderNukeReportAsJSON added in v0.43.0

func RenderNukeReportAsJSON(w io.Writer) error

RenderNukeReportAsJSON renders nuke operation results as JSON

func RenderQueryAsBulletList added in v0.33.0

func RenderQueryAsBulletList(query *aws.Query) error

func RenderResourceTypesAsBulletList added in v0.33.0

func RenderResourceTypesAsBulletList(resourceTypes []string) error

func RenderResourcesAsTable added in v0.33.0

func RenderResourcesAsTable(account *aws.AwsAccountResources) error

func RenderResourcesAsTableWithFormat added in v0.43.0

func RenderResourcesAsTableWithFormat(account *aws.AwsAccountResources, query *aws.Query, outputFormat string, outputFile string) error

RenderResourcesAsTableWithFormat renders resources in the specified format

func RenderRunReport added in v0.27.1

func RenderRunReport()

RenderRunReport should be called at the end of a support cloud-nuke function It will print a table showing resources were deleted, and what errors occurred Note that certain functions don't support the report table, such as aws-inspect, which prints its own findings out directly to os.Stdout

func RenderRunReportWithFormat added in v0.43.0

func RenderRunReportWithFormat(outputFormat string, outputFile string)

RenderRunReportWithFormat renders the run report in the specified format

func ShouldSuppressProgressOutput added in v0.43.0

func ShouldSuppressProgressOutput(outputFormat string) bool

ShouldSuppressProgressOutput returns true if progress output should be suppressed

func UrgentMessage

func UrgentMessage(s string)

UrgentMessage is a convenience method to display the supplied string in our pre-configured BlinkingWarningStyle This is appropriate to use as the final prompt to confirm the user really wants to nuke all selected resources

func WarningMessage

func WarningMessage(s string)

WarningMessage is a convenience method to display the supplied string in our pre-configured BoldWarningTextStyle

Types

type GeneralErrorInfo added in v0.43.0

type GeneralErrorInfo struct {
	ResourceType string `json:"resource_type"`
	Description  string `json:"description"`
	Error        string `json:"error"`
}

GeneralErrorInfo represents a general error that occurred during execution

type InspectOutput added in v0.43.0

type InspectOutput struct {
	Timestamp time.Time      `json:"timestamp"`
	Command   string         `json:"command"`
	Query     QueryParams    `json:"query"`
	Resources []ResourceInfo `json:"resources"`
	Summary   InspectSummary `json:"summary"`
}

InspectOutput represents the JSON output structure for inspect commands

type InspectSummary added in v0.43.0

type InspectSummary struct {
	TotalResources int            `json:"total_resources"`
	Nukable        int            `json:"nukable"`
	NonNukable     int            `json:"non_nukable"`
	ByType         map[string]int `json:"by_type"`
	ByRegion       map[string]int `json:"by_region"`
}

InspectSummary provides summary statistics for inspection results

type NukeOutput added in v0.43.0

type NukeOutput struct {
	Timestamp time.Time          `json:"timestamp"`
	Command   string             `json:"command"`
	Account   string             `json:"account,omitempty"`
	Regions   []string           `json:"regions,omitempty"`
	Resources []NukeResourceInfo `json:"resources"`
	Errors    []GeneralErrorInfo `json:"general_errors,omitempty"`
	Summary   NukeSummary        `json:"summary"`
}

NukeOutput represents the JSON output structure for nuke commands

type NukeResourceInfo added in v0.43.0

type NukeResourceInfo struct {
	Identifier   string `json:"identifier"`
	ResourceType string `json:"resource_type"`
	Status       string `json:"status"` // "deleted" or "failed"
	Error        string `json:"error,omitempty"`
}

NukeResourceInfo represents information about a resource deletion attempt

type NukeSummary added in v0.43.0

type NukeSummary struct {
	Total         int `json:"total"`
	Deleted       int `json:"deleted"`
	Failed        int `json:"failed"`
	GeneralErrors int `json:"general_errors"`
}

NukeSummary provides summary statistics for nuke operation results

type QueryParams added in v0.43.0

type QueryParams struct {
	Regions              []string   `json:"regions"`
	ResourceTypes        []string   `json:"resource_types,omitempty"`
	ExcludeAfter         *time.Time `json:"exclude_after,omitempty"`
	IncludeAfter         *time.Time `json:"include_after,omitempty"`
	ListUnaliasedKMSKeys bool       `json:"list_unaliased_kms_keys"`
}

QueryParams represents the query parameters used for resource inspection

type ResourceInfo added in v0.43.0

type ResourceInfo struct {
	ResourceType  string            `json:"resource_type"`
	Region        string            `json:"region"`
	Identifier    string            `json:"identifier"`
	Nukable       bool              `json:"nukable"`
	NukableReason string            `json:"nukable_reason,omitempty"`
	Tags          map[string]string `json:"tags,omitempty"`
	CreatedTime   *time.Time        `json:"created_time,omitempty"`
}

ResourceInfo represents information about a single cloud resource

Jump to

Keyboard shortcuts

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