Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var WebSocketHubFactory = HubFactoryFunc(func() Hub { return NewHubImpl(NewClientFactory()) })
Functions ¶
This section is empty.
Types ¶
type ClientFactory ¶
type ClientImpl ¶
type ClientImpl struct {
// contains filtered or unexported fields
}
func (*ClientImpl) Broadcast ¶
func (c *ClientImpl) Broadcast(data []byte)
func (*ClientImpl) Start ¶
func (c *ClientImpl) Start()
func (*ClientImpl) UUID ¶
func (c *ClientImpl) UUID() string
type Hub ¶
type Hub interface { Broadcast(notification model.ClientNotification) Register(conn *websocket.Conn) Unregister(clientUUID string) }
type HubFactory ¶
type HubFactory interface {
GetHub() Hub
}
type HubFactoryFunc ¶
type HubFactoryFunc func() Hub
func (HubFactoryFunc) GetHub ¶
func (f HubFactoryFunc) GetHub() Hub
type HubImpl ¶
type HubImpl struct {
// contains filtered or unexported fields
}
func NewHubImpl ¶
func NewHubImpl(clientFactory ClientFactory) *HubImpl
func (*HubImpl) Broadcast ¶
func (h *HubImpl) Broadcast(notification model.ClientNotification)
func (*HubImpl) Unregister ¶
type WebSocketClientFactory ¶
type WebSocketClientFactory struct {
// contains filtered or unexported fields
}
func NewClientFactory ¶
func NewClientFactory() *WebSocketClientFactory
func (*WebSocketClientFactory) GetClient ¶
func (f *WebSocketClientFactory) GetClient(conn *websocket.Conn) Client
func (*WebSocketClientFactory) SetHub ¶
func (f *WebSocketClientFactory) SetHub(hub Hub)
Click to show internal directories.
Click to hide internal directories.