Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSSEHandler ¶
func NewSSEHandler(clientManager *ClientManager) http.HandlerFunc
NewSSEHandler handles the SSE connection
Types ¶
type Client ¶
Client is a client of the SSE server
func (*Client) SendMessage ¶
SendMessage sends a message to the client
func (*Client) WriteSSE ¶
func (c *Client) WriteSSE(w http.ResponseWriter)
WriteSSE writes data to the client
type ClientManager ¶
type ClientManager struct {
// contains filtered or unexported fields
}
ClientManager is a manager of the S
func NewClientManager ¶
func NewClientManager() *ClientManager
NewClientManager creates a new client manager
func (*ClientManager) AddClient ¶
func (cm *ClientManager) AddClient(client *Client)
AddClient adds a client to the manager
func (*ClientManager) GetClient ¶
func (cm *ClientManager) GetClient(id uint32) (*Client, bool)
GetClient returns a client by id
func (*ClientManager) RemoveClient ¶
func (cm *ClientManager) RemoveClient(id uint32)
RemoveClient removes a client from the manager
Click to show internal directories.
Click to hide internal directories.