Documentation ¶
Index ¶
- Variables
- type Config
- type MessageHandler
- type Session
- func (s *Session) Close() error
- func (s *Session) Read(b []byte) (n int, err error)
- func (s *Session) SetReadDeadline(t time.Time) error
- func (s *Session) SetWriteDeadline(t time.Time) error
- func (s *Session) Wait() error
- func (s *Session) Write(b []byte) (n int, err error)
- func (s *Session) WriteControl(msg message.Message) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // NetTimeout is the timeout for network operations, // eg. reading and writing to a socket. NetTimeout *time.Duration // AckTimeout is the timeout for waiting for an ack reply. AckTimeout *time.Duration // HeartbeatInterval is the interval between sending heartbeats. HeartbeatInterval *time.Duration // HeartbeatTimeout is the timeout for waiting for a heartbeat reply. HeartbeatTimeout *time.Duration // MessageHandlers is a map of message handlers for specific message types. MessageHandlers map[string]MessageHandler }
Config is the configuration for a session.
type MessageHandler ¶
MessageHandler is a function that handles messages.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents an shell session.
func NewSession ¶
func NewSession(ctx context.Context, logger *slog.Logger, ws *websocket.Conn, conf *Config) (*Session, error)
NewSession creates a new shell session.
func (*Session) SetReadDeadline ¶
SetReadDeadline sets the read deadline on the session.
func (*Session) SetWriteDeadline ¶
SetWriteDeadline sets the write deadline on the session.
Click to show internal directories.
Click to hide internal directories.