{"modulePath":"github.com/progpjs/progpAPI","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package progpAPI\n\n## Functions\n\n```go\nfunc CatchFatalErrors()\n```\n\n```go\nfunc ConfigRegisterScriptEngineBuilder(engineName string, builder ScriptEngineBuilder)\n```\n\n```go\nfunc DeclareBackgroundTaskEnded()\n```\n\n```go\nfunc DeclareBackgroundTaskStarted()\n```\n\n```go\nfunc DynamicCallFunction(toCall any, callArgs []reflect.Value) (result []reflect.Value, errorMsg string)\n```\n\n```go\nfunc EndOfAllBackgroundTasks()\n```\n\n```go\nfunc ExecuteScriptContent(scriptContent, scriptOrigin string, scriptEngine ScriptEngine)\n```\n\n```go\nfunc ForEachScriptEngine(f func(engine ScriptEngine))\n```\n\n```go\nfunc ForceExitingVM()\n```\nForceExitingVM allows stopping the process without doing an os.exit. It's a requirement if profiling the memory, since without that, the log file isn't correctly flushed.\n\n```go\nfunc GoStringToQuotedString2(value string) string\n```\n\n```go\nfunc LogScriptError(error *ScriptErrorMessage)\n```\n\n```go\nfunc OnUnCatchScriptError(error *ScriptErrorMessage)\n```\n\n```go\nfunc PauseMs(timeInMs int)\n```\n\n```go\nfunc ReflectValueToAny(resV reflect.Value) any\n```\n\n```go\nfunc SafeGoRoutine(f func())\n```\n\n```go\nfunc SetErrorTranslator(handler ErrorTranslatorF)\n```\n\n## Types\n\n```go\ntype DisposeSharedResourceF func(value any)\n```\n\n```go\ntype EmbeddedFile struct {\n\tFS        embed.FS\n\tInnerPath string\n}\n```\n\n```go\nfunc (m *EmbeddedFile) Read() ([]byte, error)\n```\n\n```go\ntype ErrorTranslatorF func(error *ScriptErrorMessage)\n```\n\n```go\ntype FunctionGroup struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (m *FunctionGroup) AddAsyncFunction(jsName string, goFunctionName string, jsFunction any)\n```\n\n```go\nfunc (m *FunctionGroup) AddFunction(javascriptName string, goFunctionName string, goFunctionRef any)\n```\n\n```go\ntype FunctionModule struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (m *FunctionModule) AddAsyncFunction(jsName string, goFunctionName string, jsFunction any)\n```\nAddAsyncFunction add an async function to a javascript group which name is the name of the go namespace last part.\n\n```go\nfunc (m *FunctionModule) AddFunction(javascriptName string, goFunctionName string, goFunctionRef any)\n```\nAddFunction add a function to a javascript group which name is the name of the go namespace last part.\n\n```go\nfunc (m *FunctionModule) DeclareNodeModule(embedded embed.FS, embeddedDirPath string, modName string)\n```\n\n```go\nfunc (m *FunctionModule) GetFunctionRegistry() *FunctionRegistry\n```\n\n```go\nfunc (m *FunctionModule) ModName() string\n```\n\n```go\nfunc (m *FunctionModule) UseCustomGroup(jsGroupName string) *FunctionGroup\n```\nUseCustomGroup allows using another javascript group than the default group for this go namespace.\n\n```go\nfunc (m *FunctionModule) UseGroupGlobal() *FunctionGroup\n```\nUseGroupGlobal allows using the global group where functionsArray directly accessible to javascript scripts without importing them.\n\n```go\ntype FunctionRegistry struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc GetFunctionRegistry() *FunctionRegistry\n```\n\n```go\nfunc (m *FunctionRegistry) EnableDynamicMode(enabled bool)\n```\n\n```go\nfunc (m *FunctionRegistry) GetAllFunctions(sortList bool) []*RegisteredFunction\n```\n\n```go\nfunc (m *FunctionRegistry) GetEmbeddedModulesTSX() map[string]EmbeddedFile\n```\n\n```go\nfunc (m *FunctionRegistry) GetNamespaces() map[string]bool\n```\n\n```go\nfunc (m *FunctionRegistry) GetRefToFunction(jsFunctionName string) *RegisteredFunction\n```\n\n```go\nfunc (m *FunctionRegistry) IsUsingDynamicMode() bool\n```\n\n```go\nfunc (m *FunctionRegistry) UseGoNamespace(goNamespace string) *FunctionModule\n```\n\n```go\ntype ParsedGoFunction struct {\n\tGeneratorUniqName string\n\tGoFunctionName    string\n\n\tParamTypes          []string\n\tParamTypeRefs       []reflect.Type\n\tCallParamNamespaces []string\n\n\tReturnType        string\n\tReturnErrorOffset int\n\n\tJsFunctionName string\n\tJsGroupName    string\n}\n```\n\n```go\nfunc ParseGoFunction(fct *RegisteredFunction) (ParsedGoFunction, error)\n```\n\n```go\nfunc (m *ParsedGoFunction) GetGoFunctionName() string\n```\n\n```go\nfunc (m *ParsedGoFunction) GetJsFunctionName() string\n```\n\n```go\ntype RegisteredFunction struct {\n\tIsAsync            bool\n\tGroup              string\n\tJsFunctionName     string\n\tGoFunctionName     string\n\tGoFunctionFullName string\n\tGoFunctionRef      any\n\tGoFunctionInfos    ParsedGoFunction\n}\n```\n\n```go\ntype ScriptCallback func(error *ScriptErrorMessage)\n```\n\n```go\ntype ScriptEngine interface {\n\t// Start the engine, which is call one all is initialized in the Go side.\n\tStart()\n\n\t// GetEngineLanguage allows to know if it' a \"javascript\" engine or a \"python\" engine.\n\tGetEngineLanguage() string\n\n\t// GetEngineName the name of the underlying engine. For exemple \"progpv8\".\n\tGetEngineName() string\n\n\tWaitDebuggerReady()\n\n\t// GetInternalEngineVersion the version of the engine used internally.\n\t// For exemple if it's using Google V8, then return the v8 engine version.\n\tGetInternalEngineVersion() string\n\n\t// ExecuteScript execute a script by giving his content.\n\tExecuteScript(scriptContent string, compiledFilePath string) *ScriptErrorMessage\n\n\t// Shutdown stop the engine. He can't be used anymore after that.\n\t// It mainly occurs after a fatal error or at script ends.\n\tShutdown()\n\n\t// DisarmError remove the current error and allows continuing execution.\n\t// The error params allows to avoid case where a new error occurs since.\n\tDisarmError(error *ScriptErrorMessage)\n}\n```\n\n```go\nfunc GetScriptEngine(engineName string) ScriptEngine\n```\n\n```go\ntype ScriptEngineBuilder = func() ScriptEngine\n```\n\n```go\ntype ScriptErrorMessage struct {\n\tScriptEngine ScriptEngine\n\n\tError      string\n\tErrorLevel int\n\n\tStartColumn int\n\tEndColumn   int\n\n\tStartPosition int\n\tEndPosition   int\n\n\tSourceMapUrl string\n\tScriptPath   string\n\n\tStackTraceFrameCount int\n\tStackTraceFrames     []StackTraceFrame\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (m *ScriptErrorMessage) DisarmError()\n```\nDisarmError allows to continue after an un-catch error.\n\n```go\nfunc (m *ScriptErrorMessage) Print()\n```\n\n```go\nfunc (m *ScriptErrorMessage) StackTrace() string\n```\n\n```go\nfunc (m *ScriptErrorMessage) Translate()\n```\n\n```go\ntype ScriptExecResult struct {\n\tScriptError *ScriptErrorMessage\n\tGoError     error\n}\n```\n\n```go\nfunc (m *ScriptExecResult) HasError() bool\n```\n\n```go\nfunc (m *ScriptExecResult) PrintError() bool\n```\n\n```go\ntype ScriptFunction interface {\n\tCallWithArrayBuffer(buffer []byte)\n\tCallWithString(value string)\n\tCallWithStringBuffer(value []byte)\n\tCallWithDouble(value float64)\n\tCallWithUndefined()\n\tCallWithError(err error)\n\tCallWithBool(value bool)\n\tCallWithResource(value *SharedResource)\n\tKeepAlive()\n}\n```\n\n```go\ntype SharedResource struct {\n\tValue any\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc GetSharedResource(id int) *SharedResource\n```\n\n```go\nfunc NewSharedResource(value any, onDispose DisposeSharedResourceF) *SharedResource\n```\n\n```go\nfunc (m *SharedResource) Dispose()\n```\n\n```go\nfunc (m *SharedResource) GetId() int\n```\n\n```go\ntype StackTraceFrame struct {\n\tLine     int\n\tColumn   int\n\tFunction string\n\tSource   string\n}\n```\n\n```go\ntype StringBuffer []byte\n```\nStringBuffer allows the code generator to known that we want this bytes to be send as if it was a string. Allows to avoid the cost of converting \\[]byte to string before calling javascript.\n\n```go\ntype TaskQueue struct {\n\t// contains filtered or unexported fields\n}\n```\nTaskQueue allows executing the C++ calls from only one thread. Without that, Go can be short on available threads which lead to a crash.\n\nThis protection is only required where there is a lot of calls that can be blocked the thread. It's essentially when calling an event and calling a callback function.\n\n```go\nfunc NewTaskQueue() *TaskQueue\n```\n\n```go\nfunc (m *TaskQueue) Dispose()\n```\n\n```go\nfunc (m *TaskQueue) IsDisposed() bool\n```\n\n```go\nfunc (m *TaskQueue) Push(f func())\n```\n\n```go\ntype V8ScriptCallback func(result ScriptExecResult)\n```\n\n","path":"github.com/progpjs/progpAPI","name":"progpAPI","synopsis":"","isRedistributable":true}
