vm

package
v0.8.59 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: GPL-3.0 Imports: 39 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 BuildCustomPacketInfo

func BuildCustomPacketInfo(packet gopacket.Packet, fragmented bool) (info map[string]interface{}, err error)

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 IsMissingHookError

func IsMissingHookError(err error, hook string) bool

func ItemCapturedHook

func ItemCapturedHook(entry *api.Entry)

Hook: onItemCaptured, does not accept returns

func ItemQueriedHook

func ItemQueriedHook(entry *api.Entry) *api.Entry

Hook: onItemQueried, accepts Object type returns

func JobFailedHook

func JobFailedHook(tag string, cron string, limit int64, err string)

Hook: onJobFailed, does not accept returns

func JobPassedHook

func JobPassedHook(tag string, cron string, limit int64)

Hook: onJobPassed, does not accept returns

func Len

func Len() uint

func MarshalUnmarshalEntry

func MarshalUnmarshalEntry(entry *api.Entry) (result map[string]interface{}, err error)

func MarshalUnmarshalEntryReverse

func MarshalUnmarshalEntryReverse(result map[string]interface{}) (entry *api.Entry, err error)

func PacketCapturedHook

func PacketCapturedHook(packet gopacket.Packet, fragmented bool)

Hook: onPacketCaptured, does not accept returns

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 CustomPacketInfo

type CustomPacketInfo struct {
	Timestamp     time.Time `json:"timestamp"`
	CaptureLength int       `json:"captureLength"`
	Length        int       `json:"length"`
	Truncated     bool      `json:"truncated"`
	Fragmented    bool      `json:"fragmented"`
}

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) (*VM, error)

func Get

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

Jump to

Keyboard shortcuts

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