metadata

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: BSD-2-Clause Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FunctionMD = Metadata{
	Functions:           make(map[string]interfaces.Function),
	Descriptions:        make(map[string]types.FunctionDescription),
	DescriptionsGrouped: make(map[string]map[string]types.FunctionDescription),
	FunctionConfigFiles: make(map[string]string),
}

TODO (grzkv) Remove from global scope. This blocks testability FunctionMD is actual global variable that stores metadata

Functions

func GetEvaluator

func GetEvaluator() interfaces.Evaluator

GetEvaluator returns evaluator

func RegisterFunction

func RegisterFunction(name string, function interfaces.Function, logger *zap.Logger)

RegisterFunction registers function in metadata and fills out all Description structs

func SetEvaluator

func SetEvaluator(evaluator interfaces.Evaluator)

SetEvaluator sets new evaluator function to be default for everything that needs it

Types

type Metadata

type Metadata struct {
	sync.RWMutex

	Functions           map[string]interfaces.Function
	Descriptions        map[string]types.FunctionDescription
	DescriptionsGrouped map[string]map[string]types.FunctionDescription
	FunctionConfigFiles map[string]string
	// contains filtered or unexported fields
}

Metadata is a type to store global function metadata

Jump to

Keyboard shortcuts

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