shell

package
v0.0.0-...-90fbc02 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Package shell is a common library that implements session manager shell.

Package shell implements session shell plugin.

Package shell is a common library that implements session manager shell.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetSize

func SetSize(log log.T, ws_col, ws_row uint32) (err error)

SetSize sets size of console terminal window.

func StartPty

func StartPty(
	log log.T,
	shellProps mgsContracts.ShellProperties,
	isSessionLogger bool,
	config agentContracts.Configuration,
	plugin *ShellPlugin) (err error)

StartPty starts pty and provides handles to stdin and stdout isSessionLogger determines whether its a customer shell or shell used for logging.

Types

type IShellPlugin

type IShellPlugin interface {
	Execute(config agentContracts.Configuration, cancelFlag task.CancelFlag, output iohandler.IOHandler, dataChannel datachannel.IDataChannel, shellProps mgsContracts.ShellProperties)
	InputStreamMessageHandler(log log.T, streamDataMessage mgsContracts.AgentMessage) error
	Ready() bool
}

type IShellPluginMock

type IShellPluginMock struct {
	mock.Mock
}

Mock stands for a mocked context.

func (*IShellPluginMock) Execute

func (_m *IShellPluginMock) Execute(config contracts.Configuration, cancelFlag task.CancelFlag, output iohandler.IOHandler, dataChannel datachannel.IDataChannel, shellProps sessioncontracts.ShellProperties)

Execute provides a mock function with given fields: _a0, config, cancelFlag, output, dataChannel

func (*IShellPluginMock) InputStreamMessageHandler

func (_m *IShellPluginMock) InputStreamMessageHandler(_a0 log.T, streamDataMessage sessioncontracts.AgentMessage) error

InputStreamMessageHandler provides a mock function with given fields: _a0, streamDataMessage

func (*IShellPluginMock) Ready

func (_m *IShellPluginMock) Ready() bool

Ready provides a mock function with given fields:

type ShellPlugin

type ShellPlugin struct {
	// contains filtered or unexported fields
}

Plugin is the type for the plugin.

func NewPlugin

func NewPlugin(context context.T, name string) (*ShellPlugin, error)

NewPlugin returns a new instance of the Shell Plugin

func (*ShellPlugin) Execute

func (p *ShellPlugin) Execute(
	config agentContracts.Configuration,
	cancelFlag task.CancelFlag,
	output iohandler.IOHandler,
	dataChannel datachannel.IDataChannel,
	shellProps mgsContracts.ShellProperties)

Execute starts pseudo terminal. It reads incoming message from data channel and writes to pty.stdin. It reads message from pty.stdout and writes to data channel

func (*ShellPlugin) InputStreamMessageHandler

func (p *ShellPlugin) InputStreamMessageHandler(log log.T, streamDataMessage mgsContracts.AgentMessage) error

InputStreamMessageHandler passes payload byte stream to shell stdin

func (*ShellPlugin) Ready

func (p *ShellPlugin) Ready() bool

Directories

Path Synopsis
Package execcmd wraps up the os.Process interface.
Package execcmd wraps up the os.Process interface.

Jump to

Keyboard shortcuts

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