Documentation
¶
Index ¶
- func CreateRef(file string) string
- func LoadMappersConfig(data []byte) (map[string][]model.MapperConfig, error)
- func NewAppendFile(file string, ref string) flow.MapFunction[map[string]interface{}, map[string]interface{}]
- func NewDebug(config string) flow.MapFunction[map[string]interface{}, map[string]interface{}]
- func NewEnricherMap(name string, enricher model.EnricherConfig, ...) streams.Flow
- func NewPureHbs[T any, R any](rule string) flow.MapFunction[T, R]
- func NewStarlark(rule string) flow.MapFunction[map[string]interface{}, map[string]interface{}]
- func NewStarlet(rule string) (flow.MapFunction[map[string]interface{}, map[string]interface{}], error)
- func NewVisual(enricher *model.Enricher, enricherCommon *model.EnricherCommonConfig) flow.MapFunction[map[string]interface{}, map[string]interface{}]
- func NewYaegi(rule string) flow.MapFunction[map[string]interface{}, map[string]interface{}]
- func ToMap(data any) map[string]interface{}
- func ToUnWrappedResult(name string) func(result WrappedResult) model.PharosScanResult
- func Wrap(fn flow.MapFunction[map[string]interface{}, map[string]interface{}]) flow.MapFunction[WrappedResult, WrappedResult]
- type Header
- type Policy
- type WrappedResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadMappersConfig ¶
func LoadMappersConfig(data []byte) (map[string][]model.MapperConfig, error)
LoadMappersConfig reads a YAML file from the given path and returns a slice of MapperConfig. The YAML file can either contain a direct list of mappers or a map with a key (e.g., "results") that contains a list of mappers with name and config properties.
func NewAppendFile ¶
func NewAppendFile(file string, ref string) flow.MapFunction[map[string]interface{}, map[string]interface{}]
Creates appender by reading file on creation moment.
func NewDebug ¶
func NewDebug(config string) flow.MapFunction[map[string]interface{}, map[string]interface{}]
func NewEnricherMap ¶
func NewEnricherMap(name string, enricher model.EnricherConfig, enricherCommon *model.EnricherCommonConfig) streams.Flow
func NewPureHbs ¶
func NewPureHbs[T any, R any](rule string) flow.MapFunction[T, R]
func NewStarlark ¶
func NewStarlark(rule string) flow.MapFunction[map[string]interface{}, map[string]interface{}]
func NewStarlet ¶
func NewVisual ¶
func NewVisual(enricher *model.Enricher, enricherCommon *model.EnricherCommonConfig) flow.MapFunction[map[string]interface{}, map[string]interface{}]
func NewYaegi ¶
func NewYaegi(rule string) flow.MapFunction[map[string]interface{}, map[string]interface{}]
func ToUnWrappedResult ¶
func ToUnWrappedResult(name string) func(result WrappedResult) model.PharosScanResult
func Wrap ¶
func Wrap(fn flow.MapFunction[map[string]interface{}, map[string]interface{}]) flow.MapFunction[WrappedResult, WrappedResult]
Types ¶
type Policy ¶
type Policy[T any] struct { // contains filtered or unexported fields }
Policy represents a policy loaded from an HBS template file.
type WrappedResult ¶
type WrappedResult struct {
Context map[string]interface{}
Result model.PharosScanResult
}
For mappers simplicity origin input might be lost. Wrapper preservers origin scan result and modifies only Context This allows to store only last context in result
func ToWrappedResult ¶
func ToWrappedResult(result model.PharosScanResult) WrappedResult
Click to show internal directories.
Click to hide internal directories.