Documentation
¶
Overview ¶
Package session starts the session.
Index ¶
- type ISession
- type ISessionPlugin
- type ISessionSubTypeSupport
- type ISessionSupport
- type ISessionTypeSupport
- type Session
- func (s *Session) Close() error
- func (s *Session) DisplayMessage(message message.ClientMessage)
- func (s *Session) GetAgentVersion() string
- func (s *Session) GetSessionID() string
- func (s *Session) GetSessionProperties() any
- func (s *Session) GetTargetID() string
- func (s *Session) OpenDataChannel(ctx context.Context) (string, error)
- func (s *Session) RegisterIncomingMessageHandler(handler datachannel.IncomingMessageHandler)
- func (s *Session) RegisterOutputStreamHandler(handler datachannel.OutputStreamDataMessageHandler, sessionSpecific bool)
- func (s *Session) RegisterStopHandler(handler datachannel.StopHandler)
- func (s *Session) SendFlag(flagType message.PayloadTypeFlag) error
- func (s *Session) SendInputDataMessage(payloadType message.PayloadType, inputData []byte) error
- func (s *Session) TerminateSession(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ISession ¶
type ISession interface {
ISessionSubTypeSupport
ISessionTypeSupport
OpenDataChannel(ctx context.Context) (string, error)
}
ISession defines the interface for session operations.
type ISessionPlugin ¶
type ISessionPlugin interface {
SetSessionHandlers(ctx context.Context) error
ProcessStreamMessagePayload(streamDataMessage message.ClientMessage) (isHandlerReady bool, err error)
Stop() error
Name() string
}
ISessionPlugin defines the interface for session type implementations.
type ISessionSubTypeSupport ¶
type ISessionSubTypeSupport interface {
SendFlag(flagType message.PayloadTypeFlag) error
SendInputDataMessage(payloadType message.PayloadType, inputData []byte) error
GetAgentVersion() string
TerminateSession(ctx context.Context) error
GetTargetID() string
GetSessionID() string
}
ISessionSubTypeSupport defines the interface for session plugin support operations.
type ISessionSupport ¶
type ISessionSupport interface {
ISessionTypeSupport
ISessionSubTypeSupport
}
ISessionSupport defines the interface for session support. It combines the functionalities of ISessionTypeSupport and ISessionSubTypeSupport.
type ISessionTypeSupport ¶
type ISessionTypeSupport interface {
GetAgentVersion() string
GetSessionID() string
GetSessionProperties() any
RegisterOutputStreamHandler(handler datachannel.OutputStreamDataMessageHandler, isSessionSpecificHandler bool)
RegisterIncomingMessageHandler(handler datachannel.IncomingMessageHandler)
RegisterStopHandler(handler datachannel.StopHandler)
DisplayMessage(message message.ClientMessage)
SendInputDataMessage(payloadType message.PayloadType, inputData []byte) error
Close() error
}
ISessionTypeSupport is an interface that defines the methods for session type support.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents an active session with its configuration and state.
func NewSession ¶
func NewSession(ssmClient *ssm.Client, dataChannel datachannel.IDataChannel, sessionID string, logger log.T) (*Session, error)
NewSession creates a new session instance with the provided parameters.
func (*Session) DisplayMessage ¶
func (s *Session) DisplayMessage(message message.ClientMessage)
DisplayMessage displays a message to the user.
func (*Session) GetAgentVersion ¶
GetAgentVersion retrieves the agent version from the data channel.
func (*Session) GetSessionID ¶
GetSessionID retrieves the session ID from the session.
func (*Session) GetSessionProperties ¶
GetSessionProperties retrieves the session properties from the session.
func (*Session) GetTargetID ¶
GetTargetID retrieves the target ID from the session.
func (*Session) OpenDataChannel ¶
OpenDataChannel initializes datachannel.
func (*Session) RegisterIncomingMessageHandler ¶ added in v0.2.0
func (s *Session) RegisterIncomingMessageHandler(handler datachannel.IncomingMessageHandler)
RegisterIncomingMessageHandler sets the message handler for the DataChannel.
func (*Session) RegisterOutputStreamHandler ¶
func (s *Session) RegisterOutputStreamHandler(handler datachannel.OutputStreamDataMessageHandler, sessionSpecific bool)
RegisterOutputStreamHandler registers a handler for output stream messages.
func (*Session) RegisterStopHandler ¶ added in v0.2.0
func (s *Session) RegisterStopHandler(handler datachannel.StopHandler)
RegisterStopHandler sets the message handler for the DataChannel.
func (*Session) SendFlag ¶
func (s *Session) SendFlag(flagType message.PayloadTypeFlag) error
SendFlag sends a flag message through the data channel.
func (*Session) SendInputDataMessage ¶
func (s *Session) SendInputDataMessage(payloadType message.PayloadType, inputData []byte) error
SendInputDataMessage sends input data messages through the data channel.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package portsession starts port session.
|
Package portsession starts port session. |
|
Package sessionutil contains utility methods required to start session.
|
Package sessionutil contains utility methods required to start session. |
|
Package shellsession starts shell session.
|
Package shellsession starts shell session. |