pcsliner

package
v3.3.2-mips+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2018 License: Apache-2.0 Imports: 3 Imported by: 46

Documentation

Overview

Package pcsliner 命令行 readline 工具包

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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) 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 恢复服务

Jump to

Keyboard shortcuts

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