ast

package
v0.0.0-...-3bc489b Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mapify

func Mapify(s interface{}) map[string]interface{}

Convert struct to map. Can be used to generate a identifier (which has to be of type map[string]interface{}) from a struct.

Types

type Condition

type Condition struct {
	Any []Conditional `json:"any"`
	All []Conditional `json:"all"`
}

A Condition is a group of conditionals within a binding context that determines how the group will be evaluated.

type Conditional

type Conditional struct {
	Fact     string      `json:"identifier"`
	Operator string      `json:"operator"`
	Value    interface{} `json:"value"`
}

Conditionals are the basic units of rules

type Event

type Event struct {
	Type    string      `json:"type"`
	Payload interface{} `json:"payload"`
}

Fired when a identifier matches a rule

type Rule

type Rule struct {
	Condition Condition `json:"condition"`
	Event     Event     `json:"event"`
}

func ParseJSON

func ParseJSON(j string) *Rule

parse JSON string as Rule

Jump to

Keyboard shortcuts

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