ws_conn

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

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

Go to latest
Published: Apr 4, 2024 License: EPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsClosedByClientError

func IsClosedByClientError(err error) bool

Return true if err is normal close connection error(connection close client). Return false otherwise. Note: In case if connection was close normally by client it's ok for us, we should not log error.

Types

type ConnectionHandler

type ConnectionHandler interface {
	// Add new websocket connection.
	ReadConnection(wsConn *websocket.Conn, inputChan chan []byte)
	// Send data to the client websocket connections.
	WriteDataToWsConnections(data []byte)

	// Close all connection.
	CloseConnections()
}

Websocket connection handler is connection storage. For che-machine-exec it used to manage connections with exec input/output.

type ConnectionHandlerImpl

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

Connection handler implementation.

func NewConnHandler

func NewConnHandler() *ConnectionHandlerImpl

Create new implementation connection handler.

func (*ConnectionHandlerImpl) CloseConnections

func (handler *ConnectionHandlerImpl) CloseConnections()

func (*ConnectionHandlerImpl) ReadConnection

func (handler *ConnectionHandlerImpl) ReadConnection(wsConn *websocket.Conn, inputChan chan []byte)

Add new connection to handler.

func (*ConnectionHandlerImpl) WriteDataToWsConnections

func (handler *ConnectionHandlerImpl) WriteDataToWsConnections(data []byte)

Write data to the all connections managed by handler.

Jump to

Keyboard shortcuts

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