Documentation
¶
Index ¶
- Variables
- func AsRelaxedRegexp(regex string) (ret string)
- func CheckSelfRunning(opts Options) (err error)
- func Cli(opts Options, argsin []string) (args []string, err error)
- func DefaultConfigFile(opts Options) string
- func Ui(opts Options, args []string) (ret string, err error)
- type AsyncSource
- type Buffer
- type Command
- type ErrorHandler
- type Options
- type Profiler
- type Source
- type SourceFile
- type SourceReader
- type UIView
- func (u *UIView) Clear()
- func (u *UIView) Flush()
- func (u *UIView) GetDataLineCount() (ret int)
- func (u *UIView) GetHighlightLine() (string, int)
- func (u *UIView) MoveHighlightAndView(ydiff int)
- func (u *UIView) Read(p []byte) (n int, err error)
- func (u *UIView) SetInputLine(line string, cursorx int)
- func (u *UIView) SetStatusLine(line string)
- func (u *UIView) ViewSize() (x int, y int)
- func (u *UIView) Write(p []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
var E = ErrorHandler{ Out: os.Stderr, PrintStackTrace: true, }
The default error handler
var UiAbortedErr = E.New("User interface was aborted")
UiAbortedErr tells if user wanted to abort
var UiSelectedErr = E.New("User selected a line")
UiSelectedErr tells that user selected a line
Functions ¶
func AsRelaxedRegexp ¶
AsRelaxedRegexp converts spaces in a string to .*
func CheckSelfRunning ¶
func DefaultConfigFile ¶
DefaultConfigFile gets the default configuration file name based on given Options
Types ¶
type AsyncSource ¶
type Buffer ¶
type Buffer struct { // Callback that provides data out Passthrough io.Writer // contains filtered or unexported fields }
func (*Buffer) GetRealLine ¶
GetRealLine gets the original buffer line for the given line in the filtered output
type ErrorHandler ¶
func (*ErrorHandler) Annotate ¶
func (e *ErrorHandler) Annotate(err error, a ...interface{}) error
Annotate increases context information to the error
func (*ErrorHandler) New ¶
func (e *ErrorHandler) New(format string, a ...interface{}) error
New creates a new error variable
func (*ErrorHandler) Panic ¶
func (e *ErrorHandler) Panic(err error, a ...interface{})
func (*ErrorHandler) Print ¶
func (e *ErrorHandler) Print(err error, a ...interface{})
Print writes the error message to predefined io.Writer
type Options ¶
type Options interface { Set(key string, value string) Get(key string, fallback string) string IsSet(key string) bool }
Options is an interface to get and set string-like options for components
type Profiler ¶
type Profiler struct {
// contains filtered or unexported fields
}
type SourceFile ¶
type SourceFile struct { FileName string SourceReader }
func (*SourceFile) Run ¶
func (f *SourceFile) Run(args ...string) (err error)
func (*SourceFile) Wait ¶
func (f *SourceFile) Wait()
type SourceReader ¶
func (*SourceReader) Finish ¶
func (r *SourceReader) Finish() (err error)
func (*SourceReader) IsOneShot ¶
func (r *SourceReader) IsOneShot() bool
func (*SourceReader) Run ¶
func (r *SourceReader) Run(...string) error
func (*SourceReader) Wait ¶
func (r *SourceReader) Wait()
type UIView ¶
type UIView struct {
// contains filtered or unexported fields
}
UIView is the graphical representation of the data. It is used to draw the data to the screen.
func (*UIView) GetDataLineCount ¶
GetDataLineCount returns the number of lines in the view
func (*UIView) GetHighlightLine ¶
GetHighlightLine returns the string and the line from the view buffer that is currently highlighted
func (*UIView) MoveHighlightAndView ¶
MoveHighlightAndView moves the highlight primarily. Can shift the view if at limits.
func (*UIView) SetInputLine ¶
SetInputLine sets the input line to given and moves the cursor to absolute x
func (*UIView) SetStatusLine ¶
SetStatusLine sets the status line to a given string