terminal

package
v1.18.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPrompt           string = "csvq > "
	DefaultContinuousPrompt string = "     > "
)

Variables

This section is empty.

Functions

func GetStdinForREPL

func GetStdinForREPL() io.ReadCloser

func HistoryFilePath

func HistoryFilePath(filename string) (string, error)

func NewPromptEvaluationError

func NewPromptEvaluationError(message string) error

func NewTerminal

func NewTerminal(ctx context.Context, scope *query.ReferenceScope) (query.VirtualTerminal, error)

Types

type Completer

type Completer struct {
	// contains filtered or unexported fields
}

func NewCompleter

func NewCompleter(scope *query.ReferenceScope) *Completer

func (*Completer) AddFlagArgs

func (c *Completer) AddFlagArgs(line string, origLine string, index int) readline.CandidateList

func (*Completer) AllColumnList

func (c *Completer) AllColumnList() []string

func (*Completer) AlterArgs

func (c *Completer) AlterArgs(line string, origLine string, index int) readline.CandidateList

func (*Completer) BracketIsEnclosed

func (c *Completer) BracketIsEnclosed() bool

func (*Completer) CaseExpression

func (c *Completer) CaseExpression(line string, origLine string, index int) readline.CandidateList

func (*Completer) ColumnList

func (c *Completer) ColumnList(tableName string, repository string) []string

func (*Completer) CreateArgs

func (c *Completer) CreateArgs(line string, origLine string, index int) readline.CandidateList

func (*Completer) CursorStatus

func (c *Completer) CursorStatus(line string, origLine string, index int) readline.CandidateList

func (*Completer) DeclareArgs

func (c *Completer) DeclareArgs(line string, origLine string, index int) readline.CandidateList

func (*Completer) DeleteArgs

func (c *Completer) DeleteArgs(line string, origLine string, index int) readline.CandidateList

func (*Completer) DisposeArgs

func (c *Completer) DisposeArgs(line string, origLine string, index int) readline.CandidateList

func (*Completer) Do

func (c *Completer) Do(line []rune, pos int, index int) (readline.CandidateList, int)

func (*Completer) EncloseQuotation

func (c *Completer) EncloseQuotation(line string, origLine string, _ int) readline.CandidateList

func (*Completer) FetchArgs

func (c *Completer) FetchArgs(line string, origLine string, index int) readline.CandidateList

func (*Completer) FunctionArgs

func (c *Completer) FunctionArgs(line string, origLine string, index int) readline.CandidateList

func (*Completer) GetStatementPrefix

func (c *Completer) GetStatementPrefix(line string, origLine string, index int) readline.CandidateList

func (*Completer) InsertArgs

func (c *Completer) InsertArgs(line string, origLine string, index int) readline.CandidateList

func (*Completer) ListFiles

func (c *Completer) ListFiles(path string, includeExt []string, repository string) []string

func (*Completer) PrepareArgs

func (c *Completer) PrepareArgs(line string, origLine string, index int) readline.CandidateList

func (*Completer) RemoveFlagArgs

func (c *Completer) RemoveFlagArgs(line string, origLine string, index int) readline.CandidateList

func (*Completer) ReplaceArgs

func (c *Completer) ReplaceArgs(line string, origLine string, index int) readline.CandidateList

func (*Completer) SearchAllTables

func (c *Completer) SearchAllTables(line string, _ string, _ int) readline.CandidateList

func (*Completer) SearchAllTablesWithSpace

func (c *Completer) SearchAllTablesWithSpace(line string, origLine string, index int) readline.CandidateList

func (*Completer) SearchDirs

func (c *Completer) SearchDirs(line string, origLine string, index int) readline.CandidateList

func (*Completer) SearchExecutableFiles

func (c *Completer) SearchExecutableFiles(line string, origLine string, index int) readline.CandidateList

func (*Completer) SearchValues

func (c *Completer) SearchValues(line string, origLine string, index int) readline.CandidateList

func (*Completer) SearchValuesWithSpace

func (c *Completer) SearchValuesWithSpace(line string, origLine string, index int) readline.CandidateList

func (*Completer) SelectArgs

func (c *Completer) SelectArgs(line string, origLine string, index int) readline.CandidateList

func (*Completer) SetArgs

func (c *Completer) SetArgs(line string, origLine string, index int) readline.CandidateList

func (*Completer) SetLastIndex

func (c *Completer) SetLastIndex(line string)

func (*Completer) ShowArgs

func (c *Completer) ShowArgs(line string, origLine string, index int) readline.CandidateList

func (*Completer) Statements

func (c *Completer) Statements(line string, origLine string, index int) readline.CandidateList

func (*Completer) TableObjectArgs

func (c *Completer) TableObjectArgs(line string, origLine string, index int) readline.CandidateList

func (*Completer) Update

func (c *Completer) Update()

func (*Completer) UpdateArgs

func (c *Completer) UpdateArgs(line string, origLine string, index int) readline.CandidateList

func (*Completer) UpdateTokens

func (c *Completer) UpdateTokens(line string, origLine string)

func (*Completer) UsingArgs

func (c *Completer) UsingArgs(line string, origLine string, index int) readline.CandidateList

func (*Completer) WithArgs

func (c *Completer) WithArgs(line string, origLine string, index int) readline.CandidateList

type Prompt

type Prompt struct {
	// contains filtered or unexported fields
}

func NewPrompt

func NewPrompt(scope *query.ReferenceScope) *Prompt

func (*Prompt) LoadConfig

func (p *Prompt) LoadConfig() error

func (*Prompt) Render

func (p *Prompt) Render(ctx context.Context, sequence []PromptElement) (string, error)

func (*Prompt) RenderContinuousPrompt

func (p *Prompt) RenderContinuousPrompt(ctx context.Context) (string, error)

func (*Prompt) RenderPrompt

func (p *Prompt) RenderPrompt(ctx context.Context) (string, error)

func (*Prompt) StripEscapeSequence

func (p *Prompt) StripEscapeSequence(s string) string

type PromptElement

type PromptElement struct {
	Text string
	Type excmd.ElementType
}

type PromptEvaluationError

type PromptEvaluationError struct {
	Message string
}

func (PromptEvaluationError) Error

func (e PromptEvaluationError) Error() string

type ReadLineTerminal

type ReadLineTerminal struct {
	// contains filtered or unexported fields
}

func (ReadLineTerminal) GetSize

func (t ReadLineTerminal) GetSize() (int, int, error)

func (ReadLineTerminal) ReadLine

func (t ReadLineTerminal) ReadLine() (string, error)

func (ReadLineTerminal) ReloadConfig

func (t ReadLineTerminal) ReloadConfig() error

func (ReadLineTerminal) SaveHistory

func (t ReadLineTerminal) SaveHistory(s string) error

func (ReadLineTerminal) SetContinuousPrompt

func (t ReadLineTerminal) SetContinuousPrompt(ctx context.Context)

func (ReadLineTerminal) SetPrompt

func (t ReadLineTerminal) SetPrompt(ctx context.Context)

func (ReadLineTerminal) Teardown

func (t ReadLineTerminal) Teardown() error

func (ReadLineTerminal) UpdateCompleter

func (t ReadLineTerminal) UpdateCompleter()

func (ReadLineTerminal) Write

func (t ReadLineTerminal) Write(s string) error

func (ReadLineTerminal) WriteError

func (t ReadLineTerminal) WriteError(s string) error

type ReadlineListener

type ReadlineListener struct {
	// contains filtered or unexported fields
}

func (ReadlineListener) OnChange

func (l ReadlineListener) OnChange(line []rune, pos int, key rune) ([]rune, int, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL