streamproto

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientHandshake

type ClientHandshake struct {
	Mode types.SessionParticipantMode `json:"mode"`
}

ClientHandshake is the first message sent by a client to inform a server of it's intentions.

type ServerHandshake

type ServerHandshake struct {
	MFARequired bool `json:"mfa_required"`
}

ServerHandshake is the first message sent by a server to inform a client of the session settings.

type SessionStream

type SessionStream struct {
	MFARequired bool
	Mode        types.SessionParticipantMode
	// contains filtered or unexported fields
}

SessionStream represents one end of the bidirectional session connection.

func NewSessionStream

func NewSessionStream(conn *websocket.Conn, handshake any) (*SessionStream, error)

NewSessionStream creates a new session stream. The type of the handshake parameter determines if this is the client or server end.

func (*SessionStream) Close

func (s *SessionStream) Close() error

Close closes the stream.

func (*SessionStream) Done

func (s *SessionStream) Done() <-chan struct{}

func (*SessionStream) ForceTerminate

func (s *SessionStream) ForceTerminate() error

ForceTerminate sends a force termination request to the other end.

func (*SessionStream) ForceTerminateQueue

func (s *SessionStream) ForceTerminateQueue() <-chan struct{}

ForceTerminateQueue returns the channel used for force termination requests.

func (*SessionStream) Read

func (s *SessionStream) Read(p []byte) (int, error)

func (*SessionStream) Resize

func (s *SessionStream) Resize(size *remotecommand.TerminalSize) error

Resize sends a resize request to the other party.

func (*SessionStream) ResizeQueue

func (s *SessionStream) ResizeQueue() <-chan *remotecommand.TerminalSize

ResizeQueue returns a channel that will receive resize requests.

func (*SessionStream) Write

func (s *SessionStream) Write(data []byte) (int, error)

Jump to

Keyboard shortcuts

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