ui

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2017 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdClear = Command{"clear", shortCmdClear, "Clear the current input statement."}

CmdClear explains that this command clears the current statement.

View Source
var CmdExit = Command{"exit", shortCmdExit, "Exit awql. Same as quit."}

CmdExit explains that this command as the same result that the quit command.

View Source
var CmdHelp = Command{"help", shortCmdHelp, "Display this help."}

CmdHelp explains that this command gives help about the tool.

View Source
var CmdQuit = Command{"quit", shortCmdExit, "Quit awql command line tool."}

CmdQuit explains that this quits the prompt.

Commands list all available commands that the tool itself interprets.

Functions

This section is empty.

Types

type ASCIIWriter added in v1.1.0

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

ASCIIWriter represents a terminal tables's writer.

func (*ASCIIWriter) Error added in v1.1.0

func (w *ASCIIWriter) Error() error

Error returns any errors occurred during the job.

func (*ASCIIWriter) Flush added in v1.1.0

func (w *ASCIIWriter) Flush()

Flush writes any buffered data to the underlying writer.

func (*ASCIIWriter) Write added in v1.1.0

func (w *ASCIIWriter) Write(record []string) error

Write adds a line to the table.

func (*ASCIIWriter) WriteHead added in v1.1.0

func (w *ASCIIWriter) WriteHead(record []string) error

WriteHead writes the table header and defines column sizes.

type Command

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

Command represents a command.

func (Command) ShortForm

func (c Command) ShortForm() string

ShortForm returns the short-form command. Output: \c

func (Command) String

func (c Command) String() string

String returns a readable representation of the command. It implements fmt.String() interface. Output: clear (\c) Clear the current input statement.

type CommandLine

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

CommandLine represents a basic input.

func (*CommandLine) Scan

func (e *CommandLine) Scan() (err error)

Scan starts the engine with only the query query to execute from args.

func (*CommandLine) Seek

func (e *CommandLine) Seek(s string) error

Seek executes the given statement and write its records.

type CsvWriter

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

CsvWriter is a writer that build a CSV string.

func (*CsvWriter) Error

func (w *CsvWriter) Error() error

Error returns the error occurred during the writing.

func (*CsvWriter) Flush

func (w *CsvWriter) Flush()

Flush writes any buffered data to the underlying writer.

func (*CsvWriter) Write

func (w *CsvWriter) Write(record []string) error

Write writes the data as a CVS line.

func (*CsvWriter) WriteHead

func (w *CsvWriter) WriteHead(record []string) error

WriteHead writes the head of the CSV.

type PositionWriter

type PositionWriter interface {
	Positioner
	Writer
}

PositionWriter represents a writer using a positioner.

func NewStatsWriter

func NewStatsWriter(w io.Writer, exec bool) PositionWriter

NewStatsWriter returns a writer of stream's statistics.

type Positioner

type Positioner interface {
	Position() int
}

Positioner is an interface used by Position.

type ScanSeeker

type ScanSeeker interface {
	Scanner
	Seeker
}

ScanSeeker is an interface witch implements Scan and Seek.

func NewCommandLine

func NewCommandLine(conf conf.Settings) ScanSeeker

NewCommandLine returns a basic input.

func NewTerminal

func NewTerminal(conf conf.Settings) ScanSeeker

NewTerminal returns an instance of Terminal.

type Scanner

type Scanner interface {
	Scan() error
}

Scanner is an interface used by Scan.

type Seeker

type Seeker interface {
	Seek(s string) error
}

Seeker is an interface used by Seek.

type StatsWriter

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

StatsWriter represents a statistics's writer.

func (*StatsWriter) Error

func (w *StatsWriter) Error() error

Error returns nil. Just implements the writer of statistics.

func (*StatsWriter) Flush

func (w *StatsWriter) Flush()

Flush writes any buffered data to the underlying writer. It computes various information about the written data (duration, number, etc.).

func (*StatsWriter) Position

func (w *StatsWriter) Position() int

Position returns the current size of the result set.

func (*StatsWriter) Write

func (w *StatsWriter) Write(record []string) error

Write increments the number of written lines.

func (*StatsWriter) WriteHead

func (w *StatsWriter) WriteHead(record []string) error

WriteHead defines the start date of the writing job.

type Terminal

type Terminal struct {
	CommandLine
}

Terminal represents a terminal as stdin (shell).

func (*Terminal) Scan

func (e *Terminal) Scan() error

Scan starts the engine with a listening of the terminal as stdin.

type VASCIIWriter added in v1.1.0

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

VASCIIWriter represents a terminal writer whose prints one line per column value.

func (*VASCIIWriter) Error added in v1.1.0

func (w *VASCIIWriter) Error() error

Error returns any errors occurred during the job.

func (*VASCIIWriter) Flush added in v1.1.0

func (w *VASCIIWriter) Flush()

Flush writes any buffered data to the underlying writer.

func (*VASCIIWriter) Write added in v1.1.0

func (w *VASCIIWriter) Write(record []string) error

Write prints a new line for each column value.

func (*VASCIIWriter) WriteHead added in v1.1.0

func (w *VASCIIWriter) WriteHead(record []string) error

WriteHead defines the prefix of each line. Each prefix is a column name.

type Writer

type Writer interface {
	Error() error
	Flush()
	Write(record []string) error
	WriteHead(record []string) error
}

Writer represents a writer.

func NewASCIIWriter added in v1.1.0

func NewASCIIWriter(w io.Writer) Writer

NewASCIIWriter returns a writer of term tables.

func NewCsvWriter

func NewCsvWriter(w io.Writer) Writer

NewCsvWriter returns a CSV writer.

func NewVASCIIWriter added in v1.1.0

func NewVASCIIWriter(w io.Writer) Writer

NewVASCIIWriter returns a vertical writer.

Jump to

Keyboard shortcuts

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