Documentation
¶
Index ¶
- func RegisterCoreFunctions(rule javascript.JSEnabledRuleFunction)
- type FunctionHook
- type FunctionLoadError
- type FunctionSchema
- type Manager
- func (pm *Manager) GetAutoFixFunctions() map[string]model.AutoFixFunction
- func (pm *Manager) GetCustomFunctions() map[string]model.RuleFunction
- func (pm *Manager) LoadedFunctionCount() int
- func (pm *Manager) RegisterAutoFixFunction(name string, function model.AutoFixFunction)
- func (pm *Manager) RegisterFunction(name string, ruleFunction model.RuleFunction)
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 FunctionLoadError ¶ added in v0.34.0
FunctionLoadError retains the function and source that failed to load.
func (*FunctionLoadError) Error ¶ added in v0.34.0
func (e *FunctionLoadError) Error() string
func (*FunctionLoadError) Unwrap ¶ added in v0.34.0
func (e *FunctionLoadError) Unwrap() error
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 ¶
LoadFunctions will load custom functions found in the supplied path
func LoadFunctionsStrict ¶ added in v0.34.0
LoadFunctionsStrict loads functions for verification. JavaScript metadata uses timeout and malformed schemas or scripts fail the entire load.
func (*Manager) GetAutoFixFunctions ¶ added in v0.34.0
func (pm *Manager) GetAutoFixFunctions() map[string]model.AutoFixFunction
GetAutoFixFunctions returns repairs registered by a Go plugin's Boot function.
func (*Manager) GetCustomFunctions ¶
func (pm *Manager) GetCustomFunctions() map[string]model.RuleFunction
func (*Manager) LoadedFunctionCount ¶
LoadedFunctionCount returns the number of available and ready to use functions.
func (*Manager) RegisterAutoFixFunction ¶ added in v0.34.0
func (pm *Manager) RegisterAutoFixFunction(name string, function model.AutoFixFunction)
RegisterAutoFixFunction registers a named repair for rules using autoFixFunction. Repairs are available to lint --fix and the test harness.
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. |
Click to show internal directories.
Click to hide internal directories.