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 ¶ added in v1.3.0
GetObject returns an interface containing the value of the object by its name
func (*Plugin) GetTypeObject ¶ added in v1.3.0
GetTypeObject returns the type of the object by its name
func (*Plugin) HasFunc ¶ added in v1.3.0
HasFunc returns true if the function with `name` has been declared in the plugin code.
func (*Plugin) IsArrayObject ¶ added in v1.3.0
IsArrayObject returns true if the object with a given name is a javascript array object, false otherwise
func (*Plugin) IsBooleanObject ¶ added in v1.3.0
IsBooleanObject returns true if the object with a given name is a javascript boolean object, false otherwise
func (*Plugin) IsBooleanPrimitive ¶ added in v1.3.0
IsBooleanPrimitive returns true if the object with a given name is a javascript primitive boolean, false otherwise
func (*Plugin) IsDateObject ¶ added in v1.3.0
IsDateObject returns true if the object with a given name is a javascript Date object, false otherwise
func (*Plugin) IsErrorObject ¶ added in v1.3.0
IsErrorObject returns true if the object with a given name is a javascript error object, false otherwise
func (*Plugin) IsNumberObject ¶ added in v1.3.0
IsNumberObject returns true if the object with a given name is a javascript Number object, false otherwise
func (*Plugin) IsNumberPrimitive ¶ added in v1.3.0
IsNumberPrimitive returns true if the object with a given name is a javascript primitive number, false otherwise
func (*Plugin) IsRegExpObject ¶ added in v1.3.0
IsRegExpObject returns true if the object with a given name is a javascript RegExp object, false otherwise
func (*Plugin) IsStringObject ¶ added in v1.3.0
IsStringObject returns true if the object with a given name is a javascript string object, false otherwise
func (*Plugin) IsStringPrimitive ¶ added in v1.3.0
IsStringPrimitive returns true if the object with a given name is a javascript primitive string
func (*Plugin) Methods ¶ added in v1.3.0
Methods returns a list of methods exported from the javascript