func replExecuteAction(r render.Render, manager *script.ScriptManager, request *http.Request) { code := request.FormValue("script") sType := script.ScriptType(request.FormValue("scriptType")) res, err := manager.RunUnsafe(sType, code) var errStr interface{} if err != nil { errStr = err.Error() } r.JSON(200, map[string]interface{}{ "res": res, "err": errStr, }) }
func scriptReinitAction(r render.Render, mgr *script.ScriptManager) { mgr.ReInit() r.JSON(200, nil) }