plugin

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCoreFunctions added in v0.3.0

func RegisterCoreFunctions(rule javascript.JSEnabledRuleFunction)

Types

type FunctionHook

type FunctionHook func(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

type FunctionSchema

type FunctionSchema func() model.RuleFunctionSchema

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func CreatePluginManager added in v0.0.19

func CreatePluginManager() *Manager

func LoadFunctions

func LoadFunctions(path string, silence bool) (*Manager, error)

LoadFunctions will load custom functions found in the supplied path

func (*Manager) GetCustomFunctions

func (pm *Manager) GetCustomFunctions() map[string]model.RuleFunction

func (*Manager) LoadedFunctionCount

func (pm *Manager) LoadedFunctionCount() int

LoadedFunctionCount returns the number of available and ready to use functions.

func (*Manager) RegisterFunction

func (pm *Manager) RegisterFunction(name string, ruleFunction model.RuleFunction)

RegisterFunction allows a custom function to be hooked in

Directories

Path Synopsis
eventloop
Package eventloop provides an event loop implementation for running asynchronous JavaScript code with Goja.
Package eventloop provides an event loop implementation for running asynchronous JavaScript code with Goja.
eventloop/fetch
Package fetch provides a Web Fetch API compliant implementation for use with Goja JavaScript runtime and the vacuum event loop.
Package fetch provides a Web Fetch API compliant implementation for use with Goja JavaScript runtime and the vacuum event loop.

Jump to

Keyboard shortcuts

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