websocket

package
v0.0.0-...-472a40a Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForwardSDStream

func ForwardSDStream(ctx context.Context, clientID string, connection *Connection, communication *models.Communication, captureDevice *capture.Capture)

func WebsocketHandler

func WebsocketHandler(c *gin.Context, communication *models.Communication, captureDevice *capture.Capture)

Types

type Connection

type Connection struct {
	Socket *websocket.Conn

	Cancels map[string]context.CancelFunc
	// contains filtered or unexported fields
}

func (*Connection) WriteJson

func (c *Connection) WriteJson(message Message) error

Concurrency handling - sending messages

func (*Connection) WriteMessage

func (c *Connection) WriteMessage(bytes []byte) error

type Message

type Message struct {
	ClientID    string            `json:"client_id" bson:"client_id"`
	MessageType string            `json:"message_type" bson:"message_type"`
	Message     map[string]string `json:"message" bson:"message"`
}

Jump to

Keyboard shortcuts

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