Documentation ¶
Index ¶
- Variables
- type Action
- type ActionHandler
- type Config
- type Dispatcher
- type IdFactory
- type Identifier
- type Manager
- func (s *Manager) AddDispatcher(dispatcher Dispatcher)
- func (s *Manager) AddIdFactory(idGen IdFactory)
- func (s *Manager) AddMessageHandler(handler MessageHandler)
- func (s *Manager) Broadcast(message []byte)
- func (s *Manager) Init()
- func (s *Manager) Manage(response http.ResponseWriter, request *http.Request) (string, error)
- func (s *Manager) OnConnect(onConnectHandler OnConnectFunc)
- func (s *Manager) OnDisconnect(onDisconnectHandler OnDisconnectFunc)
- func (s *Manager) Remove(connectionId string)
- func (s *Manager) SendToId(connectionId string, message []byte) error
- type MessageContext
- type MessageHandler
- type OnConnectFunc
- type OnConnectHandler
- type OnDisconnectFunc
- type OnDisconnectHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ConnectionIdDoestExist = errors.New("ConnectionId Does not Exist")
Functions ¶
This section is empty.
Types ¶
type ActionHandler ¶
type Dispatcher ¶
type Dispatcher interface {
Run(commander *Manager)
}
type Identifier ¶
type Identifier interface {
GetUniqueId() string
}
type Manager ¶
type Manager struct { sync.Mutex IdGen IdFactory Config *Config // contains filtered or unexported fields }
func NewManager ¶
func NewManager() *Manager
func (*Manager) AddDispatcher ¶
func (s *Manager) AddDispatcher(dispatcher Dispatcher)
for dispatcher handling
func (*Manager) AddIdFactory ¶
func (*Manager) AddMessageHandler ¶
func (s *Manager) AddMessageHandler(handler MessageHandler)
func (*Manager) OnConnect ¶
func (s *Manager) OnConnect(onConnectHandler OnConnectFunc)
func (*Manager) OnDisconnect ¶
func (s *Manager) OnDisconnect(onDisconnectHandler OnDisconnectFunc)
type MessageContext ¶
type MessageHandler ¶
type MessageHandler interface {
OnMessage(manager *Manager, ctx *MessageContext)
}
type OnConnectHandler ¶
type OnDisconnectFunc ¶
type OnDisconnectHandler ¶
Click to show internal directories.
Click to hide internal directories.