Documentation
¶
Overview ¶
Package rline provides a readline implementation for usql.
Index ¶
- Variables
- type IO
- type Rline
- func (l *Rline) Close() error
- func (l *Rline) Completer(a readline.AutoCompleter)
- func (l *Rline) Cygwin() bool
- func (l *Rline) Interactive() bool
- func (l *Rline) Next() ([]rune, error)
- func (l *Rline) Password(prompt string) (string, error)
- func (l *Rline) Prompt(s string)
- func (l *Rline) Save(s string) error
- func (l *Rline) SetOutput(f func(string) string)
- func (l *Rline) Stderr() io.Writer
- func (l *Rline) Stdout() io.Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInterrupt is the interrupt error. ErrInterrupt = readline.ErrInterrupt // ErrPasswordNotAvailable is the password not available error. ErrPasswordNotAvailable = errors.New("password not available") )
Functions ¶
This section is empty.
Types ¶
type IO ¶
type IO interface {
// Next returns the next line of runes (excluding '\n') from the input.
Next() ([]rune, error)
// Close closes the IO.
Close() error
// Stdout is the IO's standard out.
Stdout() io.Writer
// Stderr is the IO's standard error out.
Stderr() io.Writer
// Interactive determines if the IO is an interactive terminal.
Interactive() bool
// Cygwin determines if the IO is a Cygwin interactive terminal.
Cygwin() bool
// Prompt sets the prompt for the next interactive line read.
Prompt(string)
// Completer sets the auto-completer.
Completer(readline.AutoCompleter)
// Save saves a line of history.
Save(string) error
// Password prompts for a password.
Password(string) (string, error)
// SetOutput sets the output filter func.
SetOutput(func(string) string)
}
IO is the common input/output interface.
type Rline ¶
type Rline struct {
Inst *readline.Instance
N func() ([]rune, error)
C func() error
Out io.Writer
Err io.Writer
Int bool
Cyg bool
P func(string)
A func(readline.AutoCompleter)
S func(string) error
Pw func(string) (string, error)
}
Rline provides a type compatible with the IO interface.
func (*Rline) Completer ¶ added in v0.14.13
func (l *Rline) Completer(a readline.AutoCompleter)
Completer sets the auto-completer.
func (*Rline) Interactive ¶
Interactive determines if the IO is an interactive terminal.
Click to show internal directories.
Click to hide internal directories.