index

package
v0.0.0-...-bfa67a7 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(templateID string, parameters rule.Parameters) (rule.Evaluator, error)

Get rule evaluator with the provided template ID

func Register

func Register(meta *Metadata, factory rule.Factory, validator ...rule.Validator)

Register the rule evaluator with the corresponding rule template

func Valid

func Valid(templateID string, parameters rule.Parameters) error

Valid ...

Types

type IndexedParam

type IndexedParam struct {
	Name string `json:"name"`

	// Type of the param
	// "int", "string" or "[]string"
	Type string `json:"type"`

	Unit string `json:"unit"`

	Required bool `json:"required"`
}

IndexedParam declares the param info

type Metadata

type Metadata struct {
	TemplateID string `json:"rule_template"`

	// Action of the rule performs
	// "retain"
	Action string `json:"action"`

	Parameters []*IndexedParam `json:"params"`
}

Metadata defines metadata for rule registration

func Index

func Index() []*Metadata

Index returns all the metadata of the registered rules

Jump to

Keyboard shortcuts

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