pcsliner

package
v0.0.0-...-4408961 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package pcsliner 命令行 readline 工具包

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearScreen

func ClearScreen()

ClearScreen 清空屏幕

Types

type LineHistory

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

LineHistory 命令行历史

func NewLineHistory

func NewLineHistory(filePath string) (lh *LineHistory, err error)

NewLineHistory 设置历史

type PCSLiner

type PCSLiner struct {
	State   *liner.State
	History *LineHistory
	// contains filtered or unexported fields
}

PCSLiner 封装 *liner.State, 提供更简便的操作

func NewLiner

func NewLiner() *PCSLiner

NewLiner 返回 *PCSLiner, 默认设置允许 Ctrl+C 结束

func (*PCSLiner) ClearScreen

func (pl *PCSLiner) ClearScreen()

ClearScreen 清空屏幕

func (*PCSLiner) Close

func (pl *PCSLiner) Close() (err error)

Close 关闭服务

func (*PCSLiner) DoWriteHistory

func (pl *PCSLiner) DoWriteHistory() (err error)

DoWriteHistory 执行写入历史

func (*PCSLiner) Pause

func (pl *PCSLiner) Pause() error

Pause 暂停服务

func (*PCSLiner) ReadHistory

func (pl *PCSLiner) ReadHistory() (err error)

ReadHistory 读取历史

func (*PCSLiner) Resume

func (pl *PCSLiner) Resume() error

Resume 恢复服务

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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