Documentation ¶
Index ¶
- Variables
- func Call(runtime *goja.Runtime, function JavaScriptFunc, arguments ...any) any
- func CreateEarlyBindExtension(context *Context) goja.Value
- func CreateLateBindExtension(context *Context) goja.Value
- type Bind
- type Context
- type CreateExtensionFunc
- type CreateResolverFunc
- type EarlyBind
- type Environment
- func (self *Environment) AddModule(url urlpkg.URL, module *Module)
- func (self *Environment) Call(function JavaScriptFunc, arguments ...any) any
- func (self *Environment) ClearCache()
- func (self *Environment) NewChild() *Environment
- func (self *Environment) NewContext(url urlpkg.URL, parent *Context) *Context
- func (self *Environment) NewModule() *Module
- func (self *Environment) Release() error
- func (self *Environment) RequireID(id string) (*goja.Object, error)
- func (self *Environment) RequireURL(url urlpkg.URL) (*goja.Object, error)
- func (self *Environment) RestartWatcher() error
- func (self *Environment) StopWatcher() error
- func (self *Environment) Watch(path string) error
- type Extension
- type FileAPI
- func (self FileAPI) Download(sourceUrl string, targetPath string) error
- func (self FileAPI) Exec(name string, arguments ...string) (string, error)
- func (self FileAPI) JoinFilePath(elements ...string) string
- func (self FileAPI) TemporaryDirectory(pattern string, directory string) (string, error)
- func (self FileAPI) TemporaryFile(pattern string, directory string) (string, error)
- type FormatAPI
- func (self FormatAPI) Atob(b64 string) ([]byte, error)
- func (self FormatAPI) Btoa(bytes []byte) string
- func (self FormatAPI) BytesToString(bytes []byte) string
- func (self FormatAPI) Decode(code string, format string, all bool) (ard.Value, error)
- func (self FormatAPI) Encode(value any, format string, indent string, writer io.Writer) (string, error)
- func (self FormatAPI) NewXMLDocument() *etree.Document
- func (self FormatAPI) StringToBytes(string_ string) []byte
- func (self FormatAPI) ValidateFormat(code string, format string) error
- type JavaScriptFunc
- type LateBind
- type Module
- type OnChangedFunc
- type PrecompileFunc
- type ResolveFunc
- type ThreadSafeObject
- func (self *ThreadSafeObject) Delete(key string) bool
- func (self *ThreadSafeObject) Get(key string) goja.Value
- func (self *ThreadSafeObject) Has(key string) bool
- func (self *ThreadSafeObject) Keys() []string
- func (self *ThreadSafeObject) NewDynamicObject(runtime *goja.Runtime) *goja.Object
- func (self *ThreadSafeObject) Set(key string, value goja.Value) bool
- type UtilAPI
- func (self UtilAPI) DeepCopy(value ard.Value) ard.Value
- func (self UtilAPI) DeepEquals(a ard.Value, b ard.Value) bool
- func (self UtilAPI) Go(value goja.Value) error
- func (self UtilAPI) Hash(value ard.Value) (string, error)
- func (self UtilAPI) IsType(value ard.Value, type_ string) (bool, error)
- func (self UtilAPI) Mutex() util.RWLocker
- func (self UtilAPI) Now() time.Time
- func (self UtilAPI) Once(name string, value goja.Value) error
- func (self UtilAPI) Sprintf(format string, args ...any) string
Constants ¶
This section is empty.
Variables ¶
View Source
var CamelCaseMapper camelCaseMapper
Functions ¶
func Call ¶ added in v0.1.39
func Call(runtime *goja.Runtime, function JavaScriptFunc, arguments ...any) any
func CreateEarlyBindExtension ¶ added in v0.1.39
CreateExtensionFunc signature
func CreateLateBindExtension ¶ added in v0.1.39
CreateExtensionFunc signature
Types ¶
type Context ¶ added in v0.1.33
type Context struct { Environment *Environment Parent *Context Module *Module Resolve ResolveFunc Extensions []goja.Value }
type CreateExtensionFunc ¶ added in v0.1.32
type CreateResolverFunc ¶ added in v0.1.32
type CreateResolverFunc func(url urlpkg.URL, context *Context) ResolveFunc
func NewDefaultResolverCreator ¶ added in v0.1.39
type Environment ¶ added in v0.1.32
type Environment struct { Runtime *goja.Runtime URLContext *urlpkg.Context Path []urlpkg.URL Extensions []Extension Modules *goja.Object Precompile PrecompileFunc CreateResolver CreateResolverFunc OnChanged OnChangedFunc Log logging.Logger Lock sync.Mutex // contains filtered or unexported fields }
func NewEnvironment ¶ added in v0.1.32
func NewEnvironment(urlContext *urlpkg.Context, path []urlpkg.URL) *Environment
func (*Environment) AddModule ¶ added in v0.1.33
func (self *Environment) AddModule(url urlpkg.URL, module *Module)
func (*Environment) Call ¶ added in v0.1.39
func (self *Environment) Call(function JavaScriptFunc, arguments ...any) any
func (*Environment) ClearCache ¶ added in v0.1.37
func (self *Environment) ClearCache()
func (*Environment) NewChild ¶ added in v0.1.39
func (self *Environment) NewChild() *Environment
func (*Environment) NewContext ¶ added in v0.1.33
func (self *Environment) NewContext(url urlpkg.URL, parent *Context) *Context
func (*Environment) NewModule ¶ added in v0.1.33
func (self *Environment) NewModule() *Module
func (*Environment) Release ¶ added in v0.1.33
func (self *Environment) Release() error
func (*Environment) RequireID ¶ added in v0.1.33
func (self *Environment) RequireID(id string) (*goja.Object, error)
func (*Environment) RequireURL ¶ added in v0.1.32
func (*Environment) RestartWatcher ¶ added in v0.1.41
func (self *Environment) RestartWatcher() error
func (*Environment) StopWatcher ¶ added in v0.1.41
func (self *Environment) StopWatcher() error
func (*Environment) Watch ¶ added in v0.1.33
func (self *Environment) Watch(path string) error
type Extension ¶ added in v0.1.32
type Extension struct { Name string Create CreateExtensionFunc }
type FileAPI ¶ added in v0.1.31
type FileAPI struct {
// contains filtered or unexported fields
}
func NewFileAPI ¶ added in v0.1.32
func (FileAPI) JoinFilePath ¶ added in v0.1.32
func (FileAPI) TemporaryDirectory ¶ added in v0.1.31
type FormatAPI ¶ added in v0.1.31
type FormatAPI struct{}
func (FormatAPI) BytesToString ¶ added in v0.1.31
Another way to achieve this in JavaScript: String.fromCharCode.apply(null, bytes)
func (FormatAPI) NewXMLDocument ¶ added in v0.1.31
func (FormatAPI) StringToBytes ¶ added in v0.1.31
type JavaScriptFunc ¶ added in v0.1.39
type JavaScriptFunc = func(goja.FunctionCall) goja.Value
type OnChangedFunc ¶ added in v0.1.33
type PrecompileFunc ¶ added in v0.1.32
type ThreadSafeObject ¶ added in v0.1.32
type ThreadSafeObject struct {
// contains filtered or unexported fields
}
func NewThreadSafeObject ¶ added in v0.1.32
func NewThreadSafeObject() *ThreadSafeObject
func (*ThreadSafeObject) Delete ¶ added in v0.1.32
func (self *ThreadSafeObject) Delete(key string) bool
goja.DynamicObject interface
func (*ThreadSafeObject) Get ¶ added in v0.1.32
func (self *ThreadSafeObject) Get(key string) goja.Value
goja.DynamicObject interface
func (*ThreadSafeObject) Has ¶ added in v0.1.32
func (self *ThreadSafeObject) Has(key string) bool
goja.DynamicObject interface
func (*ThreadSafeObject) Keys ¶ added in v0.1.32
func (self *ThreadSafeObject) Keys() []string
goja.DynamicObject interface
func (*ThreadSafeObject) NewDynamicObject ¶ added in v0.1.32
func (self *ThreadSafeObject) NewDynamicObject(runtime *goja.Runtime) *goja.Object
Click to show internal directories.
Click to hide internal directories.