tools

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ToolDirMap = map[string]*ToolDir{
	"/": {
		Tools:    make(map[string]*Tool),
		Children: make(map[string]*ToolDir),
	},
}

Functions

func ConfigTool

func ConfigTool(name string, tool *Tool, immediatelyConfigToolDir bool)

func ConfigToolDir

func ConfigToolDir(tooldir *ToolDir)

func ConfigToolDirs

func ConfigToolDirs(tooldirs map[string]*ToolDir)

func ConfigTools

func ConfigTools(tools Tools)

func GetToolPath

func GetToolPath(customPath string) string

func LoadTools

func LoadTools(toolPath string, quiet bool) error

func NewTool

func NewTool(toolPath, descriptions string, ArgsExpression string, builtinFunc BuiltinFunc, args ...Arg)

Types

type Arg

type Arg struct {
	Name         string `yaml:"name"`
	Type         string `yaml:"type"`
	Descriptions string `yaml:"descriptions"`
	CommandArgs  string `yaml:"cmd_arg"`
	Value        string
}

func NewArguments

func NewArguments(name, argType, descriptions string) *Arg

type ArgumentsFunc

type ArgumentsFunc func(*Tool)

type BuiltinFunc

type BuiltinFunc = func(map[string]string)

type Conf

type Conf struct {
	Tools Tools `yaml:"tools"`
}

type Tool

type Tool struct {
	Descriptions         string `yaml:"descriptions"`
	DownloadURL          string `yaml:"download_url"`
	Args                 []Arg  `yaml:"args"`
	Command              string `yaml:"command"`
	ResultFilterFunction string `yaml:"result_filter_function"`
	ArgsExpression       string `yaml:"args_expression"`
	BuiltinFunc          BuiltinFunc
	ArgSuggests          []prompt.Suggest
}

type ToolBuilder

type ToolBuilder struct{}

type ToolDir

type ToolDir struct {
	Tools        Tools
	Children     map[string]*ToolDir
	PathSuggests []prompt.Suggest
	ToolSuggests []prompt.Suggest
}

type Tools

type Tools = map[string]*Tool

Jump to

Keyboard shortcuts

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