jsplugin

package
v0.0.0-...-18e76e9 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultNamespace = "system"
View Source
const PluginType = "js"

Variables

This section is empty.

Functions

This section is empty.

Types

type Initializer

type Initializer struct {
	Entry          string
	StartCommand   string
	DisableBuiltin bool
	Namespace      string
	Modules        []*herbplugin.Module
}

func NewInitializer

func NewInitializer() *Initializer

func (*Initializer) MustApplyInitializer

func (i *Initializer) MustApplyInitializer(p *Plugin)

type JsPluginLoader

type JsPluginLoader interface {
	LoadJsPlugin() *Plugin
}

type Plugin

type Plugin struct {
	sync.RWMutex

	Runtime *goja.Runtime
	herbplugin.Plugin
	DisableBuiltin bool

	Builtin map[string]func(call otto.FunctionCall) otto.Value
	// contains filtered or unexported fields
}

func MustCreatePlugin

func MustCreatePlugin(i *Initializer) *Plugin

func New

func New() *Plugin

func (*Plugin) LoadJsPlugin

func (p *Plugin) LoadJsPlugin() *Plugin

func (*Plugin) MustBootPlugin

func (p *Plugin) MustBootPlugin()

func (*Plugin) MustClosePlugin

func (p *Plugin) MustClosePlugin()

func (*Plugin) MustInitPlugin

func (p *Plugin) MustInitPlugin()

func (*Plugin) MustLoadPlugin

func (p *Plugin) MustLoadPlugin()

func (*Plugin) PluginType

func (p *Plugin) PluginType() string

Jump to

Keyboard shortcuts

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