Documentation ¶
Overview ¶
Package singlecommand implements session shell plugin with interactive or non-interactive single command.
Package singlecommand implements session shell plugin with interactive or non-interactive single command.
Index ¶
- func NewPlugin(context context.T, name string) (sessionplugin.ISessionPlugin, error)
- type SingleCommand
- func (p *SingleCommand) Execute(config agentContracts.Configuration, cancelFlag task.CancelFlag, ...)
- func (p *SingleCommand) GetPluginParameters(parameters interface{}) interface{}
- func (p *SingleCommand) InputStreamMessageHandler(log log.T, streamDataMessage mgsContracts.AgentMessage) error
- func (p *SingleCommand) RequireHandshake() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPlugin ¶
func NewPlugin(context context.T, name string) (sessionplugin.ISessionPlugin, error)
NewPlugin returns a new instance of the InteractiveCommands or NonInteractiveCommands plugin.
Types ¶
type SingleCommand ¶
type SingleCommand struct {
// contains filtered or unexported fields
}
SingleCommand is the generic plugin structure for InteractiveCommands and NonInteractiveCommands plugins.
func (*SingleCommand) Execute ¶
func (p *SingleCommand) Execute(config agentContracts.Configuration, cancelFlag task.CancelFlag, output iohandler.IOHandler, dataChannel datachannel.IDataChannel)
Execute executes a command as passed in from document parameter, and writes command output to data channel. This function is shared between InteractiveCommands and NonInteractiveCommands plugins.
func (*SingleCommand) GetPluginParameters ¶
func (p *SingleCommand) GetPluginParameters(parameters interface{}) interface{}
Returns parameters required for CLI/console to start session
func (*SingleCommand) InputStreamMessageHandler ¶
func (p *SingleCommand) InputStreamMessageHandler(log log.T, streamDataMessage mgsContracts.AgentMessage) error
InputStreamMessageHandler passes payload byte stream to command execution process.
func (*SingleCommand) RequireHandshake ¶
func (p *SingleCommand) RequireHandshake() bool
SingleCommand by default does not require handshake to establish session TODO: change to default to require handshake once InteractiveCommands plugin enforces handshake.