websocket

package
v1.5.19 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Destroy

func Destroy()

func Init

func Init(opts ...InitOption)

Types

type ConnectionOption added in v1.5.16

type ConnectionOption func(sessionMap map[string]any)

func WithConnectionContext added in v1.5.16

func WithConnectionContext(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 InitOption added in v1.5.19

type InitOption func(*InitOptions)

func InitWithConcurrentMessageHandling added in v1.5.19

func InitWithConcurrentMessageHandling(concurrentMessageHandling bool) InitOption

func InitWithMaxMessageBufferSize added in v1.5.19

func InitWithMaxMessageBufferSize(messageBufferSize int) InitOption

func InitWithMaxMessageSize added in v1.5.19

func InitWithMaxMessageSize(maxMessageSize int64) InitOption

func InitWithPingPeriodSec added in v1.5.19

func InitWithPingPeriodSec(pingPeriodSec int64) InitOption

func InitWithPongWaitSec added in v1.5.19

func InitWithPongWaitSec(pongWaitSec int64) InitOption

func InitWithWriteWaitSec added in v1.5.19

func InitWithWriteWaitSec(writeWaitSec int64) InitOption

type InitOptions added in v1.5.19

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

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