Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶
EventHandler - event handler struct.
type EventRouter ¶
type EventRouter struct {
// contains filtered or unexported fields
}
EventRouter - event handler map.
func NewEventRouter ¶
func NewEventRouter() *EventRouter
NewEventRouter - initialization for event router.
func (*EventRouter) HandleEvent ¶
func (ro *EventRouter) HandleEvent(ie *websocket.Event, b *websocket.Bus)
HandleEvent - handle event by handler.
func (*EventRouter) SetRoute ¶
func (ro *EventRouter) SetRoute(op string, h EventHandler)
SetRoute - set route to the map.
type HttpRouter ¶
HttpRouter - custom router structure.
func (*HttpRouter) AddIndexRoute ¶
func (hr *HttpRouter) AddIndexRoute(pattern string, h httpHandler)
AddIndexRoute - add route handle for index page.
func (*HttpRouter) AddRoute ¶
func (hr *HttpRouter) AddRoute(pattern string, h httpHandler)
AddRoute - add route handle for common page.
type WsRouter ¶
type WsRouter struct { http.ServeMux BeforeRouteCall func(http.ResponseWriter, *http.Request) *websocket.Bus // contains filtered or unexported fields }
WsRouter - websocket router struct.
func (*WsRouter) AddEventRoute ¶
func (wsr *WsRouter) AddEventRoute(op string, handler EventHandler)
AddEventRoute - add event route handler.
func (*WsRouter) AddIndexRoute ¶
AddIndexRoute - add route handle for index page. Where `id` - is newly added connection for client.
Click to show internal directories.
Click to hide internal directories.