constants

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Primary colors
	ColorPrimary   = "#FF8C00" // Orange for selections
	ColorSecondary = "#276749" // Forest green for secondary elements
	ColorTitle     = "#38A169" // Subdued green for titles (previously #00FF7F)
	ColorHeader    = "#48BB78" // Brighter green for table headers

	// Text colors
	ColorText   = "#FFFFFF" // White for regular text
	ColorSubtle = "#718096" // Gray for subtle elements

	// Status colors
	ColorSuccess   = "#38A169" // Subdued green for success messages (previously #00FF7F)
	ColorError     = "#E53E3E" // Red for error messages
	ColorWarning   = "#DD6B20" // Orange for warnings
	ColorInfo      = "#4299E1" // Brighter blue for info messages and column headers (previously #3182CE)
	ColorHighlight = "#F6E05E" // Yellow for highlighting focused elements

	// Background colors
	ColorBg    = "#1A202C" // Dark background
	ColorBgAlt = "#2D3748" // Alternative background
)

Color constants for UI styling

View Source
const (
	// Table dimensions
	TableHeight       = 6
	TableHeightLarge  = 10
	TableDefaultWidth = 30
	TableWideWidth    = 40
	TableNarrowWidth  = 20
	TableDescWidth    = 50

	// Text input dimensions
	TextInputWidth     = 50
	TextInputCharLimit = 100

	// App dimensions
	AppContentLines = 5 // Number of content lines in the UI layout

	// Padding and margins
	PaddingX = 1
	PaddingY = 2

	// Component heights
	HeaderHeight = 2 // Height for headers/titles
	FooterHeight = 1 // Height for footers

	// Viewport dimensions
	ViewportMarginX = 2 // Horizontal margin for viewport
	ViewportMarginY = 3 // Vertical margin for viewport (header + footer)
)

UI dimension constants

View Source
const (
	KeyQ          = "q"
	KeyCtrlC      = "ctrl+c"
	KeyEnter      = "enter"
	KeyCtrlEnter  = "ctrl+enter"
	KeyShiftEnter = "shift+enter"
	KeyF5         = "f5"
	KeyEsc        = "esc"
	KeyUp         = "up"
	KeyDown       = "down"
	KeyAltUp      = "k"
	KeyAltDown    = "j"
	KeyAltBack    = "-"
	KeyTab        = "tab"

	// Vim-like navigation keys
	KeyGotoTop         = "g"
	KeyGotoBottom      = "G"
	KeyHome            = "home"
	KeyEnd             = "end"
	KeyHalfPageUp      = "ctrl+u"
	KeyHalfPageDown    = "ctrl+d"
	KeyAltHalfPageUp   = "u"
	KeyAltHalfPageDown = "d"
	KeyPageUp          = "pgup"
	KeyPageDown        = "pgdown"
	KeyAltPageUp       = "b"
	KeyAltPageDown     = "f"
	KeySpace           = " "
)

Key constants for keyboard input

View Source
const (
	// AWS authentication methods
	AWSProfileAuth = "profile"

	// Azure authentication methods (future)
	AzureCliAuth       = "cli"
	AzureConfigDirAuth = "config-dir"

	// GCP authentication methods (future)
	GCPServiceAccountAuth     = "service-account"
	GCPApplicationDefaultAuth = "adc"
)

Authentication method constants

View Source
const (
	// AWS configuration keys
	AWSProfileKey = "profile"
	AWSRegionKey  = "region"

	// Azure configuration keys (future)
	AzureSubscriptionKey = "subscription"
	AzureLocationKey     = "location"
	AzureTenantKey       = "tenant"
	AzureConfigDirKey    = "config-dir"

	// GCP configuration keys (future)
	GCPProjectKey        = "project"
	GCPZoneKey           = "zone"
	GCPRegionKey         = "region"
	GCPServiceAccountKey = "service-account-path"
)

Configuration key constants

View Source
const (
	// Description messages
	MsgAppDescription = "A simple tool to manage your cloud resources"

	// Loading messages
	MsgLoadingApprovals  = "Loading approvals..."
	MsgLoadingPipelines  = "Loading pipelines..."
	MsgLoadingFunctions  = "Loading functions..."
	MsgStartingPipeline  = "Starting pipeline..."
	MsgExecutingApproval = "Executing approval action..."
	MsgExecutingLambda   = "Executing Lambda function..."

	// Input placeholders
	MsgEnterProfile          = "Enter AWS profile name..."
	MsgEnterRegion           = "Enter AWS region..."
	MsgEnterComment          = "Enter comment..."
	MsgEnterApprovalComment  = "Enter approval comment..."
	MsgEnterRejectionComment = "Enter rejection comment..."
	MsgEnterCommitID         = "Enter commit ID..."
	MsgEnterLambdaPayload    = "Enter Lambda JSON payload..."

	// Success messages
	MsgApprovalSuccess      = "Successfully approved pipeline: %s, stage: %s, action: %s"
	MsgRejectionSuccess     = "Successfully rejected pipeline: %s, stage: %s, action: %s"
	MsgPipelineStartSuccess = "Successfully started pipeline: %s"
	MsgLambdaExecuteSuccess = "Successfully executed Lambda function: %s"

	// Error messages
	MsgErrorGeneric       = "Error: %s"
	MsgErrorNoApproval    = "No approval selected"
	MsgErrorNoPipeline    = "No pipeline selected"
	MsgErrorNoFunction    = "No function selected"
	MsgNoFunctionSelected = "No function selected"
	MsgLambdaExecuteError = "Error executing Lambda function %s: %v"
	MsgErrorEmptyCommitID = "Commit ID cannot be empty"
	MsgErrorEmptyComment  = "Comment cannot be empty"
	MsgErrorInvalidJSON   = "Invalid JSON payload"
)

Message constants for UI text

View Source
const (
	TitleProviders       = "Select Cloud Provider"
	TitleAWSConfig       = "AWS Configuration"
	TitleSelectProfile   = "Select AWS Profile"
	TitleSelectRegion    = "Select AWS Region"
	TitleSelectService   = "Select AWS Service"
	TitleSelectCategory  = "Select Category"
	TitleSelectOperation = "Select Operation"
	TitleApprovals       = "Pipeline Approvals"
	TitleConfirmation    = "Execute Action"
	TitleSummary         = "Enter Comment"
	TitleExecutingAction = "Execute Action"
	TitlePipelineStatus  = "Select Pipeline"
	TitlePipelineStages  = "Pipeline Stages"
	TitleError           = "Error"
	TitleSuccess         = "Success"
	TitleHelp            = "Help"
	TitleFunctionStatus  = "Lambda Functions"
	TitleFunctionDetails = "Function Details"
	TitleLambdaExecute   = "Lambda Payload (JSON)"
	TitleLambdaResponse  = "Lambda Response"
)

Title constants for different views

Variables

View Source
var (
	// DefaultAWSRegions is a list of commonly used AWS regions
	DefaultAWSRegions = []string{
		"us-east-1",
		"us-east-2",
		"us-west-1",
		"us-west-2",
		"eu-west-1",
		"eu-west-2",
		"eu-central-1",
		"ap-southeast-1",
		"ap-southeast-2",
		"ap-northeast-1",
	}
)

AWS region constants

Functions

This section is empty.

Types

type View

type View int

View represents different screens in the application

const (
	ViewProviders View = iota
	ViewAWSConfig
	ViewSelectService
	ViewSelectCategory
	ViewSelectOperation
	ViewApprovals
	ViewPipelineStatus
	ViewPipelineStages
	ViewConfirmation
	ViewSummary
	ViewExecutingAction
	ViewError
	ViewSuccess
	ViewHelp

	// New view states for the updated model
	ViewAuthMethodSelect
	ViewAuthConfig
	ViewProviderConfig
	ViewAuthError

	// Lambda function views
	ViewFunctionStatus
	ViewFunctionDetails
	ViewLambdaExecute
	ViewLambdaResponse
)

Jump to

Keyboard shortcuts

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