explorer

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnCustomizer

type ColumnCustomizer struct {
	// contains filtered or unexported fields
}

ColumnCustomizer handles the slushbucket interface for column selection

func NewColumnCustomizer

func NewColumnCustomizer() *ColumnCustomizer

NewColumnCustomizer creates a new column customizer

func (*ColumnCustomizer) GetSelectedColumns

func (cc *ColumnCustomizer) GetSelectedColumns() []string

GetSelectedColumns returns the names of selected columns in order

func (*ColumnCustomizer) InitializeFields

func (cc *ColumnCustomizer) InitializeFields(tableMetadata *tui.TableFieldMetadata, selectedColumns []string)

InitializeFields sets up the available and selected fields

func (*ColumnCustomizer) IsActive

func (cc *ColumnCustomizer) IsActive() bool

IsActive returns whether the customizer is active

func (*ColumnCustomizer) SetActive

func (cc *ColumnCustomizer) SetActive(active bool)

SetActive sets the active state

func (*ColumnCustomizer) SetDimensions

func (cc *ColumnCustomizer) SetDimensions(width, height int)

SetDimensions sets the width and height

func (*ColumnCustomizer) Update

func (cc *ColumnCustomizer) Update(msg tea.Msg) (*ColumnCustomizer, tea.Cmd)

Update handles input events

func (*ColumnCustomizer) View

func (cc *ColumnCustomizer) View() string

View renders the column customizer interface

type ConfigManager

type ConfigManager struct {
	// contains filtered or unexported fields
}

ConfigManager handles loading and saving user configuration

func NewConfigManager

func NewConfigManager() *ConfigManager

NewConfigManager creates a new configuration manager

func (*ConfigManager) BackupConfig

func (cm *ConfigManager) BackupConfig() error

BackupConfig creates a backup of the current configuration

func (*ConfigManager) DeleteViewConfiguration

func (cm *ConfigManager) DeleteViewConfiguration(name string) error

DeleteViewConfiguration deletes a view configuration

func (*ConfigManager) GetConfigPath

func (cm *ConfigManager) GetConfigPath() string

GetConfigPath returns the path to the config file

func (*ConfigManager) GetGlobalSettings

func (cm *ConfigManager) GetGlobalSettings() GlobalSettings

GetGlobalSettings returns global settings

func (*ConfigManager) GetViewConfigurations

func (cm *ConfigManager) GetViewConfigurations() map[string]*ViewConfiguration

GetViewConfigurations returns all view configurations

func (*ConfigManager) LoadConfig

func (cm *ConfigManager) LoadConfig() error

LoadConfig loads the configuration from disk

func (*ConfigManager) ResetConfig

func (cm *ConfigManager) ResetConfig() error

ResetConfig resets configuration to defaults

func (*ConfigManager) RestoreConfig

func (cm *ConfigManager) RestoreConfig() error

RestoreConfig restores configuration from backup

func (*ConfigManager) SaveConfig

func (cm *ConfigManager) SaveConfig() error

SaveConfig saves the configuration to disk

func (*ConfigManager) SaveViewConfiguration

func (cm *ConfigManager) SaveViewConfiguration(name string, config *ViewConfiguration) error

SaveViewConfiguration saves a view configuration

func (*ConfigManager) UpdateGlobalSettings

func (cm *ConfigManager) UpdateGlobalSettings(settings GlobalSettings) error

UpdateGlobalSettings updates global settings

type ExportConfig

type ExportConfig struct {
	Scope         ExportScope
	Format        ExportFormat
	ReferenceMode ReferenceValueMode
}

ExportConfig represents export configuration

type ExportDialog

type ExportDialog struct {
	// contains filtered or unexported fields
}

ExportDialog handles the export dialog interface

func NewExportDialog

func NewExportDialog() *ExportDialog

NewExportDialog creates a new export dialog

func (*ExportDialog) GetSelectedConfig

func (ed *ExportDialog) GetSelectedConfig() ExportConfig

GetSelectedConfig returns the currently selected export configuration

func (*ExportDialog) IsActive

func (ed *ExportDialog) IsActive() bool

IsActive returns whether the dialog is active

func (*ExportDialog) SetActive

func (ed *ExportDialog) SetActive(active bool)

SetActive sets the active state

func (*ExportDialog) SetDimensions

func (ed *ExportDialog) SetDimensions(width, height int)

SetDimensions sets the width and height

func (*ExportDialog) Update

func (ed *ExportDialog) Update(msg tea.Msg) (*ExportDialog, tea.Cmd)

Update handles input events

func (*ExportDialog) View

func (ed *ExportDialog) View() string

View renders the export dialog

type ExportFormat

type ExportFormat int

ExportFormat defines the export format

const (
	ExportCSV ExportFormat = iota
	ExportJSON
)

type ExportScope

type ExportScope int

ExportScope defines what data to export

const (
	ExportCurrentView               ExportScope = iota // Current view with filter and selected columns
	ExportCurrentViewAllFields                         // Current view with filter but all fields
	ExportAllRecordsSelectedColumns                    // All records (no filter) with selected columns
	ExportAllRecordsAllFields                          // All records with all fields
)

type GlobalSettings

type GlobalSettings struct {
	DefaultPageSize int    `json:"default_page_size"`
	Theme           string `json:"theme"`
	AutoSave        bool   `json:"auto_save"`
	ExportDirectory string `json:"export_directory"`
}

GlobalSettings represents global user preferences

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model represents the main explorer TUI model

func New

func New(client *servicenow.Client) *Model

New creates a new explorer model

func (Model) Init

func (m Model) Init() tea.Cmd

Init method

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update method

func (Model) View

func (m Model) View() string

View method

type ReferenceValueMode

type ReferenceValueMode int

ReferenceValueMode defines how reference fields should be exported

const (
	ReferenceDisplayValues ReferenceValueMode = iota // Export display values (e.g., "John Doe")
	ReferenceSysIds                                  // Export sys_ids (e.g., "abc123...")
	ReferenceBoth                                    // Export both values (e.g., "John Doe (abc123)")
)

type UserConfig

type UserConfig struct {
	Version            string                        `json:"version"`
	ViewConfigurations map[string]*ViewConfiguration `json:"view_configurations"`
	GlobalSettings     GlobalSettings                `json:"global_settings"`
}

UserConfig represents the user's saved configuration

type ViewConfiguration

type ViewConfiguration struct {
	Name        string   `json:"name"`
	TableName   string   `json:"table_name"`
	Columns     []string `json:"columns"`
	Query       string   `json:"query"`
	Description string   `json:"description"`
	CreatedAt   string   `json:"created_at"`
}

ViewConfiguration represents a saved view configuration

Jump to

Keyboard shortcuts

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