Documentation
¶
Index ¶
- Constants
- Variables
- func InsertRune(input []rune, cursorpos int, newchr rune) []rune
- func IsCountEqual(a []string, b []string) bool
- func IsSliceIntEqual(a, b []int) bool
- func KeyStrokesToString(ks []*KeyStroke) string
- func Recover(logger *Logger, cb func())
- func RemoveRuneBackward(input []rune, cursorpos int) []rune
- func RemoveRuneWordBackward(input []rune, cursorpos int) ([]rune, int)
- type Action
- type CmdArgs
- type Command
- type ConcurrentList
- type Event
- type KeyStroke
- type Level
- type Logger
- func (l *Logger) Debug(msg string, args ...interface{})
- func (l *Logger) Debugf(msg string, args ...interface{})
- func (l *Logger) Error(msg string, args ...interface{})
- func (l *Logger) Errorf(msg string, args ...interface{})
- func (l *Logger) Log(msg string, args ...interface{})
- func (l *Logger) Logf(msg string, args ...interface{})
- func (l *Logger) Warn(msg string, args ...interface{})
- func (l *Logger) Warnf(msg string, args ...interface{})
- type Machine
- type State
- type StateListener
- type StateType
- type States
- type Transition
- type TransitionType
- type Transitions
Constants ¶
View Source
const PARTIAL_CHAR = '>'
Variables ¶
View Source
var UnfinishedValueErr = errors.New("unfinished quoted value")
View Source
var UnknownKeyStroke = errors.New("unknown keystroke")
Functions ¶
func IsCountEqual ¶
test if a and b are equal, whatever the order note that this function will sort a and b inplace
func IsSliceIntEqual ¶
func KeyStrokesToString ¶
func RemoveRuneBackward ¶
Types ¶
type ConcurrentList ¶
type ConcurrentList struct {
// contains filtered or unexported fields
}
func NewConcurrentList ¶
func NewConcurrentList(c []interface{}) *ConcurrentList
func (*ConcurrentList) Last ¶
func (c *ConcurrentList) Last() interface{}
func (*ConcurrentList) Length ¶
func (c *ConcurrentList) Length() int
func (*ConcurrentList) Push ¶
func (c *ConcurrentList) Push(item interface{})
func (*ConcurrentList) Remove ¶
func (c *ConcurrentList) Remove(toremove interface{})
type Event ¶
type Event struct { Transition TransitionType Payload interface{} }
type KeyStroke ¶
type KeyStroke struct { Key tcell.Key Rune rune Tev tcell.Event }
func KeyStrokeFromEvent ¶
func KeyStrokeFromEvent(ev tcell.Event) *KeyStroke
func ParseKeyStroke ¶
type Machine ¶
type Machine struct { // the extended state Context interface{} States States Current StateType // contains filtered or unexported fields }
func NewMachine ¶
func (*Machine) OffTransition ¶
func (*Machine) OnTransition ¶
func (m *Machine) OnTransition(f StateListener) int
type State ¶
type State struct { Entry Action Exit Action Transitions Transitions }
type StateListener ¶
type Transition ¶
type TransitionType ¶
type TransitionType string
func (TransitionType) ToCmd ¶
func (t TransitionType) ToCmd() string
type Transitions ¶
type Transitions map[TransitionType]*Transition
Click to show internal directories.
Click to hide internal directories.