singlecommand

package
v0.0.0-...-f6ab670 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 2

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

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.

Jump to

Keyboard shortcuts

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