Documentation ¶
Index ¶
- Variables
- func ApiPanicF(format string, args ...Any)
- func Capture(output Output, done Channel)
- func Cascade(output Output, done Channel, action Action, cb func(done Channel))
- func CloseAction(ch chan Action)
- func CloseData(ch chan []byte)
- func CloseDone(done Channel)
- func CloseError(ch chan error)
- func CloseIfRecover(output Output, done Channel)
- func CopyContext(ctx *Context, psp Any)
- func Dial(network string, address string, toms int64) (net.Conn, error)
- func ForwardClose(output Output, dst Channel, src Channel)
- func Future(ms int64) time.Time
- func IfDone(done Channel, toms int64) bool
- func IsClosed(ch <-chan bool) bool
- func IsLogPrintable(level string) bool
- func LogLevelFromEnv()
- func LogRecover(output Output, r Any)
- func Millis(ms int64) time.Duration
- func OnDone(output Output, done Channel, action Action)
- func OptionBool(opts Map, name string, required bool, def bool) bool
- func OptionInt64(opts Map, name string, required bool, def int64) int64
- func OptionString(opts Map, name string, required bool, def string) string
- func PanicF(format string, args ...Any)
- func PanicIfErr(err error)
- func PanicTunnel(action Action)
- func Read(conn net.Conn, data []byte) (int, error)
- func Readable(s string) string
- func Receive(done Channel)
- func Recover(output Output)
- func RecoverIgnore()
- func Safe(output Output, action Action)
- func Send(done Channel, any Any)
- func TraceAction(action Action, tag string)
- func TraceCall(out Output, call VmCall)
- func TraceChannel(channel Channel, tag string)
- func TraceLog(output Output, tag string)
- func TraceTag(tag string)
- func Write(conn net.Conn, data []byte, toms int64) error
- type Action
- type Any
- type Babel
- type Capi
- type Chain
- type Channel
- type Context
- type Dapi
- type Factory
- type Id
- type Map
- type Output
- type PanicTrace
- type Papi
- type Plugin
- type Queue
- type Runtime
- type Sapi
- type VmApi
- type VmCall
- type VmCallable
- type VmError
- type VmFunction
- type VmProgram
- type VmRuntime
- type VmValue
Constants ¶
This section is empty.
Variables ¶
View Source
var LogLevel = "info" //trace, debug, info
View Source
var NopDapi = func(...Any) {}
View Source
var NopOutput = func(...Any) {}
View Source
var NopSapi = func(...Any) Any { return nil }
View Source
var VmAssertFunction = goja.AssertFunction
View Source
var VmCompile = goja.Compile
View Source
var VmNew = goja.New
View Source
var VmNil = _vm_.ToValue(nil)
View Source
var VmNopCallable = func(this VmValue, args ...VmValue) (VmValue, error) { return VmNil, nil }
View Source
var VmNopFunction = func(VmCall) VmValue { return VmNil }
View Source
var VmThrow = func(value VmValue) { panic(value) }
View Source
var VmToValue = _vm_.ToValue
View Source
var VmUndefined = goja.Undefined()
Functions ¶
func CloseAction ¶
func CloseAction(ch chan Action)
func CloseError ¶
func CloseError(ch chan error)
func CloseIfRecover ¶
func CopyContext ¶
func ForwardClose ¶
func IsLogPrintable ¶
info|warn|error|panic are always displayed info is for explicit script logging or once per script events debug is for once per managed object events trace is for many per managed objects events and stack traces
func LogLevelFromEnv ¶
func LogLevelFromEnv()
func LogRecover ¶
func PanicIfErr ¶
func PanicIfErr(err error)
func RecoverIgnore ¶
func RecoverIgnore()
func TraceAction ¶
func TraceChannel ¶
Types ¶
type Babel ¶
type Context ¶
type Context struct { Name string //mandatory: plugin name to report when diposed Exit Channel //mandatory: global exit signal Output Output //mandatory: logger with levels trace|debug|info|warn|error Callback func(Channel, Capi, ...Any) //mandatory: plugin callback into the vm with cancel channel (discards return value) AddManaged func(string, Channel) //mandatory: register managed object RemoveManaged func(string) //mandatory: unregister managed opbject }
type PanicTrace ¶
type PanicTrace struct {
// contains filtered or unexported fields
}
func (*PanicTrace) String ¶
func (pt *PanicTrace) String() string
type Runtime ¶
type Runtime interface { AddPlugin(name string, factory Factory) Channel //register plugin RunString(path string, src string) Channel //run es6 js string, path is for inline source map CloseDone() //send done signal to all plugins WaitZeroTo(int64) bool //wait zero managed count with ms timeout WaitNonZeroTo(int64) bool //wait non zero managed count with ms timeout WaitAbort() bool //wait zero managed count with ctrl+c timeout Dispose() Channel //hard dispose internal state to avoid further execution }
type VmApi ¶
type VmApi = map[string]VmFunction
type VmCallable ¶
type VmFunction ¶
func SapiToVm ¶
func SapiToVm(sapi Sapi) VmFunction
Click to show internal directories.
Click to hide internal directories.