islazy: github.com/evilsocket/islazy Index | Files | Directories

package plugin

import "github.com/evilsocket/islazy"

Index

Package Files

compile.go plugin.go

Variables

var Defines = map[string]interface{}{}

Defines is a map containing the predefined objects and functions for each vm of each plugin.

type Plugin Uses

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 Load Uses

func Load(path string) (plug *Plugin, err error)

Load loads and compiles a plugin given its path.

func Parse Uses

func Parse(code string) (*Plugin, error)

Parse parsesand compiles a plugin given its source code.

func (*Plugin) Call Uses

func (p *Plugin) Call(name string, args ...interface{}) (interface{}, error)

Call executes one of the declared callbacks of the plugin by its name.

func (*Plugin) Clone Uses

func (p *Plugin) Clone() (clone *Plugin)

Clone returns a new instance identical to the plugin.

func (*Plugin) GetObject Uses

func (p *Plugin) GetObject(name string) (interface{}, error)

GetObject returns an interface containing the value of the object by its name

func (*Plugin) GetTypeObject Uses

func (p *Plugin) GetTypeObject(name string) string

GetTypeObject returns the type of the object by its name

func (*Plugin) HasFunc Uses

func (p *Plugin) HasFunc(name string) bool

HasFunc returns true if the function with `name` has been declared in the plugin code.

func (*Plugin) IsArrayObject Uses

func (p *Plugin) IsArrayObject(name string) bool

IsArrayObject returns true if the object with a given name is a javascript array object, false otherwise

func (*Plugin) IsBooleanObject Uses

func (p *Plugin) IsBooleanObject(name string) bool

IsBooleanObject returns true if the object with a given name is a javascript boolean object, false otherwise

func (*Plugin) IsBooleanPrimitive Uses

func (p *Plugin) IsBooleanPrimitive(name string) bool

IsBooleanPrimitive returns true if the object with a given name is a javascript primitive boolean, false otherwise

func (*Plugin) IsDateObject Uses

func (p *Plugin) IsDateObject(name string) bool

IsDateObject returns true if the object with a given name is a javascript Date object, false otherwise

func (*Plugin) IsErrorObject Uses

func (p *Plugin) IsErrorObject(name string) bool

IsErrorObject returns true if the object with a given name is a javascript error object, false otherwise

func (*Plugin) IsNumberObject Uses

func (p *Plugin) IsNumberObject(name string) bool

IsNumberObject returns true if the object with a given name is a javascript Number object, false otherwise

func (*Plugin) IsNumberPrimitive Uses

func (p *Plugin) IsNumberPrimitive(name string) bool

IsNumberPrimitive returns true if the object with a given name is a javascript primitive number, false otherwise

func (*Plugin) IsRegExpObject Uses

func (p *Plugin) IsRegExpObject(name string) bool

IsRegExpObject returns true if the object with a given name is a javascript RegExp object, false otherwise

func (*Plugin) IsStringObject Uses

func (p *Plugin) IsStringObject(name string) bool

IsStringObject returns true if the object with a given name is a javascript string object, false otherwise

func (*Plugin) IsStringPrimitive Uses

func (p *Plugin) IsStringPrimitive(name string) bool

IsStringPrimitive returns true if the object with a given name is a javascript primitive string

func (*Plugin) Methods Uses

func (p *Plugin) Methods() []string

Methods returns a list of methods exported from the javascript

func (*Plugin) Objects Uses

func (p *Plugin) Objects() []string

Objects returns a list of object exported by the javascript

func (*Plugin) Set Uses

func (p *Plugin) Set(name string, v interface{}) error

Set sets a variable into the VM of this plugin instance.

Directories

PathSynopsis
asyncPackage async contains a set of helper objects for async tasks and job queues.
dataPackage data contains basic threadsafe data structures with filesystem persistance and configurable flushing policies.
examples
fsPackage fs contains helper functions for file system access and enumeration.
logPackage log provides access to log functions.
opsPackage ops contains helper operators.
pluginPackage plugin contains objects and functions to load and use javascript plugins in order to extend the functionalities of your projects.
strPackage str contains utilities for string manipulation.
tuiPackage tui contains a set of helper objects and functions for terminal based user interfaces.
versionPackage version contains information about the library version.
zipPackage zip contains zip and unzip utilities.

Package plugin imports 6 packages (graph). Updated 2019-11-07. Refresh now. Tools for package owners.