extension

package
v0.0.0-...-b41ccf1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2015 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearManager

func ClearManager()

ClearManager clears manager

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

func RequireModule

func RequireModule(name string) interface{}

RequireModule returns module

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

type GoCallback func(event string, context map[string]interface{}) error

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 GetManager

func GetManager() *Manager

GetManager gets manager

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

func (manager *Manager) UnRegisterEnvironment(schemaID string) error

UnRegisterEnvironment removes an environment registered for the given schema ID

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL