{"modulePath":"github.com/evilsocket/islazy","version":"v1.11.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package plugin\n\nPackage plugin contains objects and functions to load and use javascript plugins in order to extend the functionalities of your projects.\n\n## Variables\n\n```go\nvar Defines = map[string]interface{}{}\n```\nDefines is a map containing the predefined objects and functions for each vm of each plugin.\n\n## Types\n\n```go\ntype Plugin struct {\n\tsync.Mutex\n\t// The basename of the plugin.\n\tName string\n\t// The actual javascript code.\n\tCode string\n\t// The full path of the plugin.\n\tPath string\n\t// contains filtered or unexported fields\n}\n```\nPlugin is an object representing a javascript file exporting functions and variables that your project can use to extend its functionalities.\n\n```go\nfunc Load(path string) (plug *Plugin, err error)\n```\nLoad loads and compiles a plugin given its path.\n\n```go\nfunc Parse(code string) (*Plugin, error)\n```\nParse parsesand compiles a plugin given its source code.\n\n```go\nfunc (p *Plugin) Call(name string, args ...interface{}) (interface{}, error)\n```\nCall executes one of the declared callbacks of the plugin by its name.\n\n```go\nfunc (p *Plugin) Clone() (clone *Plugin)\n```\nClone returns a new instance identical to the plugin.\n\n```go\nfunc (p *Plugin) GetObject(name string) (interface{}, error)\n```\nGetObject returns an interface containing the value of the object by its name\n\n```go\nfunc (p *Plugin) GetTypeObject(name string) string\n```\nGetTypeObject returns the type of the object by its name\n\n```go\nfunc (p *Plugin) HasFunc(name string) bool\n```\nHasFunc returns true if the function with \\`name\\` has been declared in the plugin code.\n\n```go\nfunc (p *Plugin) IsArrayObject(name string) bool\n```\nIsArrayObject returns true if the object with a given name is a javascript array object, false otherwise\n\n```go\nfunc (p *Plugin) IsBooleanObject(name string) bool\n```\nIsBooleanObject returns true if the object with a given name is a javascript boolean object, false otherwise\n\n```go\nfunc (p *Plugin) IsBooleanPrimitive(name string) bool\n```\nIsBooleanPrimitive returns true if the object with a given name is a javascript primitive boolean, false otherwise\n\n```go\nfunc (p *Plugin) IsDateObject(name string) bool\n```\nIsDateObject returns true if the object with a given name is a javascript Date object, false otherwise\n\n```go\nfunc (p *Plugin) IsErrorObject(name string) bool\n```\nIsErrorObject returns true if the object with a given name is a javascript error object, false otherwise\n\n```go\nfunc (p *Plugin) IsNumberObject(name string) bool\n```\nIsNumberObject returns true if the object with a given name is a javascript Number object, false otherwise\n\n```go\nfunc (p *Plugin) IsNumberPrimitive(name string) bool\n```\nIsNumberPrimitive returns true if the object with a given name is a javascript primitive number, false otherwise\n\n```go\nfunc (p *Plugin) IsRegExpObject(name string) bool\n```\nIsRegExpObject returns true if the object with a given name is a javascript RegExp object, false otherwise\n\n```go\nfunc (p *Plugin) IsStringObject(name string) bool\n```\nIsStringObject returns true if the object with a given name is a javascript string object, false otherwise\n\n```go\nfunc (p *Plugin) IsStringPrimitive(name string) bool\n```\nIsStringPrimitive returns true if the object with a given name is a javascript primitive string\n\n```go\nfunc (p *Plugin) Methods() []string\n```\nMethods returns a list of methods exported from the javascript\n\n```go\nfunc (p *Plugin) Objects() []string\n```\nObjects returns a list of object exported by the javascript\n\n```go\nfunc (p *Plugin) Set(name string, v interface{}) error\n```\nSet sets a variable into the VM of this plugin instance.\n\n","path":"github.com/evilsocket/islazy/plugin","name":"plugin","synopsis":"Package plugin contains objects and functions to load and use javascript plugins in order to extend the functionalities of your projects.","isRedistributable":true}
