Documentation ¶
Index ¶
- func ClearManager()
- func HandleEvent(context map[string]interface{}, environment Environment, event string) error
- func RegisterGoCallback(name string, callback GoCallback)
- func RegisterModule(name string, module interface{})
- func RequireModule(name string) interface{}
- type Environment
- type Error
- type GoCallback
- type Manager
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
func RegisterGoCallback ¶
func RegisterGoCallback(name string, callback GoCallback)
RegisterGoCallback register go call back
func RegisterModule ¶
func RegisterModule(name string, module interface{})
RegisterModule registers modules
Types ¶
type Environment ¶
type Environment interface { Load(source, code string) error RegisterObject(objectID string, object 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 occured during event handling. It contains the information required to reraise the javascript exception that caused this error.
type GoCallback ¶
GoCallback is type for go based callback
func GetGoCallback ¶
func GetGoCallback(name string) GoCallback
GetGoCallback returns registered go callback
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