gots

package module
v0.0.0-...-19632fd Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertJsUint8ArrayToByteSlice

func ConvertJsUint8ArrayToByteSlice(uint8ArrObj *v8go.Object) []byte

func GetAbsPath

func GetAbsPath(filename string) (string, error)

func ReadFile

func ReadFile(name string) ([]byte, error)

ReadFile reads the named file and returns the contents. A successful call returns err == nil, not err == EOF. Because ReadFile reads the whole file, it does not treat an EOF from Read as an error to be reported.

func WriteFile

func WriteFile(name string, data []byte, perm os.FileMode) error

WriteFile writes data to the named file, creating it if necessary. If the file does not exist, WriteFile creates it with permissions perm (before umask); otherwise WriteFile truncates it before writing, without changing permissions.

Types

type PackageConfig

type PackageConfig struct {
	Main string `json:"main"`
}

type ScriptPreProcessor

type ScriptPreProcessor func(string, string) string

type TsEnv

type TsEnv struct {
	Iso         *v8go.Isolate
	Ctx         *v8go.Context
	TsModuleDir string

	PreLoadFiles []string
	Trace        bool
	// contains filtered or unexported fields
}

func NewTsEnv

func NewTsEnv(tsModuleDir string) *TsEnv

func (*TsEnv) CreateEmptyObject

func (t *TsEnv) CreateEmptyObject() (*v8go.Object, error)

func (*TsEnv) Destroy

func (t *TsEnv) Destroy()

func (*TsEnv) Init

func (t *TsEnv) Init(waitDebugger bool, debugEnable bool, debugPort uint32) error

func (*TsEnv) Print

func (t *TsEnv) Print(in string, args ...interface{})

func (*TsEnv) RunScriptWithWrapperByPath

func (t *TsEnv) RunScriptWithWrapperByPath(fileName string, preprocessor ScriptPreProcessor) (*v8go.Value, error)

func (*TsEnv) RunScriptWithWrapperByScript

func (t *TsEnv) RunScriptWithWrapperByScript(fullPath string, preprocessor ScriptPreProcessor, script string, needResult bool) (*v8go.Value, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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