websocket

package
v0.0.0-...-f2b9f5f Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewWebSocket

func NewWebSocket(gctx global.Context, conn *websocket.Conn) (client.Connection, error)

Types

type WebSocket

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

func (*WebSocket) Actor

func (*WebSocket) Actor() *structures.User

func (*WebSocket) Buffer

func (w *WebSocket) Buffer() client.EventBuffer

Buffer implements client.Connection

func (*WebSocket) Cache

func (w *WebSocket) Cache() client.Cache

func (*WebSocket) Context

func (w *WebSocket) Context() context.Context

func (*WebSocket) Destroy

func (w *WebSocket) Destroy(gctx global.Context)

func (*WebSocket) Events

func (w *WebSocket) Events() *client.EventMap

func (*WebSocket) ForceClose

func (w *WebSocket) ForceClose()

func (*WebSocket) Greet

func (w *WebSocket) Greet(gctx global.Context) error

func (*WebSocket) Handler

func (w *WebSocket) Handler() client.Handler

func (*WebSocket) OnClose

func (w *WebSocket) OnClose() <-chan struct{}

func (*WebSocket) OnReady

func (w *WebSocket) OnReady() <-chan struct{}

func (*WebSocket) Read

func (w *WebSocket) Read(gctx global.Context)

func (*WebSocket) SendAck

func (w *WebSocket) SendAck(cmd events.Opcode, data json.RawMessage) error

func (*WebSocket) SendClose

func (w *WebSocket) SendClose(code events.CloseCode, after time.Duration)

func (*WebSocket) SendError

func (w *WebSocket) SendError(txt string, fields map[string]any)

SendError implements Connection

func (*WebSocket) SendHeartbeat

func (w *WebSocket) SendHeartbeat() error

func (*WebSocket) SessionID

func (w *WebSocket) SessionID() string

func (*WebSocket) SetReady

func (w *WebSocket) SetReady()

func (*WebSocket) SetWriter

func (*WebSocket) SetWriter(w *bufio.Writer, f http.Flusher)

func (*WebSocket) Transport

func (w *WebSocket) Transport() client.Transport

func (*WebSocket) Write

func (w *WebSocket) Write(msg events.Message[json.RawMessage]) error

Jump to

Keyboard shortcuts

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