dipperin_console

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvConfigDir configuration path
	EnvConfigDir = "CS_CI_EX_GO_CONFIG_DIR"
	// ConfigName configuration file name
	ConfigName = "cs_config.json"
	// app name
	AppName = "DipperinCIEx"
)
View Source
const (
	HistoryLimit = 1000
)

Variables

This section is empty.

Functions

func GetConfigDir

func GetConfigDir() string

GetConfigDir get the configuration path

Types

type Console

type Console struct {
	Prompt  *prompt.Prompt
	History *ConsoleHistory
	// contains filtered or unexported fields
}

func NewConsole

func NewConsole(executor prompt.Executor, completer prompt.Completer) *Console

NewConsole return *Console , completer Completer

func (*Console) WrapExecutor

func (c *Console) WrapExecutor(executor prompt.Executor) prompt.Executor

Wrap the executor function for add the input to history

type ConsoleHistory

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

func NewConsoleHistory

func NewConsoleHistory(filePath string) (ch *ConsoleHistory, err error)

NewLineHistory setting history

func (*ConsoleHistory) AddHistoryItem

func (ch *ConsoleHistory) AddHistoryItem(s string)

func (*ConsoleHistory) ClearHistory

func (ch *ConsoleHistory) ClearHistory() (err error)

func (*ConsoleHistory) DoWriteHistory

func (ch *ConsoleHistory) DoWriteHistory() (err error)

DoWriteHistory execute write history file

func (*ConsoleHistory) ReadHistory

func (ch *ConsoleHistory) ReadHistory() (err error)

ReadHistory reading from history file

Jump to

Keyboard shortcuts

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