websocket

package
v1.0.36 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 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) func(*gin.Context)

Types

type Message added in v1.0.18

type Message struct {
	Type int
	Data []byte
}

type WSHandler

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

type Websocket added in v1.0.18

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 added in v1.0.18

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