Documentation
¶
Index ¶
- Constants
- Variables
- func ColorizeDisposition(disp string) string
- func ColorizeResult(result string) string
- func CreateReportListItems(reports []model.DMARCReport) []list.Item
- func RenderHelp(showReport bool, activeTab int, searching bool, keys KeyMap) string
- func SetupReportList(reports []model.DMARCReport, width, height int) list.Model
- func UpdateStyles(width int)
- type KeyMap
- type Model
- type ReportItem
Constants ¶
View Source
const ( ColorGreen = lipgloss.Color("#25A065") ColorRed = lipgloss.Color("#FF4040") ColorYellow = lipgloss.Color("#FFD700") ColorPink = lipgloss.Color("#FF5F87") ColorWhite = lipgloss.Color("#FFFDF5") ColorGray = lipgloss.Color("#666666") ColorDimGray = lipgloss.Color("#444444") ColorDarkBg = lipgloss.Color("#202020") ColorLightFg = lipgloss.Color("#DDDDDD") )
Color palette
Variables ¶
View Source
var ( // AppStyle is the main application container style AppStyle = lipgloss.NewStyle(). Padding(1, 0). Border(lipgloss.HiddenBorder()) // TitleStyle is the style for the application title TitleStyle = lipgloss.NewStyle(). Foreground(ColorWhite). Background(ColorGreen). Width(100). Padding(0, 1). Bold(true) // TabStyle is the style for inactive tabs TabStyle = lipgloss.NewStyle(). Foreground(ColorLightFg). Background(ColorDimGray). Padding(0, 2) // ActiveTabStyle is the style for the active tab ActiveTabStyle = lipgloss.NewStyle(). Foreground(ColorWhite). Background(ColorGreen). Padding(0, 2). Bold(true) // TabBarStyle is the container for the tab bar TabBarStyle = lipgloss.NewStyle(). Background(ColorDimGray) // StatusBarStyle is the style for the status bar StatusBarStyle = lipgloss.NewStyle(). Foreground(ColorWhite). Background(ColorGray). Width(100). Padding(0, 1) // HelpStyle is used for the help bar HelpStyle = lipgloss.NewStyle(). Padding(0, 1). Background(ColorDarkBg). Foreground(ColorLightFg) // ErrorStyle is for error messages ErrorStyle = lipgloss.NewStyle(). Foreground(ColorWhite). Background(ColorRed). Padding(0, 1). Width(100). Bold(true) // SectionHeaderStyle is used for report section headers SectionHeaderStyle = lipgloss.NewStyle(). Foreground(ColorPink). Bold(true) // SelectedItemStyle is used for highlighting selected items SelectedItemStyle = lipgloss.NewStyle(). Foreground(ColorGreen). Bold(true) // PassStyle renders pass results in green PassStyle = lipgloss.NewStyle(). Foreground(ColorGreen). Bold(true) // FailStyle renders fail results in red FailStyle = lipgloss.NewStyle(). Foreground(ColorRed). Bold(true) // WarnStyle renders soft-fail/neutral results in yellow WarnStyle = lipgloss.NewStyle(). Foreground(ColorYellow) // TableHeaderStyle is for table headers TableHeaderStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorPink). Padding(0, 1) // TableCellStyle is for table cells TableCellStyle = lipgloss.NewStyle(). Padding(0, 1) // SearchStyle is for the search input SearchStyle = lipgloss.NewStyle(). Foreground(ColorWhite). Background(ColorDimGray). Padding(0, 1) )
Functions ¶
func ColorizeDisposition ¶
ColorizeDisposition returns a styled string for dispositions
func ColorizeResult ¶
ColorizeResult returns a styled string for auth results (pass/fail/softfail)
func CreateReportListItems ¶
func CreateReportListItems(reports []model.DMARCReport) []list.Item
CreateReportListItems creates list items from DMARC reports
func RenderHelp ¶
RenderHelp renders a simplified help view based on view state
func SetupReportList ¶
func SetupReportList( reports []model.DMARCReport, width, height int, ) list.Model
SetupReportList initializes a list with DMARC reports
func UpdateStyles ¶
func UpdateStyles(width int)
UpdateStyles updates the styles based on the window width
Types ¶
type KeyMap ¶
type KeyMap struct {
Up key.Binding
Down key.Binding
Enter key.Binding
Back key.Binding
Quit key.Binding
Reload key.Binding
Search key.Binding
Tab1 key.Binding
Tab2 key.Binding
Tab3 key.Binding
}
KeyMap defines the keybindings for the application
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model represents the state of the application
type ReportItem ¶
type ReportItem struct {
Report model.DMARCReport
}
ReportItem is a list item for the list model
func (ReportItem) Description ¶
func (r ReportItem) Description() string
Description returns the description for the item
func (ReportItem) FilterValue ¶
func (r ReportItem) FilterValue() string
FilterValue returns the value used for filtering
Click to show internal directories.
Click to hide internal directories.