websocket

package
v1.5.17 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Destroy

func Destroy()

func Init

func Init()

Types

type ConnectionOption added in v1.5.16

type ConnectionOption func(sessionMap map[string]any)

func WithConnectionContext added in v1.5.16

func WithConnectionContext(key string, context any) ConnectionOption

type HandleCloseFunc

type HandleCloseFunc func(groupID string, i int, s string, context any) error

type HandleConnectFunc

type HandleConnectFunc func(groupID string, context any)

type HandleDisconnectFunc

type HandleDisconnectFunc func(groupID string, context any)

type HandleErrorFunc

type HandleErrorFunc func(groupID string, err error, context any)

type HandleMessageFunc

type HandleMessageFunc func(groupID string, message []byte, context any)

type HandlePongFunc

type HandlePongFunc func(groupID string, context any)

type Manager

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

func GetInstance

func GetInstance() *Manager

func (*Manager) BroadCast

func (m *Manager) BroadCast(groupID string, msg []byte) error

func (*Manager) HandleClose

func (m *Manager) HandleClose(handleCloseFunc HandleCloseFunc)

func (*Manager) HandleConnect

func (m *Manager) HandleConnect(handleConnectFunc HandleConnectFunc)

func (*Manager) HandleDisconnect

func (m *Manager) HandleDisconnect(handleDisconnectFunc HandleDisconnectFunc)

func (*Manager) HandleError

func (m *Manager) HandleError(handleErrorFunc HandleErrorFunc)

func (*Manager) HandleMessage

func (m *Manager) HandleMessage(handleMessageFunc HandleMessageFunc)

func (*Manager) HandlePong

func (m *Manager) HandlePong(handlePongFunc HandlePongFunc)

func (*Manager) HandleRequest

func (m *Manager) HandleRequest(groupID string, w http.ResponseWriter, r *http.Request, opts ...ConnectionOption) error

Jump to

Keyboard shortcuts

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