Documentation ¶
Index ¶
- Constants
- func AddHistory(input string)
- func HistoryGetTime(history *HistEntry) time.Time
- func RemoveHistory(which int)
- func ReplaceHistoryData(which int, oldData, newData interface{}) (err error)
- func ReplaceHistoryEntry(which int, line string, data interface{}) (err error)
- func ResetHistory()
- type FunMap
- type HistEntry
- type ReadlineReader
- func (rl *ReadlineReader) DisableEcho()
- func (rl *ReadlineReader) DisablePrompt()
- func (rl *ReadlineReader) EnableEcho()
- func (rl *ReadlineReader) EnablePrompt()
- func (rl *ReadlineReader) Readline(prompt string) (value string)
- func (rl *ReadlineReader) SetReadPipe(r io.Reader)
- func (rl *ReadlineReader) SetWritePipe(w io.Writer)
- type UndoEnum
- type UndoList
Constants ¶
View Source
const ( Up string = "^[A" Down string = "^[B" Right string = "^[C" Left string = "^[D" )
Variables ¶
This section is empty.
Functions ¶
func AddHistory ¶
func AddHistory(input string)
func HistoryGetTime ¶
func ReplaceHistoryData ¶
Replace the DATA in the specified history entries, replacing OLD with NEW. WHICH says which one(s) to replace: WHICH == -1 means to replace all of the history entries where entry->data == OLD; WHICH == -2 means to replace the `newest' history entry where entry->data == OLD; and WHICH >= 0 means to replace that particular history entry's data, as
long as it matches OLD. nb: `which` offset is now relative to current history **BREAKING CHANGE**
func ReplaceHistoryEntry ¶
Make the history entry at WHICH have LINE and DATA.
nb: `which` offset is now relative to current history **BREAKING CHANGE**
Types ¶
type FunMap ¶
type FunMap struct {
// contains filtered or unexported fields
}
data structure for mapping textual names to code addresses
type HistEntry ¶
type HistEntry struct { Line string Timestamp int64 Data interface{} // histdata_t #ifdef to void* or char* }
func CurrentHistory ¶
func CurrentHistory() *HistEntry
func HistoryGet ¶
Return the history entry which is logically at OFFSET in the history array.
OFFSET is relative to history_base.
func HistoryList ¶
func HistoryList() (history []*HistEntry)
Return the current history array. The caller has to be careful, since this
is the actual array of data, and could be bashed or made corrupt easily. The array is terminated with a NULL pointer.
func NextHistory ¶
func NextHistory() *HistEntry
Move history_offset forward to the next history entry, and return
a pointer to that entry. If there is no next entry then return a nil pointer.
func PreviousHistory ¶
func PreviousHistory() *HistEntry
Back up history_offset to the previous history entry, and return
a pointer to that entry. If there is no previous entry then return a NULL pointer.
type ReadlineReader ¶
type ReadlineReader struct { Echo echo.Echoer MaskUserInput bool MaskChar string // contains filtered or unexported fields }
func NewReadline ¶
func NewReadline() *ReadlineReader
func (*ReadlineReader) DisableEcho ¶
func (rl *ReadlineReader) DisableEcho()
func (*ReadlineReader) DisablePrompt ¶
func (rl *ReadlineReader) DisablePrompt()
func (*ReadlineReader) EnableEcho ¶
func (rl *ReadlineReader) EnableEcho()
func (*ReadlineReader) EnablePrompt ¶
func (rl *ReadlineReader) EnablePrompt()
func (*ReadlineReader) Readline ¶
func (rl *ReadlineReader) Readline(prompt string) (value string)
func (*ReadlineReader) SetReadPipe ¶
func (rl *ReadlineReader) SetReadPipe(r io.Reader)
func (*ReadlineReader) SetWritePipe ¶
func (rl *ReadlineReader) SetWritePipe(w io.Writer)
Click to show internal directories.
Click to hide internal directories.