websocket

package
v1.5.28 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: GPL-3.0 Imports: 5 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 BroadCastFilterCallback added in v1.5.21

type BroadCastFilterCallback func(context map[string]any) bool

type ConnectionOption added in v1.5.16

type ConnectionOption func(sessionMap *map[string]any)

func WithConnectionContext added in v1.5.16

func WithConnectionContext(context map[string]any) ConnectionOption

type HandleCloseFunc

type HandleCloseFunc func(i int, s string, context map[string]any) error

type HandleConnectFunc

type HandleConnectFunc func(context map[string]any)

type HandleDisconnectFunc

type HandleDisconnectFunc func(context map[string]any)

type HandleErrorFunc

type HandleErrorFunc func(err error, context map[string]any)

type HandleMessageFunc

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

type HandlePongFunc

type HandlePongFunc func(context map[string]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) BroadCastFilter added in v1.5.21

func (m *Manager) BroadCastFilter(groupID string, msg []byte, filterCallback BroadCastFilterCallback) error

func (*Manager) HandleClose

func (m *Manager) HandleClose(groupID string, handleCloseFunc HandleCloseFunc)

func (*Manager) HandleConnect

func (m *Manager) HandleConnect(groupID string, handleConnectFunc HandleConnectFunc)

func (*Manager) HandleDisconnect

func (m *Manager) HandleDisconnect(groupID string, handleDisconnectFunc HandleDisconnectFunc)

func (*Manager) HandleError

func (m *Manager) HandleError(groupID string, handleErrorFunc HandleErrorFunc)

func (*Manager) HandleMessage

func (m *Manager) HandleMessage(groupID string, handleMessageFunc HandleMessageFunc) error

func (*Manager) HandlePong

func (m *Manager) HandlePong(groupID string, handlePongFunc HandlePongFunc)

func (*Manager) HandleRequest

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

func (*Manager) RegisterHub added in v1.5.20

func (m *Manager) RegisterHub(groupID string, opts ...InitOption)

func (*Manager) UnregisterHub added in v1.5.20

func (m *Manager) UnregisterHub(groupID string)

Jump to

Keyboard shortcuts

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