Documentation
¶
Index ¶
- Variables
- func GetSeverityColor(severity string) lipgloss.Color
- func InitializeSkin(skinName string, configDir string) error
- type AIAnalysisMsg
- type AttributeStatFormatted
- type DashboardModel
- func (m *DashboardModel) GetCountsHistory() []SeverityCounts
- func (m *DashboardModel) Init() tea.Cmd
- func (m *DashboardModel) SetK8sSource(source K8sSourceInterface)
- func (m *DashboardModel) SetVersionChecker(checker *versioncheck.Checker)
- func (m *DashboardModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *DashboardModel) View() string
- type Drain3Manager
- type HeatmapMinute
- type K8sSourceInterface
- type LogEntry
- type ManualResetMsg
- type PatternCount
- type PatternInfo
- type Section
- type ServiceCount
- type SeverityCounts
- type Skin
- type SkinColors
- type StatItem
- type TickMsg
- type UpdateIntervalMsg
- type UpdateMsg
Constants ¶
This section is empty.
Variables ¶
var ( ColorBlue = lipgloss.Color("#0f93fc") ColorGreen = lipgloss.Color("#49E209") ColorGray = lipgloss.Color("#BCBEC0") ColorDarkGray = lipgloss.Color("#2D2D2D") // Dark gray for modal backgrounds ColorBlack = lipgloss.Color("#000000") ColorWhite = lipgloss.Color("#FFFFFF") ColorRed = lipgloss.Color("#FF6B6B") ColorYellow = lipgloss.Color("#FFD93D") ColorOrange = lipgloss.Color("#FF8C42") ColorPink = lipgloss.Color("#FF69B4") )
Color palette - these will be updated by the skin system
Functions ¶
func GetSeverityColor ¶ added in v0.2.0
GetSeverityColor returns the color for a given severity level This uses semantic colors if defined, otherwise falls back to defaults
func InitializeSkin ¶ added in v0.2.0
InitializeSkin sets up the skin system with the specified skin
Types ¶
type AIAnalysisMsg ¶
type AIAnalysisMsg struct {
Result string
Error error
IsChat bool // true for chat responses, false for initial analysis
}
AIAnalysisMsg represents the result of AI log analysis
type AttributeStatFormatted ¶
AttributeStatFormatted represents a formatted attribute statistic
type DashboardModel ¶
type DashboardModel struct {
// contains filtered or unexported fields
}
DashboardModel represents the main TUI model
func NewDashboardModel ¶
func NewDashboardModel(maxLogBuffer int, updateInterval time.Duration, aiModel string, stopWords map[string]bool, reverseScrollWheel bool) *DashboardModel
NewDashboardModel creates a new dashboard model with stop words
func (*DashboardModel) GetCountsHistory ¶
func (m *DashboardModel) GetCountsHistory() []SeverityCounts
GetCountsHistory returns the current counts history for debugging
func (*DashboardModel) SetK8sSource ¶ added in v0.3.0
func (m *DashboardModel) SetK8sSource(source K8sSourceInterface)
SetK8sSource sets the Kubernetes log source for the dashboard
func (*DashboardModel) SetVersionChecker ¶ added in v0.2.0
func (m *DashboardModel) SetVersionChecker(checker *versioncheck.Checker)
SetVersionChecker sets the version checker for update notifications
type Drain3Manager ¶
type Drain3Manager struct {
// contains filtered or unexported fields
}
Drain3Manager manages the drain3 instance for pattern extraction
func NewDrain3Manager ¶
func NewDrain3Manager() *Drain3Manager
NewDrain3Manager creates a new drain3 manager with optimized settings for log pattern extraction
func (*Drain3Manager) AddLogMessage ¶
func (dm *Drain3Manager) AddLogMessage(message string)
AddLogMessage processes a log message and extracts its pattern
func (*Drain3Manager) GetStats ¶
func (dm *Drain3Manager) GetStats() (patternCount int, totalLogs int)
GetStats returns statistics about the current patterns
func (*Drain3Manager) GetTopPatterns ¶
func (dm *Drain3Manager) GetTopPatterns(limit int) []PatternInfo
GetTopPatterns returns the top N patterns by frequency
func (*Drain3Manager) Reset ¶
func (dm *Drain3Manager) Reset()
Reset clears the drain3 instance and starts fresh
func (*Drain3Manager) ShouldReset ¶
func (dm *Drain3Manager) ShouldReset(resetInterval time.Duration) bool
ShouldReset checks if it's time to reset based on a duration
type HeatmapMinute ¶
type HeatmapMinute struct {
Timestamp time.Time
Counts SeverityCounts
}
HeatmapMinute represents severity counts for one minute in the heatmap
type K8sSourceInterface ¶ added in v0.3.0
type K8sSourceInterface interface {
ListNamespaces() (map[string]bool, error)
ListPods(selectedNamespaces map[string]bool) (map[string]bool, error)
UpdateFilter(namespaces []string, selector string, podNames []string) error
}
K8sSourceInterface defines the interface for Kubernetes log source This allows the TUI to query available namespaces and pods
type LogEntry ¶
type LogEntry struct {
Timestamp time.Time // Receive time - when we processed this log
OrigTimestamp time.Time // Original timestamp from the log (if available)
Severity string
Message string
RawLine string
Attributes map[string]string
}
LogEntry represents a formatted log entry
type ManualResetMsg ¶
type ManualResetMsg struct{}
ManualResetMsg represents a manual reset request triggered by user
type PatternCount ¶
PatternCount represents a pattern and its count for a specific severity
type PatternInfo ¶
PatternInfo represents a log pattern with its statistics
type ServiceCount ¶
ServiceCount represents a service and its count for a specific severity
type SeverityCounts ¶
type SeverityCounts struct {
Trace int
Debug int
Info int
Warn int
Error int
Fatal int
Critical int
Unknown int
Total int
}
SeverityCounts tracks log counts by severity level for a time interval
func NewSeverityCountsFromEntries ¶
func NewSeverityCountsFromEntries(entries []LogEntry) *SeverityCounts
NewSeverityCountsFromEntries creates SeverityCounts from a slice of log entries
func (*SeverityCounts) AddCount ¶
func (sc *SeverityCounts) AddCount(severity string)
AddCount adds a count for the given severity level
type Skin ¶ added in v0.2.0
type Skin struct {
Name string `yaml:"name"`
Description string `yaml:"description,omitempty"`
Author string `yaml:"author,omitempty"`
Colors SkinColors `yaml:"colors"`
}
Skin represents a complete color scheme
var CurrentSkin *Skin
CurrentSkin holds the active skin
func DefaultSkin ¶ added in v0.2.0
func DefaultSkin() *Skin
DefaultSkin returns the default color scheme
type SkinColors ¶ added in v0.2.0
type SkinColors struct {
// UI Component Colors
Primary string `yaml:"primary"` // Main accent color (section borders, highlights)
Secondary string `yaml:"secondary"` // Secondary accent color
Background string `yaml:"background"` // Main background
Surface string `yaml:"surface"` // Secondary background (modals, panels)
Border string `yaml:"border"` // Default border color
BorderActive string `yaml:"border_active"` // Active section border
Text string `yaml:"text"` // Primary text color
TextSecondary string `yaml:"text_secondary"` // Secondary/muted text
TextInverse string `yaml:"text_inverse"` // Text on colored backgrounds
// Chart and Data Colors
ChartTitle string `yaml:"chart_title"` // Chart titles
ChartBar string `yaml:"chart_bar"` // Bar chart bars
ChartAccent string `yaml:"chart_accent"` // Chart accent elements
// Log Entry Colors
LogTimestamp string `yaml:"log_timestamp"` // Log timestamps
LogMessage string `yaml:"log_message"` // Log message text
LogBackground string `yaml:"log_background"` // Log entry background
LogSelected string `yaml:"log_selected"` // Selected log entry
// Severity Level Colors
SeverityTrace string `yaml:"severity_trace"` // TRACE level logs
SeverityDebug string `yaml:"severity_debug"` // DEBUG level logs
SeverityInfo string `yaml:"severity_info"` // INFO level logs
SeverityWarn string `yaml:"severity_warn"` // WARN level logs
SeverityError string `yaml:"severity_error"` // ERROR level logs
SeverityFatal string `yaml:"severity_fatal"` // FATAL/CRITICAL level logs
// Status Colors
Success string `yaml:"success"` // Success states
Warning string `yaml:"warning"` // Warning states
Error string `yaml:"error"` // Error states
Info string `yaml:"info"` // Info states
// Special Elements
Help string `yaml:"help"` // Help text
Highlight string `yaml:"highlight"` // Search highlights, emphasis
Disabled string `yaml:"disabled"` // Disabled elements
}
SkinColors defines the color scheme for the TUI with semantic naming
type UpdateIntervalMsg ¶
UpdateIntervalMsg represents a request to change update interval
type UpdateMsg ¶
type UpdateMsg struct {
Snapshot *memory.FrequencySnapshot
NewLogEntry *LogEntry
NewLogBatch []*LogEntry // Support for batch updates
LineCount int // Deprecated - use SeverityCount
SeverityCount *SeverityCounts // Counts by severity level
ForceCountUpdate bool // Force update count history even with 0
ResetDrain3 bool // Signal to reset drain3 pattern extraction
}
UpdateMsg contains data updates for the dashboard
Source Files
¶
- attributeschart.go
- charts.go
- components.go
- countschart.go
- distributionchart.go
- drain3_manager.go
- formatting.go
- modal_base.go
- modal_counts.go
- modal_help.go
- modal_k8s_filter.go
- modal_log_details.go
- modal_log_viewer.go
- modal_model_selection.go
- modal_patterns.go
- modal_severity_filter.go
- modal_statistics.go
- model.go
- navigation.go
- patternschart.go
- severity.go
- skin.go
- stats.go
- styles.go
- tables.go
- update.go
- view.go
- wordschart.go