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 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 ¶
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