Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface {
// Completer returns the data that is displayed in the CLI for tab completion depending on the menu the command is for
// Errors are not returned to ensure the CLI is not interrupted.
// Errors are logged and can be viewed by enabling debug output in the CLI
Completer(m menu.Menu, id uuid.UUID) readline.PrefixCompleterInterface
// Do executes the command and returns a Response to the caller to facilitate changes in the CLI service
// m, an optional parameter, is the Menu the command was executed from
// id, an optional parameter, used to identify a specific Agent, Listener, or Module
// arguments, and optional, parameter, is the full unparsed string entered on the command line to include the
// command itself passed into command for processing
// Errors are returned through the Error and Message fields of the embedded messages.UserMessage struct in the Response struct
Do(m menu.Menu, id uuid.UUID, arguments string) (response Response)
// Help returns a help.Help structure that can be used to view a command's Description, Notes, Usage, and an example
Help(m menu.Menu) help.Help
// Menu checks to see if the command is supported for the provided menu
Menu(menu.Menu) bool
// OS returns the supported operating system the command can be executed on
OS() os.OS
// String returns the unique name of the command as a string
String() string
}
type Repository ¶
type Repository interface {
Add(cmd Command)
Get(menu menu.Menu, cmd string) (Command, error)
GetAll() (commands []Command)
}
Repository is an interface used to add or get, or update CLI commands from a repository
type Response ¶
type Response struct {
Agent uuid.UUID
AgentOS os.OS
Completer *readline.PrefixCompleterInterface
Listener uuid.UUID
Menu menu.Menu
Message *message.UserMessage // Message is used to display a message on the CLI; A pointer is used to allow for nil values for evaluation
Module uuid.UUID
Prompt string
}
Response is used to return multiple values from Command receivers
Directories
¶
| Path | Synopsis |
|---|---|
|
Package agent contains commands that are only available in the CLI agents menu
|
Package agent contains commands that are only available in the CLI agents menu |
|
all
Package all contains commands that are only available in the CLI agents menu for all agent operating system types
|
Package all contains commands that are only available in the CLI agents menu for all agent operating system types |
|
linux
Package linux contains commands that are only available in the CLI agents menu and only for Linux agents
|
Package linux contains commands that are only available in the CLI agents menu and only for Linux agents |
|
windows
Package windows contains commands that are only available in the CLI agents menu and only for Windows agents
|
Package windows contains commands that are only available in the CLI agents menu and only for Windows agents |
|
Package all contains commands that are available in all CLI menus
|
Package all contains commands that are available in all CLI menus |
|
Package listeners contains commands that are only available in the CLI listeners menu and submenus
|
Package listeners contains commands that are only available in the CLI listeners menu and submenus |
|
Package mainMenu contains commands that are only available in the CLI's main menu.
|
Package mainMenu contains commands that are only available in the CLI's main menu. |
|
Package module contains commands that are only available in the CLI modules menu NOTE: some commands used in the module menu are also used in other menus and can be found in the pkg/cli/commands/multi directory
|
Package module contains commands that are only available in the CLI modules menu NOTE: some commands used in the module menu are also used in other menus and can be found in the pkg/cli/commands/multi directory |
|
Package multi contains commands that are available in multiple CLI menus, but not all menus.
|
Package multi contains commands that are available in multiple CLI menus, but not all menus. |
|
Package repository implements an in-memory database that holds a map of Command structures used with the Merlin CLI
|
Package repository implements an in-memory database that holds a map of Command structures used with the Merlin CLI |
Click to show internal directories.
Click to hide internal directories.