Documentation ¶
Index ¶
- type Action
- type ActionsHandler
- type Context
- func (context *Context) Join(room string)
- func (context *Context) Leave(room string)
- func (context *Context) Params(key string) interface{}
- func (context *Context) ParamsInt(key string, fallback int) int
- func (context *Context) ParamsStr(key string) string
- func (context *Context) ParamsWithFallback(key string, fallback interface{}) interface{}
- func (context *Context) Property(key string) interface{}
- func (context *Context) PropertyWithFallback(key string, fallback interface{}) interface{}
- func (context *Context) Rooms() []string
- func (context *Context) SetProperty(key string, value interface{})
- func (context *Context) SingleJoin(room string)
- type Controllable
- type ControllerHandler
- type ErrorsView
- type Event
- type Hook
- type HooksHandler
- type Manager
- type NetworkError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionsHandler ¶
type ActionsHandler struct {
// contains filtered or unexported fields
}
ActionsHandler used to mange callbacks for controllers
func (*ActionsHandler) RegisterAction ¶ added in v0.0.21
func (handler *ActionsHandler) RegisterAction(actionName string, action Action)
RegisterAction used to register action
func (*ActionsHandler) RegisterConnectedAction ¶ added in v0.0.37
func (handler *ActionsHandler) RegisterConnectedAction(action Action)
RegisterConnectedAction used to register connected action
func (*ActionsHandler) RegisterDisconnectedAction ¶ added in v0.0.37
func (handler *ActionsHandler) RegisterDisconnectedAction(action Action)
RegisterDisconnectedAction used to register disconnected action
func (*ActionsHandler) RegisterErrorAction ¶ added in v0.0.37
func (handler *ActionsHandler) RegisterErrorAction(action Action)
RegisterErrorAction used to register error action
type Context ¶ added in v0.0.21
type Context struct {
// contains filtered or unexported fields
}
Context used to represent context with properties and params
func (*Context) ParamsWithFallback ¶ added in v0.0.21
ParamsWithFallback used to retrieve params value with a fallback
func (*Context) PropertyWithFallback ¶ added in v0.0.21
PropertyWithFallback used to retrieve context property value with a fallback
func (*Context) SetProperty ¶ added in v0.0.21
SetProperty used to set property that can used across the context
func (*Context) SingleJoin ¶ added in v0.0.21
SingleJoin used to join socketio room while leaving other joined rooms
type Controllable ¶ added in v0.0.21
type Controllable interface {
RegisterHooksAndActions(*HooksHandler, *ActionsHandler)
}
Controllable is the interface for all controllers implementing RegisterBeforeHooks and RegisterActions
type ControllerHandler ¶
type ControllerHandler struct {
// contains filtered or unexported fields
}
ControllerHandler used to handle controller
type ErrorsView ¶ added in v0.0.21
type ErrorsView struct {
Messages string
}
ErrorsView is view template for controller errors
type Event ¶ added in v0.0.21
type Event struct {
// contains filtered or unexported fields
}
Event used as medium of communication
type HooksHandler ¶ added in v0.0.21
type HooksHandler struct {
// contains filtered or unexported fields
}
HooksHandler used to mange callbacks for controllers
func (*HooksHandler) RegisterBeforeHook ¶ added in v0.0.27
func (handler *HooksHandler) RegisterBeforeHook(beforeHook Hook)
RegisterBeforeHook used to add before hook
type Manager ¶ added in v0.0.21
type Manager struct {
// contains filtered or unexported fields
}
Manager is singleton manager for controller module
func (*Manager) BroadcastEvent ¶ added in v0.0.21
func (manager *Manager) BroadcastEvent(nsp string, room string, eventName string, view interface{}, parameters helpers.H)
BroadcastEvent used to broadcast event
func (*Manager) RegisterController ¶ added in v0.0.21
func (manager *Manager) RegisterController(nsp string, controllable Controllable)
RegisterController used to register controller
type NetworkError ¶
NetworkError encapsulates network error with status code and error message