Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // ID returns a client id ID() uint64 // OnClose sets a close handler OnClose(h func()) // OnSubscribe sets a subscribing handler OnSubscribe(h func(params []string)) // OnSubscribe sets a unsubscribing handler OnUnsubscribe(h func(params []string)) // Send sends a message to the client Send(msg []byte) }
Client represents a contract for websocket client
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub maintains a set of active clients
func (*Hub) UnRegister ¶
UnRegister unregisters a client from the hub
func (*Hub) Unsubscribe ¶
func (h *Hub) Unsubscribe(e UnsubscribeEvent)
Unsubscribe handle unsubscribing
type SubscribeEvent ¶
SubscribeEvent is a subscription detail
type UnsubscribeEvent ¶
UnsubscribeEvent is a unsubscription detail
Click to show internal directories.
Click to hide internal directories.