websocket

package
v0.0.185 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHandler

func CreateHandler(ws Websocket, config *config.Config) func(*gin.Context)

Types

type Message

type Message struct {
	Type int
	Data []byte
}

type WSHandler

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

type Websocket

type Websocket interface {
	OnMessage(ctx context.Context, r *http.Request, w Writer, session sessions.Session, msg []byte, t int)
	OnConnect(ctx context.Context, r *http.Request, w Writer, session sessions.Session)
	OnDisconnect(ctx context.Context, r *http.Request, session sessions.Session)
}

type Writer

type Writer interface {
	WriteMessage(message Message)
	Error(message string)
}

Jump to

Keyboard shortcuts

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