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 exturl.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 exturl.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 exturl.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 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 TranscribeAPI
- func (self TranscribeAPI) Atob(b64 string) ([]byte, error)
- func (self TranscribeAPI) Btoa(bytes []byte) string
- func (self TranscribeAPI) BytesToString(bytes []byte) string
- func (self TranscribeAPI) Decode(code []byte, format string, all bool) (ard.Value, error)
- func (self TranscribeAPI) Encode(value any, format string, indent string, writer io.Writer) (string, error)
- func (self TranscribeAPI) NewXMLDocument() *etree.Document
- func (self TranscribeAPI) StringToBytes(string_ string) []byte
- func (self TranscribeAPI) ValidateFormat(code []byte, format string) error
- 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) Printf(format string, args ...any)
- func (self UtilAPI) Sprintf(format string, args ...any) string
Constants ¶
This section is empty.
Variables ¶
View Source
var DromedaryCaseMapper dromedaryCaseMapper
Functions ¶
func CreateEarlyBindExtension ¶
CreateExtensionFunc signature
func CreateLateBindExtension ¶
CreateExtensionFunc signature
Types ¶
type Context ¶
type Context struct { Environment *Environment Parent *Context Module *Module Resolve ResolveFunc Extensions []goja.Value }
type CreateExtensionFunc ¶
type CreateResolverFunc ¶
type CreateResolverFunc func(url exturl.URL, context *Context) ResolveFunc
type Environment ¶
type Environment struct { Runtime *goja.Runtime URLContext *exturl.Context Path []exturl.URL Extensions []Extension Modules *goja.Object Precompile PrecompileFunc CreateResolver CreateResolverFunc OnChanged OnChangedFunc Log commonlog.Logger Lock sync.Mutex // contains filtered or unexported fields }
func NewEnvironment ¶
func NewEnvironment(urlContext *exturl.Context, path []exturl.URL) *Environment
func (*Environment) Call ¶
func (self *Environment) Call(function JavaScriptFunc, arguments ...any) any
func (*Environment) ClearCache ¶
func (self *Environment) ClearCache()
func (*Environment) NewChild ¶
func (self *Environment) NewChild() *Environment
func (*Environment) NewContext ¶
func (self *Environment) NewContext(url exturl.URL, parent *Context) *Context
func (*Environment) NewModule ¶
func (self *Environment) NewModule() *Module
func (*Environment) Release ¶
func (self *Environment) Release() error
func (*Environment) RequireURL ¶
func (*Environment) RestartWatcher ¶
func (self *Environment) RestartWatcher() error
func (*Environment) StopWatcher ¶
func (self *Environment) StopWatcher() error
func (*Environment) Watch ¶
func (self *Environment) Watch(path string) error
type Extension ¶
type Extension struct { Name string Create CreateExtensionFunc }
type FileAPI ¶
type FileAPI struct {
// contains filtered or unexported fields
}
func NewFileAPI ¶
func (FileAPI) JoinFilePath ¶
func (FileAPI) TemporaryDirectory ¶
type JavaScriptFunc ¶
type JavaScriptFunc = func(goja.FunctionCall) goja.Value
type OnChangedFunc ¶
type PrecompileFunc ¶
type ThreadSafeObject ¶
type ThreadSafeObject struct {
// contains filtered or unexported fields
}
func NewThreadSafeObject ¶
func NewThreadSafeObject() *ThreadSafeObject
func (*ThreadSafeObject) Delete ¶
func (self *ThreadSafeObject) Delete(key string) bool
goja.DynamicObject interface
func (*ThreadSafeObject) Get ¶
func (self *ThreadSafeObject) Get(key string) goja.Value
goja.DynamicObject interface
func (*ThreadSafeObject) Has ¶
func (self *ThreadSafeObject) Has(key string) bool
goja.DynamicObject interface
func (*ThreadSafeObject) Keys ¶
func (self *ThreadSafeObject) Keys() []string
goja.DynamicObject interface
func (*ThreadSafeObject) NewDynamicObject ¶
func (self *ThreadSafeObject) NewDynamicObject(runtime *goja.Runtime) *goja.Object
type TranscribeAPI ¶
type TranscribeAPI struct{}
func (TranscribeAPI) Atob ¶
func (self TranscribeAPI) Atob(b64 string) ([]byte, error)
Decode base64 to bytes
func (TranscribeAPI) Btoa ¶
func (self TranscribeAPI) Btoa(bytes []byte) string
Encode bytes as base64
func (TranscribeAPI) BytesToString ¶
func (self TranscribeAPI) BytesToString(bytes []byte) string
Another way to achieve this in JavaScript: String.fromCharCode.apply(null, bytes)
func (TranscribeAPI) Decode ¶
func (self TranscribeAPI) Decode(code []byte, format string, all bool) (ard.Value, error)
func (TranscribeAPI) NewXMLDocument ¶
func (self TranscribeAPI) NewXMLDocument() *etree.Document
func (TranscribeAPI) StringToBytes ¶
func (self TranscribeAPI) StringToBytes(string_ string) []byte
func (TranscribeAPI) ValidateFormat ¶
func (self TranscribeAPI) ValidateFormat(code []byte, format string) error
Click to show internal directories.
Click to hide internal directories.