ws.go 605 B

12345678910111213141516171819202122
  1. package ws
  2. import (
  3. "github.com/go-admin-team/go-admin-core/logger"
  4. )
  5. var WebsocketManager Manager
  6. func init() {
  7. WebsocketManager = Manager{
  8. Group: make(map[string]map[string]*Client),
  9. Register: make(chan *Client, 128),
  10. UnRegister: make(chan *Client, 128),
  11. GroupMessage: make(chan *GroupMessageData, 128),
  12. Message: make(chan *MessageData, 128),
  13. MessageString: make(chan *MessageDataString, 128),
  14. BroadCastMessage: make(chan *BroadCastMessageData, 128),
  15. groupCount: 0,
  16. clientCount: 0,
  17. }
  18. logger.Debug("init websocket success.")
  19. }