Documentation
¶
Index ¶
Constants ¶
View Source
const HISTORY_FILENAME = ".magichistory"
Variables ¶
This section is empty.
Functions ¶
func RunTui ¶
func RunTui(config *GreenTeaConfig)
Types ¶
type CommandError ¶
type CommandError struct {
CommandError string
}
type GreenTeaConfig ¶
type GreenTeaConfig struct {
RefreshDelay int
Commands []*cli.Command
LogLeaf *StringLeaf
QuitLeaf *Leaf[error] // once a print is added, the applecation quits with the added message
ExitLeaf *Leaf[func()] // functions to run on exit
History *History
CommandError *CommandError
// contains filtered or unexported fields
}
type Leaf ¶
type Leaf[T any] struct { // contains filtered or unexported fields }
func (*Leaf[T]) Harvest ¶
Returns the oldest element and true, then removes it from the leaf. Return an empty var of type T and false if leaf has no elements
func (*Leaf[T]) HarvestAll ¶
func (leaf *Leaf[T]) HarvestAll() []T
Returns all items from leaf and clears it.
type StringLeaf ¶
func (*StringLeaf) GetAll ¶
func (leaf *StringLeaf) GetAll() []string
Return a slice of all items in leaf
func (*StringLeaf) Harvest ¶
func (leaf *StringLeaf) Harvest() (string, bool)
Returns the oldest element and true, then removes it from the leaf. Return an empty string and false if leaf has no elements
func (*StringLeaf) HarvestAll ¶
func (leaf *StringLeaf) HarvestAll() []string
Returns all items from leaf and clears it.
func (*StringLeaf) Printlnf ¶
func (leaf *StringLeaf) Printlnf(format string, a ...any)
Implements fmt.Printf() with a new line after
Click to show internal directories.
Click to hide internal directories.