command

package
v0.0.0-...-aa32a7f Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

Package command provides the common interface for all commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCommand

func RegisterCommand(cmd Command)

RegisterCommand registers a command for use by the implant.

This is typically done immediately after declaring the command to make it easy to create the list of available commands at compile time for the target OS.

Types

type Command

type Command interface {
	// Name is the name of the command, what will appear in the help
	// documentation, and what the operator will type to run the command.
	Name() string
	// Run performs the command's operation.
	Run(clientID string, jobID string, args []string) (string, error)
}

The Command interface provides a common interface for commands, simplifying the process of providing cross-platform and OS-specific commands.

func GetCommand

func GetCommand(name string) Command

GetCommand returns the command with the given name or nil if it hasn't been registered or otherwise doesn't exist.

Jump to

Keyboard shortcuts

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