Documentation
¶
Index ¶
- Constants
- Variables
- func ExtractPaginationToken(jsonOutput string, command Command) string
- func GetAvailableResourceNames() []string
- func Init(embeddedFS fs.FS)
- func StripFavouritePrefix(name string) string
- type Action
- type BreadcrumbType
- type Command
- type FavouritesStore
- func (f *FavouritesStore) ApplyFavourites(resource string, command string, rows [][]string, rowData []interface{}) ([][]string, []interface{})
- func (f *FavouritesStore) IsFavourite(resource string, command string, item string) bool
- func (f *FavouritesStore) Load()
- func (f *FavouritesStore) Save()
- func (f *FavouritesStore) Toggle(resource string, command string, item string) bool
- type NavigationState
- type Pagination
- type Parse
- type Resource
- type SettingsStore
- type TableData
- type UIState
Constants ¶
const ConfigurationsDir = "configurations"
const ConfigurationsFileExtension = ".yaml"
const VariablePlaceHolderPrefix = "$"
Variables ¶
var Favourites = &FavouritesStore{}
Favourites is the global singleton for managing favourited items.
var Resources = map[string]Resource{}
var Settings = &SettingsStore{}
Settings is the global singleton for user settings.
Functions ¶
func ExtractPaginationToken ¶
ExtractPaginationToken extracts the next page token from JSON output
func GetAvailableResourceNames ¶
func GetAvailableResourceNames() []string
func StripFavouritePrefix ¶
StripFavouritePrefix removes the favourite star prefix from an item name.
Types ¶
type Action ¶
type Action struct {
Type string `yaml:"type"` // Action type, e.g. "download"
Rune string `yaml:"rune"` // Single character shortcut key
Description string `yaml:"description"` // Description shown in shortcut bar
TargetCommand string `yaml:"targetCommand"` // Which command to execute for this action
}
type BreadcrumbType ¶
type BreadcrumbType string
const ( BreadcrumbProfiles BreadcrumbType = "profiles" BreadcrumbProfile BreadcrumbType = "profile" BreadcrumbResource BreadcrumbType = "resource" BreadcrumbCommand BreadcrumbType = "command" BreadcrumbSelectedItem BreadcrumbType = "selected_item" BreadcrumbDependentCmds BreadcrumbType = "dependent_commands" // List of dependent commands to choose from BreadcrumbDependentCmd BreadcrumbType = "dependent_command" BreadcrumbJsonView BreadcrumbType = "json_view" BreadcrumbProcessedJson BreadcrumbType = "processed_json" )
type Command ¶
type Command struct {
Name string `yaml:"name"`
ResourceName string `yaml:"resourceName"`
DefaultCommand string `yaml:"defaultCommand"`
DependsOn string `yaml:"depends_on"`
Arguments []string `yaml:"arguments"`
View string `yaml:"view"`
Parse Parse `yaml:"parse"`
ShowJsonViewer bool `yaml:"showJsonViewer"`
RerunOnBack bool `yaml:"rerunOnBack"` // If true, rerun command when navigating back; if false, use cached result
RequiresKeyInput bool `yaml:"requiresKeyInput"` // If true, prompt user for key value before executing
Favouritable bool `yaml:"favouritable"` // If true, enable 'f' shortcut to toggle favourites
Pagination *Pagination `yaml:"pagination,omitempty"` // Pagination configuration
Actions []Action `yaml:"actions,omitempty"` // Context-specific actions (e.g., download)
}
type FavouritesStore ¶
type FavouritesStore struct {
Items map[string][]string `yaml:"favourites"`
// contains filtered or unexported fields
}
FavouritesStore holds the favourites data keyed by "resource:command" -> list of item names.
func (*FavouritesStore) ApplyFavourites ¶
func (f *FavouritesStore) ApplyFavourites(resource string, command string, rows [][]string, rowData []interface{}) ([][]string, []interface{})
ApplyFavourites reorders rows so favourited items appear at the top with a star prefix on their first column. rowData (for JSON viewer) is reordered in sync. Returns the reordered rows and rowData.
func (*FavouritesStore) IsFavourite ¶
func (f *FavouritesStore) IsFavourite(resource string, command string, item string) bool
IsFavourite checks if an item is a favourite for the given resource:command.
func (*FavouritesStore) Load ¶
func (f *FavouritesStore) Load()
Load reads the favourites file from disk. If it doesn't exist, starts empty.
type NavigationState ¶
type NavigationState struct {
}
type Pagination ¶
type Pagination struct {
Enabled bool `yaml:"enabled"`
NextTokenParam string `yaml:"nextTokenParam"` // Parameter name for next token (e.g., "--starting-token" or "--exclusive-start-key")
NextTokenJsonPath string `yaml:"nextTokenJsonPath"` // JSON path to extract next token (e.g., "NextToken" or "LastEvaluatedKey")
}
type Resource ¶
type Resource struct {
Name string `yaml:"name"`
DefaultCommand string `yaml:"defaultCommand"`
Commands []Command `yaml:"commands"`
}
func (*Resource) GetCommand ¶
func (*Resource) GetCommandNames ¶
type SettingsStore ¶
type SettingsStore struct {
// contains filtered or unexported fields
}
SettingsStore holds the user-configurable settings, persisted to disk.
func (*SettingsStore) Load ¶
func (s *SettingsStore) Load()
Load reads the settings file from disk. If it doesn't exist, starts with defaults (animations: false).
type UIState ¶
type UIState struct {
Profile string `yaml:"profile"`
Resource Resource `yaml:"resource"`
Command Command `yaml:"command"`
SelectedItems map[string]string `yaml:"selectedItems"`
CommandBarVisible bool `yaml:"commandBarVisible"`
Breadcrumbs []string `yaml:"breadcrumbs"`
CommandCache map[string]string // Cache of command results: "resource:command:params" -> output
ViewStack []tview.Primitive
ProcessedJsonData interface{} // Stores processed JSON data (parsed or decompressed)
JsonViewerCallback func() // Callback to rebuild JSON viewer
SelectedNodeText string // Stores the text of the selected node for focus restoration
CurrentPageToken string // Current page token for active paginated command
PageHistory []string // Stack of page tokens for backward navigation
OriginalTableData *TableData // Original unfiltered table data for search/filter
ShowDynamoDBJsonFormat bool // Toggle for DynamoDB JSON format vs regular JSON (true = DynamoDB style)
InDynamoDBJsonViewer bool // True when viewing a DynamoDB item in the JSON viewer
InContentView bool // True when viewing S3 object content (contentView)
ContentViewPretty bool // True when content view is in pretty/formatted mode (toggled by 'v')
ContentViewObjectKey string // Object key of the currently viewed content (for toggle rebuild)
ContentViewData []byte // Raw bytes of the currently viewed content (for toggle rebuild)
}
func (*UIState) PaginationPageInfo ¶
PaginationPageInfo returns the current page number and whether a next page is available. Page number is derived from the length of the page history stack. HasNext is true when the current navigation state holds a non-empty pagination token.