Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertAgoToUnix(date string) (time.Time, error)
- func ConvertStrToUnix(str string) (time.Time, error)
- func GenerateGetConfigWithRule(rule []byte) string
- func GetCtxWithJS(basejs string) (*v8.Context, error)
- func RunCode(base string, export string) (string, error)
- func RunCodeInSandbox(ctx *v8.Context, unsafe string, fileName string) (*v8.Value, time.Duration, error)
Constants ¶
View Source
const CSR_NO_OP_ALERT = `window.alert = () => {};window.prompt = () => {}`
View Source
const TPL_MIX_JS = `()=> document.documentElement.innerHTML`
MIX mode
Variables ¶
View Source
var FILE_DATE_JS string
View Source
var FILE_HEP_JS string
View Source
var FILE_MOMENT_JS string
View Source
var FILE_SDK string
View Source
var FILE_SHIM_CSR string
View Source
var FILE_SHIM_SSR string
View Source
var GenerateCSRInjectParser = func(app []byte) string { return fmt.Sprintf("()=> (function(window){\n%s;\nvar potted = new POTTED();\n%s;\npotted.GetData();return potted.value;})(window)", TPL_CSR_JS, app) }
mix csr sdk and csr app for cdp client
View Source
var GenerateInspector = func(app []byte) string { return fmt.Sprintf("<script>%s;\n%s;\n</script>", FILE_HEP_JS, app) }
mix hep.js and inspector js for inspector page
View Source
var TPL_CSR_JS = func() string { return fmt.Sprintf("%s\n%s", FILE_SHIM_CSR, FILE_SDK) }()
combine sdk and csr shim for CSR
View Source
var TPL_DATE_JS = func() string { return fmt.Sprintf("%s\n%s", FILE_MOMENT_JS, FILE_DATE_JS) }()
combine moment.js with date functions
View Source
var TPL_SSR_JS = func() string { return fmt.Sprintf("%s\n%s", FILE_SHIM_SSR, FILE_SDK) }()
combine sdk and ssr shim for SSR
Functions ¶
func GenerateGetConfigWithRule ¶
mix rule with template, generate get config function for RSS Can
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.