atsf4g_go_robot_util

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllHelpString

func AllHelpString(node *CommandNode) string

func AllHelpStringInner

func AllHelpStringInner(node *CommandNode) (ret [][]string)

func ExecuteCommand

func ExecuteCommand(mgr *base.TaskActionManager, rl *readline.Instance, input string)

ExecuteCommand 执行命令

func GetCurrentReadlineInstance

func GetCurrentReadlineInstance() *readline.Instance

func HistoryCmd

func HistoryCmd(base.TaskActionImpl, []string) string

func NewCompleter

func NewCompleter() *readline.PrefixCompleter

构建自动补全器

func QuitCmd

func QuitCmd(base.TaskActionImpl, []string) string

func ReadLine

func ReadLine()

func RegisterCommand

func RegisterCommand(path []string, fn CommandFunc, argsInfo string, desc string,
	dynamicComplete readline.DynamicCompleteFunc, timeout time.Duration)

func RegisterCommandDefaultTimeout

func RegisterCommandDefaultTimeout(path []string, fn CommandFunc, argsInfo string, desc string,
	dynamicComplete readline.DynamicCompleteFunc)

func StdoutLog

func StdoutLog(log string)

Types

type CommandFunc

type CommandFunc func(base.TaskActionImpl, []string) string

type CommandNode

type CommandNode struct {
	Children        map[string]*CommandNode
	Name            string
	FullName        string
	Func            CommandFunc
	ArgsInfo        string
	Desc            string
	DynamicComplete readline.DynamicCompleteFunc
	Timeout         time.Duration
}

func FindCommand

func FindCommand(path string) (args []string, node *CommandNode)

FindCommand 根据路径查找命令节点

func MutableCommandRoot

func MutableCommandRoot() *CommandNode

func (*CommandNode) SelfHelpString

func (node *CommandNode) SelfHelpString() []string

type HistoryManager

type HistoryManager struct {
	File  string
	Items []string
	Set   map[string]struct{}
	// contains filtered or unexported fields
}

func NewHistoryManager

func NewHistoryManager(file string, cleanDuplicates bool) *HistoryManager

type TaskActionCmd

type TaskActionCmd struct {
	base.TaskActionBase
	Fn func()
}

func (*TaskActionCmd) HookRun

func (t *TaskActionCmd) HookRun() error

func (*TaskActionCmd) Log

func (t *TaskActionCmd) Log(format string, a ...any)

Jump to

Keyboard shortcuts

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