Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WebSocketHandler ¶
func WebSocketHandler(broadcaster *Broadcaster) http.Handler
Types ¶
type Broadcaster ¶
type Broadcaster struct {
// contains filtered or unexported fields
}
func NewBroadcaster ¶
func NewBroadcaster() *Broadcaster
func (*Broadcaster) AddClient ¶
func (b *Broadcaster) AddClient(client *Client)
func (*Broadcaster) Broadcast ¶
func (b *Broadcaster) Broadcast(message []byte)
func (*Broadcaster) RemoveClient ¶
func (b *Broadcaster) RemoveClient(client *Client)
type ClientOption ¶
type ClientOption func(*Client)
func WithSendChannel ¶
func WithSendChannel(send chan []byte) ClientOption
Click to show internal directories.
Click to hide internal directories.