Documentation ¶
Index ¶
- func ClearManager()
- func HandleEvent(context map[string]interface{}, environment Environment, event string, ...) error
- type Environment
- type Error
- type Manager
- func (manager *Manager) GetEnvironment(schemaID string) (env Environment, ok bool)
- func (manager *Manager) HandleEventInAllEnvironments(context map[string]interface{}, event string, schemaID string) error
- func (manager *Manager) RegisterEnvironment(schemaID string, env Environment) error
- func (manager *Manager) UnRegisterEnvironment(schemaID string) error
- type MultiEnvironment
- func (env *MultiEnvironment) Clone() Environment
- func (env *MultiEnvironment) HandleEvent(event string, context map[string]interface{}) error
- func (env *MultiEnvironment) IsEventHandled(event string, context map[string]interface{}) bool
- func (env *MultiEnvironment) LoadExtensionsForPath(extensions []*schema.Extension, timeLimit time.Duration, ...) error
- func (env *MultiEnvironment) SetUp()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleEvent ¶
func HandleEvent(context map[string]interface{}, environment Environment, event string, schemaID string) error
HandleEvent handles the event in the given environment
Types ¶
type Environment ¶
type Environment interface { LoadExtensionsForPath(extensions []*schema.Extension, timeLimit time.Duration, timeLimits []*schema.PathEventTimeLimit, path string) error HandleEvent(event string, context map[string]interface{}) error Clone() Environment IsEventHandled(event string, context map[string]interface{}) bool }
Environment is a interface for extension environment
type Error ¶
type Error struct { ExceptionInfo map[string]interface{} // contains filtered or unexported fields }
Error is created when a problem has occurred during event handling. It contains the information required to reraise the javascript exception that caused this error.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager takes care of mapping schemas to Environments. This is a singleton class.
func (*Manager) GetEnvironment ¶
func (manager *Manager) GetEnvironment(schemaID string) (env Environment, ok bool)
GetEnvironment returns the environment registered for the given schema ID
func (*Manager) HandleEventInAllEnvironments ¶
func (manager *Manager) HandleEventInAllEnvironments(context map[string]interface{}, event string, schemaID string) error
HandleEventInAllEnvironments handles the event in all registered environments
func (*Manager) RegisterEnvironment ¶
func (manager *Manager) RegisterEnvironment(schemaID string, env Environment) error
RegisterEnvironment registers a new environment for the given schema ID
func (*Manager) UnRegisterEnvironment ¶
UnRegisterEnvironment removes an environment registered for the given schema ID
type MultiEnvironment ¶
type MultiEnvironment struct {
// contains filtered or unexported fields
}
MultiEnvironment can handle multiple environment
func NewEnvironment ¶
func NewEnvironment(envs []Environment) *MultiEnvironment
NewEnvironment create new gohan extension environment based on context
func (*MultiEnvironment) Clone ¶
func (env *MultiEnvironment) Clone() Environment
Clone makes clone of the environment
func (*MultiEnvironment) HandleEvent ¶
func (env *MultiEnvironment) HandleEvent(event string, context map[string]interface{}) error
HandleEvent handles event
func (*MultiEnvironment) IsEventHandled ¶
func (env *MultiEnvironment) IsEventHandled(event string, context map[string]interface{}) bool
IsEventHandled returns whether a given event is handled by this environment
func (*MultiEnvironment) LoadExtensionsForPath ¶
func (env *MultiEnvironment) LoadExtensionsForPath(extensions []*schema.Extension, timeLimit time.Duration, timeLimits []*schema.PathEventTimeLimit, path string) error
LoadExtensionsForPath for returns extensions for specific path
Directories ¶
Path | Synopsis |
---|---|
Package goext is a generated GoMock package.
|
Package goext is a generated GoMock package. |