Documentation ¶
Overview ¶
Package plugin contains objects and functions to load and use javascript plugins in order to extend the functionalities of your projects.
Index ¶
- Variables
- type Plugin
- func (p *Plugin) Call(name string, args ...interface{}) (interface{}, error)
- func (p *Plugin) Clone() (clone *Plugin)
- func (p *Plugin) GetObject(name string) (interface{}, error)
- func (p *Plugin) GetTypeObject(name string) string
- func (p *Plugin) HasFunc(name string) bool
- func (p *Plugin) IsArrayObject(name string) bool
- func (p *Plugin) IsBooleanObject(name string) bool
- func (p *Plugin) IsBooleanPrimitive(name string) bool
- func (p *Plugin) IsDateObject(name string) bool
- func (p *Plugin) IsErrorObject(name string) bool
- func (p *Plugin) IsNumberObject(name string) bool
- func (p *Plugin) IsNumberPrimitive(name string) bool
- func (p *Plugin) IsRegExpObject(name string) bool
- func (p *Plugin) IsStringObject(name string) bool
- func (p *Plugin) IsStringPrimitive(name string) bool
- func (p *Plugin) Methods() []string
- func (p *Plugin) Objects() []string
- func (p *Plugin) Set(name string, v interface{}) error
Constants ¶
This section is empty.
Variables ¶
var Defines = map[string]interface{}{}
Defines is a map containing the predefined objects and functions for each vm of each plugin.
Functions ¶
This section is empty.
Types ¶
type Plugin ¶
type Plugin struct { sync.Mutex // The basename of the plugin. Name string // The actual javascript code. Code string // The full path of the plugin. Path string // contains filtered or unexported fields }
Plugin is an object representing a javascript file exporting functions and variables that your project can use to extend its functionalities.
func (*Plugin) GetObject ¶
GetObject returns an interface containing the value of the object by its name
func (*Plugin) GetTypeObject ¶
GetTypeObject returns the type of the object by its name
func (*Plugin) HasFunc ¶
HasFunc returns true if the function with `name` has been declared in the plugin code.
func (*Plugin) IsArrayObject ¶
IsArrayObject returns true if the object with a given name is a javascript array object, false otherwise
func (*Plugin) IsBooleanObject ¶
IsBooleanObject returns true if the object with a given name is a javascript boolean object, false otherwise
func (*Plugin) IsBooleanPrimitive ¶
IsBooleanPrimitive returns true if the object with a given name is a javascript primitive boolean, false otherwise
func (*Plugin) IsDateObject ¶
IsDateObject returns true if the object with a given name is a javascript Date object, false otherwise
func (*Plugin) IsErrorObject ¶
IsErrorObject returns true if the object with a given name is a javascript error object, false otherwise
func (*Plugin) IsNumberObject ¶
IsNumberObject returns true if the object with a given name is a javascript Number object, false otherwise
func (*Plugin) IsNumberPrimitive ¶
IsNumberPrimitive returns true if the object with a given name is a javascript primitive number, false otherwise
func (*Plugin) IsRegExpObject ¶
IsRegExpObject returns true if the object with a given name is a javascript RegExp object, false otherwise
func (*Plugin) IsStringObject ¶
IsStringObject returns true if the object with a given name is a javascript string object, false otherwise
func (*Plugin) IsStringPrimitive ¶
IsStringPrimitive returns true if the object with a given name is a javascript primitive string