wshandler

package
v1.0.2-0...-2da3d3e Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CleanupEvent

type CleanupEvent struct {
	ClientID string
	Room     string
	Adapter  wsadapter.Adapter
}

type RoomEvent

type RoomEvent struct {
	ClientID string
	Room     string
	Adapter  wsadapter.Adapter
	Message  wsmessage.Message
}

type RoomManager

type RoomManager interface {
	Enter(room string) wsadapter.Adapter
	Exit(room string)
}

type WSS

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

func NewWSS

func NewWSS(rooms RoomManager) *WSS

func (*WSS) HandleRoom

func (wss *WSS) HandleRoom(w http.ResponseWriter, r *http.Request, handleMessage func(RoomEvent))

func (*WSS) HandleRoomWithCleanup

func (wss *WSS) HandleRoomWithCleanup(w http.ResponseWriter, r *http.Request, handleMessage func(RoomEvent), cleanup func(CleanupEvent))

Jump to

Keyboard shortcuts

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