Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleEvent ¶
func HandleEvent(context map[string]interface{}, environment Environment, event string) error
HandleEvent handles the event in the given environment
Types ¶
type Environment ¶
type Environment interface { LoadExtensionsForPath(extensions []*schema.Extension, path string) error HandleEvent(event string, context map[string]interface{}) error Clone() Environment }
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) 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) LoadExtensionsForPath ¶
func (env *MultiEnvironment) LoadExtensionsForPath(extensions []*schema.Extension, path string) error
LoadExtensionsForPath for returns extensions for specific path