Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- type Console
- type JSVM
- func (v *JSVM) Compile(filename string, src interface{}) error
- func (v *JSVM) CompleteKeywords(line string) []string
- func (v *JSVM) Get(name string) (otto.Value, error)
- func (v *JSVM) JSONString(val otto.Value) (string, error)
- func (v *JSVM) Run(src string) (otto.Value, error)
- func (v *JSVM) Set(name string, value interface{}) error
- type Neblet
- type TerminalPrompter
- func (p *TerminalPrompter) AppendHistory(command string)
- func (p *TerminalPrompter) Prompt(prompt string) (string, error)
- func (p *TerminalPrompter) PromptConfirm(prompt string) (bool, error)
- func (p *TerminalPrompter) PromptPassphrase(prompt string) (passwd string, err error)
- func (p *TerminalPrompter) SetHistory(history []string)
- func (p *TerminalPrompter) SetWordCompleter(completer liner.WordCompleter)
- type UserPrompter
Constants ¶
const (
//APIVersion rpc http version
APIVersion = "v1"
)
Variables ¶
var Stdin = NewTerminalPrompter()
Stdin holds the stdin line reader (also using stdout for printing prompts).
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v1.0.0
type Config struct { Prompter UserPrompter PrompterCh chan string Writer io.Writer Neb Neblet }
Config neb console config
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
Console console handler
func (*Console) AutoComplete ¶
AutoComplete console auto complete input
func (*Console) Interactive ¶
func (c *Console) Interactive()
Interactive starts an interactive user session.
type JSVM ¶ added in v1.0.0
type JSVM struct {
// contains filtered or unexported fields
}
JSVM javascript runtime environment
func (*JSVM) CompleteKeywords ¶ added in v1.0.0
CompleteKeywords returns potential continuations for the given line.
func (*JSVM) JSONString ¶ added in v1.0.0
JSONString convert value to json string
type Neblet ¶
type Neblet interface {
Config() *nebletpb.Config
}
Neblet interface breaks cycle import dependency and hides unused services.
type TerminalPrompter ¶ added in v1.0.0
type TerminalPrompter struct {
// contains filtered or unexported fields
}
TerminalPrompter terminal prompter
func NewTerminalPrompter ¶ added in v1.0.0
func NewTerminalPrompter() *TerminalPrompter
NewTerminalPrompter create a terminal prompter
func (*TerminalPrompter) AppendHistory ¶ added in v1.0.0
func (p *TerminalPrompter) AppendHistory(command string)
AppendHistory appends an entry to the scrollback history.
func (*TerminalPrompter) Prompt ¶ added in v1.0.0
func (p *TerminalPrompter) Prompt(prompt string) (string, error)
Prompt shows the prompt and requests text input returning the input.
func (*TerminalPrompter) PromptConfirm ¶ added in v1.0.0
func (p *TerminalPrompter) PromptConfirm(prompt string) (bool, error)
PromptConfirm shows the prompt to the user and requests a boolean choice to be made, returning that choice.
func (*TerminalPrompter) PromptPassphrase ¶ added in v1.0.0
func (p *TerminalPrompter) PromptPassphrase(prompt string) (passwd string, err error)
PromptPassphrase shows the prompt and request passphrase text input, the passphrase not show, returns the passphrase
func (*TerminalPrompter) SetHistory ¶ added in v1.0.0
func (p *TerminalPrompter) SetHistory(history []string)
SetHistory sets the history that the prompter will allow the user to scroll back to.
func (*TerminalPrompter) SetWordCompleter ¶ added in v1.0.0
func (p *TerminalPrompter) SetWordCompleter(completer liner.WordCompleter)
SetWordCompleter sets the completion function that the prompter will call to fetch completion candidates when the user presses tab.
type UserPrompter ¶ added in v1.0.0
type UserPrompter interface { Prompt(prompt string) (string, error) PromptPassphrase(prompt string) (passwd string, err error) PromptConfirm(prompt string) (bool, error) SetHistory(history []string) AppendHistory(command string) SetWordCompleter(completer liner.WordCompleter) }
UserPrompter handle console user input interactive