scripts

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewScriptService

func NewScriptService(lc fx.Lifecycle,
	cfg *models.AppConfig,
	storage *storage.Storage,
	eventBus bus.Bus,
	adaptors *adaptors.Adaptors,
	validation *validation.Validate) scripts.ScriptService

NewScriptService ...

Types

type Engine

type Engine struct {
	IsRun atomic.Bool
	// contains filtered or unexported fields
}

Engine ...

func NewEngine

func NewEngine(s *m.Script, functions, structures *Pull, loader require.SourceLoader) (engine *Engine, err error)

NewEngine ...

func (*Engine) AssertFunction

func (s *Engine) AssertFunction(f string, arg ...interface{}) (result string, err error)

AssertFunction ...

func (*Engine) Compile

func (s *Engine) Compile() (err error)

Compile ...

func (*Engine) Do

func (s *Engine) Do() (string, error)

Do ...

func (*Engine) DoFull

func (s *Engine) DoFull() (res string, err error)

DoFull ...

func (*Engine) EvalScript

func (s *Engine) EvalScript(script *m.Script) (result string, err error)

EvalScript ...

func (*Engine) EvalString

func (s *Engine) EvalString(str ...string) (result string, errs error)

EvalString ...

func (*Engine) File

func (s *Engine) File(path string) ([]byte, error)

File ...

func (*Engine) Get

func (s *Engine) Get() scripts.IScript

Get ...

func (*Engine) Print

func (s *Engine) Print(v ...interface{})

Print ...

func (*Engine) PushFunction

func (s *Engine) PushFunction(name string, i interface{})

PushFunction ...

func (*Engine) PushStruct

func (s *Engine) PushStruct(name string, i interface{})

PushStruct ...

func (*Engine) Script

func (s *Engine) Script() *m.Script

func (*Engine) ScriptId

func (s *Engine) ScriptId() int64

type EngineWatcher

type EngineWatcher struct {
	// contains filtered or unexported fields
}

func NewEngineWatcher

func NewEngineWatcher(script *m.Script, s *scriptService, eventBus bus.Bus) *EngineWatcher

func (*EngineWatcher) BeforeSpawn

func (w *EngineWatcher) BeforeSpawn(f func(engine scripts.Engine))

func (*EngineWatcher) Engine

func (w *EngineWatcher) Engine() scripts.Engine

func (*EngineWatcher) PopFunction

func (w *EngineWatcher) PopFunction(name string)

func (*EngineWatcher) PopStruct

func (w *EngineWatcher) PopStruct(name string)

func (*EngineWatcher) PushFunction

func (w *EngineWatcher) PushFunction(name string, f interface{})

func (*EngineWatcher) PushStruct

func (w *EngineWatcher) PushStruct(name string, str interface{})

func (*EngineWatcher) Spawn

func (w *EngineWatcher) Spawn(f func(engine scripts.Engine))

func (*EngineWatcher) Stop

func (w *EngineWatcher) Stop()

type EnginesWatcher

type EnginesWatcher struct {
	// contains filtered or unexported fields
}

func NewEnginesWatcher

func NewEnginesWatcher(scripts []*m.Script, s *scriptService, eventBus bus.Bus) *EnginesWatcher

func (*EnginesWatcher) AssertFunction

func (w *EnginesWatcher) AssertFunction(f string, arg ...interface{}) (result string, err error)

func (*EnginesWatcher) BeforeSpawn

func (w *EnginesWatcher) BeforeSpawn(f func(engine scripts.Engine))

func (*EnginesWatcher) Engine

func (w *EnginesWatcher) Engine() scripts.Engine

func (*EnginesWatcher) PopFunction

func (w *EnginesWatcher) PopFunction(name string)

func (*EnginesWatcher) PopStruct

func (w *EnginesWatcher) PopStruct(name string)

func (*EnginesWatcher) PushFunction

func (w *EnginesWatcher) PushFunction(name string, f interface{})

func (*EnginesWatcher) PushStruct

func (w *EnginesWatcher) PushStruct(name string, str interface{})

func (*EnginesWatcher) Spawn

func (w *EnginesWatcher) Spawn(f func(engine scripts.Engine))

func (*EnginesWatcher) Stop

func (w *EnginesWatcher) Stop()

type Javascript

type Javascript struct {
	// contains filtered or unexported fields
}

Javascript ...

func NewJavascript

func NewJavascript(engine *Engine, loader require.SourceLoader) *Javascript

NewJavascript ...

func (*Javascript) AssertFunction

func (j *Javascript) AssertFunction(f string, args ...interface{}) (result string, err error)

AssertFunction ...

func (*Javascript) Compile

func (j *Javascript) Compile() (err error)

Compile ...

func (*Javascript) CreateProgram

func (j *Javascript) CreateProgram(name, source string) (err error)

CreateProgram ...

func (*Javascript) Do

func (j *Javascript) Do() (result string, err error)

Do ...

func (*Javascript) EvalString

func (j *Javascript) EvalString(src string) (result string, err error)

EvalString ...

func (*Javascript) GetCompiler

func (j *Javascript) GetCompiler() error

GetCompiler ...

func (*Javascript) Init

func (j *Javascript) Init() (err error)

Init ...

func (*Javascript) PushFunction

func (j *Javascript) PushFunction(name string, s interface{})

PushFunction ...

func (*Javascript) PushStruct

func (j *Javascript) PushStruct(name string, s interface{})

PushStruct ...

func (*Javascript) RunProgram

func (j *Javascript) RunProgram(name string) (result string, err error)

RunProgram ...

type Pull

type Pull struct {
	// contains filtered or unexported fields
}

Pull ...

func NewPull

func NewPull() *Pull

NewPull ...

func (*Pull) Get

func (p *Pull) Get(name string) (value interface{}, ok bool)

Get ...

func (*Pull) Pop

func (p *Pull) Pop(name string)

Pop ...

func (*Pull) Purge

func (p *Pull) Purge()

Purge ...

func (*Pull) Push

func (p *Pull) Push(name string, s interface{})

Push ...

func (*Pull) Range

func (p *Pull) Range(f func(key, value interface{}) bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳