command

package
v0.0.0-...-8c46fe0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(command *Command)

Add adds command to the command list

func CommandsFromJSON

func CommandsFromJSON(path string) error

CommandsFromJSON loads commands from the json file in path and adds them to the command list

Types

type Command

type Command struct {
	Name       string
	Executable string
	Arguments  []string
	Timeout    time.Duration
}

Command is an executable command

func Get

func Get(name string) *Command

Get returns the command identified by name

func List

func List() []*Command

List returns all commands in the command list

func (*Command) Run

func (c *Command) Run() error

Run executes the command

Jump to

Keyboard shortcuts

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