shell

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package shell is sqly-shell. shell control user input (it's SQL query or helper command) and request the usecase layer to process it.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is sqly command version. Version value is assigned by LDFLAGS.
	Version string
	// Stdout is new instance of Writer which handles escape sequence for stdout.
	Stdout = colorable.NewColorableStdout()
	// Stderr is new instance of Writer which handles escape sequence for stderr.
	Stderr = colorable.NewColorableStderr()
)
View Source
var (
	// ErrExitSqly is not error. developer must not print this error.
	ErrExitSqly = errors.New("this is not error. however, user want to exit sqly command")
)

Functions

This section is empty.

Types

type CommandList added in v0.0.2

type CommandList map[string]command

CommandList is sqly helper command list. key is command name, value is command function pointer and command description.

func NewCommands added in v0.0.2

func NewCommands() CommandList

NewCommands return *CommandList that set sqly helper commands.

type Shell

type Shell struct {
	Ctx context.Context
	// contains filtered or unexported fields
}

Shell is main class of the sqly command. Shell is the interface to the user and requests processing from the usecase layer.

func NewShell

NewShell return *Shell.

func (*Shell) Run

func (s *Shell) Run() error

Run start sqly shell. After successful initialization, start the interactive shell.

Jump to

Keyboard shortcuts

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