Documentation ¶
Index ¶
- func Abs(x int) int
- func Argify(data string) (string, string)
- func Atoir(str string, min, max int) (int, error)
- func Atois(strings []string) ([]int, error)
- func BestMatch(pattern string, searchList []string) int
- func Bound(x, lower, upper int) int
- func ClearLine(conn io.Writer)
- func Compare(str1, str2 string) bool
- func DirectionToExitString(direction types.Direction) string
- func ExecMenu(title string, comm types.Communicable, build func(*Menu))
- func Filter(list []string, pattern string) []string
- func FilterItem(item, pattern string) bool
- func FormatName(name string) string
- func GetRawUserInput(conn io.ReadWriter, prompt string, cm types.ColorMode) string
- func GetRawUserInputP(conn io.ReadWriter, prompter Prompter, cm types.ColorMode) string
- func GetRawUserInputSuffix(conn io.ReadWriter, prompt string, suffix string, cm types.ColorMode) string
- func GetRawUserInputSuffixP(conn io.ReadWriter, prompter Prompter, suffix string, cm types.ColorMode) string
- func GetUserInput(conn io.ReadWriter, prompt string, cm types.ColorMode) string
- func GetUserInputP(conn io.ReadWriter, prompter Prompter, cm types.ColorMode) string
- func HandleError(err error)
- func Max(x, y int) int
- func Min(x, y int) int
- func MonitorChannel()
- func Paginate(list []string, width, height int) []string
- func Random(low, high int) int
- func Simplify(str string) string
- func TrimEmptyRows(str string) string
- func TrimLowerRows(rows []string) []string
- func TrimUpperRows(rows []string) []string
- func ValidateName(name string) error
- func Write(conn io.Writer, text string, cm types.ColorMode)
- func WriteLine(conn io.Writer, line string, cm types.ColorMode)
- type Menu
- func (self *Menu) AddAction(key string, text string, handler func())
- func (self *Menu) AddActionI(index int, text string, handler func())
- func (self *Menu) Exit()
- func (self *Menu) GetData(choice string) types.Id
- func (self *Menu) HasAction(key string) bool
- func (self *Menu) OnExit(handler func())
- func (self *Menu) Print(comm types.Communicable, page int, filter string) int
- func (self *Menu) SetTitle(title string)
- type Prompter
- type Set
- type Throttler
- type WatchableReadWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BestMatch ¶
BestMatch searches the given list for the given pattern, the index of the longest match that starts with the given pattern is returned. Returns -1 if no match was found, -2 if the result is ambiguous. The search is case insensitive
func ClearLine ¶
ClearLine sends the VT100 code for erasing the line followed by a carriage return to move the cursor back to the beginning of the line
func DirectionToExitString ¶
func FilterItem ¶
func FormatName ¶
func GetRawUserInput ¶
func GetRawUserInputP ¶
func GetRawUserInputSuffix ¶
func GetRawUserInputSuffixP ¶
func GetUserInput ¶
func GetUserInputP ¶
func HandleError ¶
func HandleError(err error)
func MonitorChannel ¶
func MonitorChannel()
func TrimEmptyRows ¶
func TrimLowerRows ¶
func TrimUpperRows ¶
func ValidateName ¶
Types ¶
type Menu ¶
type Menu struct {
// contains filtered or unexported fields
}
func (*Menu) AddActionI ¶
type Prompter ¶
type Prompter interface {
GetPrompt() string
}
func SimplePrompter ¶
SimpleRompter returns a Prompter that always returns the given string as its prompt
type Throttler ¶
type Throttler struct {
// contains filtered or unexported fields
}
Throttler is a simple utility class that allows events to occur on a deterministic recurring basis. Every call to Sync() will block until the duration of the Throttler's interval has passed since the last call to Sync()
func NewThrottler ¶
type WatchableReadWriter ¶
type WatchableReadWriter struct {
// contains filtered or unexported fields
}
func NewWatchableReadWriter ¶
func NewWatchableReadWriter(rw io.ReadWriter) *WatchableReadWriter
func (*WatchableReadWriter) AddWatcher ¶
func (w *WatchableReadWriter) AddWatcher(rw io.ReadWriter)
func (*WatchableReadWriter) RemoveWatcher ¶
func (w *WatchableReadWriter) RemoveWatcher(rw io.ReadWriter)