socket

package
v0.0.0-...-1c24204 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WebsocketClient

type WebsocketClient struct {
	Conn          *websocket.Conn
	StorageDriver storage.Driver
	Client        client.ClientMetadata
	User          models.User

	InitialSync bool
	// contains filtered or unexported fields
}

WebsocketClient contains the connection as well as metadata for a client Used by both the server and client This is mainly a transport layer connection

func (*WebsocketClient) Close

func (c *WebsocketClient) Close(msg string)

Close will gracefully close the connection. If an error ocurrs during closing, it will be ignored. It will set the WebsocketClient as closed and will NOT send a CLose Message if the connection is closed already

func (*WebsocketClient) SendMessage

func (c *WebsocketClient) SendMessage(message messages.WebsocketRequest) error

sendMessage enforces a uniform style in sending data

Jump to

Keyboard shortcuts

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