Documentation ¶
Index ¶
- Constants
- Variables
- func ColorizeStatusCell(status string) (tcell.Color, string)
- func DateTimeDiff(dateTime time.Time) string
- func DateTimeToStr(dateTime time.Time) string
- func DeactivateListeners()
- func EnsureDirPath(path string, mod os.FileMode) error
- func FormatMemoryUsage(value int) int
- func GetID(id string) string
- func IntToStr(value int) string
- func IntToUint64(v int) uint64
- func Log(kind, message string)
- func NodeStatusCell(status string) (tcell.Color, string)
- func SafeDeref[T any](p *T) T
- func SetCellTextColor(text, color string) string
- func SetLogLevels()
- func Split(str, sep string) []string
- func StrToInt(s string) int
- func Stringify(st interface{}) string
- func ToCapitalize(str string) string
- type Alert
- type Listener
- type Logger
- func (l *Logger) Error(message string)
- func (l *Logger) Errorf(format string, v ...any)
- func (l *Logger) Info(message string)
- func (l *Logger) Infof(format string, v ...any)
- func (l *Logger) Log(kind, message string)
- func (l *Logger) Warn(message string)
- func (l *Logger) Warnf(format string, v ...any)
- func (l *Logger) Warning(message string)
- func (l *Logger) Warningf(format string, v ...any)
- type NtuiKey
Constants ¶
View Source
const ( DefaultFlashDelay = 3 * time.Second Loader = "loader" )
View Source
const ( ColorWhite = tcell.ColorWhite ColorGray = tcell.ColorGray ColorRed = tcell.ColorRed ColorGreen = tcell.ColorGreen ColorOrange = tcell.ColorOrange )
View Source
const ( ColorTOrange = "orange" ColorTWhite = "white" ColorTBlue = "blue" ColorTRed = "red" ColorTGreen = "green" ColorTad7c5a = "#ad7c5a" ColorT70d5bf = "#70d5bf" )
View Source
const ( DefaultDirMod os.FileMode = 0755 DefaultFileMod os.FileMode = 0600 )
View Source
const ( Info = "info" Warning = "warning" Error = "error" )
Variables ¶
View Source
var ( NtuiExitKey = NtuiKey{ Key: tcell.KeyCtrlC, KeyLabel: "Ctrl + c", KeyDescription: "Control and c", } NtuiEnterKey = NtuiKey{ Key: tcell.KeyEnter, KeyLabel: "enter", KeyDescription: "Enter Key", } NtuiEscKey = NtuiKey{ Key: tcell.KeyEsc, KeyLabel: "Esc", KeyDescription: "Esc key", } NtuiTabKey = NtuiKey{ Key: tcell.KeyTAB, KeyLabel: "Tab", KeyDescription: "Tab Key", } NtuiCtrlRKey = NtuiKey{ Key: tcell.KeyCtrlR, KeyLabel: "Ctrl + r", KeyDescription: "Control and r", } NtuiCtrlVKey = NtuiKey{ Key: tcell.KeyCtrlV, KeyLabel: "Ctrl + v", KeyDescription: "Control and v", } NtuiRuneKey = NtuiKey{ Key: tcell.KeyRune, KeyLabel: "rune keys", KeyDescription: "Rune keys", } NtuiCtrlTKey = NtuiKey{ Key: tcell.KeyCtrlT, KeyLabel: "ctrl + t", KeyDescription: "Control and T", } NtuiCtrlQKey = NtuiKey{ Key: tcell.KeyCtrlQ, KeyLabel: "ctrl + q", KeyDescription: "Control and Q", } NtuiCtrlSKey = NtuiKey{ Key: tcell.KeyCtrlS, KeyLabel: "ctrl + s", KeyDescription: "Control and S", } NtuiCtrlJKey = NtuiKey{ Key: tcell.KeyCtrlJ, KeyLabel: "ctrl + j", KeyDescription: "Control and J", } NtuiCtrlDKey = NtuiKey{ Key: tcell.KeyCtrlD, KeyLabel: "ctrl + d", KeyDescription: "Control and D", } )
View Source
var AllListeners []*Listener
View Source
var NtuiKeyBindings = []NtuiKey{ NtuiExitKey, }
Functions ¶
func ColorizeStatusCell ¶
func DateTimeDiff ¶
func DateTimeToStr ¶
func DeactivateListeners ¶
func DeactivateListeners()
func FormatMemoryUsage ¶
func IntToUint64 ¶
func NodeStatusCell ¶
func SetCellTextColor ¶
func SetLogLevels ¶
func SetLogLevels()
func ToCapitalize ¶
Types ¶
type Alert ¶
type Alert struct { Message models.AlertMessage Duration time.Duration AlertChan chan models.AlertMessage }
func (*Alert) SendMessage ¶
type Listener ¶
type Listener struct { Ticker *time.Ticker StopChan chan bool Function func() RefreshRate time.Duration }
func NewListener ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.