vm

package
v0.8.62-canary Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const HttpRequestTimeoutSecond = 5

Variables

This section is empty.

Functions

func ArgumentListToString

func ArgumentListToString(args []otto.Value) (text string)

func CopyFile

func CopyFile(src string, dst string) error

func Delete

func Delete(key int64)

func FormatJobTag

func FormatJobTag(tag string) string

func GetJobScheduler

func GetJobScheduler() *gocron.Scheduler

func Init

func Init()

func Len

func Len() uint

func Range

func Range(f func(key, value interface{}) bool)

func RecieveLogChannel

func RecieveLogChannel()

func SendLog

func SendLog(scriptIndex int64, msg string)

func SendLogError

func SendLogError(scriptIndex int64, msg string)

func Set

func Set(key int64, v *VM)

func SetEnv

func SetEnv(c map[string]interface{})

Types

type Log

type Log struct {
	Script    int64     `json:"script"`
	Suffix    string    `json:"suffix"`
	Text      string    `json:"text"`
	Timestamp time.Time `json:"timestamp"`
}

type LogState

type LogState struct {
	Sockets []*websocket.Conn
	Channel chan *Log
	sync.Mutex
}
var LogGlobal *LogState

type VM

type VM struct {
	Otto *otto.Otto
	Code string
	Jobs map[string]*gocron.Job
	sync.Mutex
}

func Create

func Create(key int64, code string, node string, ip string, hooks api.HookCaller) (*VM, error)

func Get

func Get(key int64) (*VM, bool)

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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