Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SSEHandler ¶
func SSEHandler(w http.ResponseWriter, r *http.Request)
SSEHandler for gin framework route handler
Types ¶
type ConnectionManager ¶
type ConnectionManager struct {
// contains filtered or unexported fields
}
ConnectionManager structure
func NewConnectionManager ¶
func NewConnectionManager() (connectionManager *ConnectionManager)
NewConnectionManager is ConnectionManager constructor
func (*ConnectionManager) AddConnection ¶
func (manager *ConnectionManager) AddConnection(conn Connection)
AddConnection add connection to connections
func (*ConnectionManager) Broadcast ¶
func (manager *ConnectionManager) Broadcast(data JSON) (length int, err error)
Broadcast message
func (*ConnectionManager) ConnEach ¶
func (manager *ConnectionManager) ConnEach(f func([]Connection))
ConnEach get connections safety
func (*ConnectionManager) DelConnection ¶
func (manager *ConnectionManager) DelConnection(conn Connection)
DelConnection delete connection from connections
Click to show internal directories.
Click to hide internal directories.