v8

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DELETE_DALAY_TIME = 2 * time.Minute
	V8_REQ_TIMEOUT    = 8 // seconds
	V8_EXIT_THRESHOLD = 1000
)
View Source
const (
	MSGTYPE_PRINT_DEBUG   = 0
	MSGTYPE_PRINT_INFO    = 1
	MSGTYPE_PRINT_WARN    = 2
	MSGTYPE_PRINT_ERROR   = 3
	MSGTYPE_REQUIRE       = 10
	MSGTYPE_HTTP          = 11
	MSGTYPE_HTTP_CALLBACK = 20

	MSGTYPE_SSR_HTML_OK   = 80
	MSGTYPE_SSR_HTML_FAIL = 81
	MSGTYPE_SSR_CSS       = 82
	MSGTYPE_SSR_META      = 83

	MSGTYPE_SET_URL = 101
)

Variables

This section is empty.

Functions

func IsDevEnvironment

func IsDevEnvironment(env string) bool

func NewXmlHttpRequestMgr

func NewXmlHttpRequestMgr(maxCount int, internalApiHost string, internalApiIp string, internalApiPort int32) *xmlHttpRequestMgr

Types

type V8Mgr

type V8Mgr struct {
	SendCallback V8SendCallback
	// contains filtered or unexported fields
}
var TheV8Mgr *V8Mgr

func NewV8Mgr

func NewV8Mgr(c *V8MgrConfig) (*V8Mgr, error)

func (*V8Mgr) Execute

func (this *V8Mgr) Execute(name string, code string) (error, bool)

func (*V8Mgr) GetInternelApiUrl

func (this *V8Mgr) GetInternelApiUrl() string

type V8MgrConfig

type V8MgrConfig struct {
	Env             string
	JsPaths         []string
	MaxWorkerCount  int32
	WorkerLifeTime  int
	InternalApiHost string
	InternalApiIp   string
	InternalApiPort int32
	SendCallback    V8SendCallback
}

type V8SendCallback

type V8SendCallback func(msgType int, msg string, userdata int64)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL