input

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInterrupt = errors.New("interrupt")

Functions

func InitReadlineHistory

func InitReadlineHistory(rl *readline.Instance, history []string)

InitReadlineHistory 初始化 readline 实例的历史记录 Note: ergochat/readline uses SaveToHistory instead of SaveHistory

func NewLineEditor added in v0.3.2

func NewLineEditor(prompt string, tabHandler func() string) (*lineEditor, error)

func NewReadline

func NewReadline(prompt string) (*readline.Instance, error)

NewReadline 创建持久化的 readline 实例 用于需要多次读取输入并保持历史记录的场景

func ReadLine

func ReadLine(prompt string) (string, error)

ReadLine 读取一行输入(支持中文)

func ReadLineWithHistory

func ReadLineWithHistory(prompt string, history []string) (string, error)

ReadLineWithHistory 读取一行输入(支持历史记录) 注意:每次调用创建新的 readline 实例,适用于一次性读取

Types

This section is empty.

Jump to

Keyboard shortcuts

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