pattern

package
v0.24.4-1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package pattern provides tools for creating and executing functions with guards. See also: https://github.com/ionous/iffy/wiki/Patterns

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetResultField

func GetResultField(run rt.Runtime, k *g.Kind) (ret int, err error)

Types

type Category

type Category int
const (
	Initializes Category // some sort of record
	Calls                // some sort of callable pattern
	Sends                // some sort of pattern action
	Listens
)

func Categorize

func Categorize(path []string) (ret Category)

meta.KindAncestry

func (Category) String

func (i Category) String() string

type Result

type Result struct {
	// contains filtered or unexported fields
}

func (*Result) GetResult

func (res *Result) GetResult(run rt.Runtime, aff affine.Affinity) (ret g.Value, err error)

type RuleSet

type RuleSet struct {
	// contains filtered or unexported fields
}

func (*RuleSet) AddRule

func (rs *RuleSet) AddRule(rule rt.Rule)

func (*RuleSet) Call

func (rs *RuleSet) Call(run rt.Runtime, rec *g.Record, resultField int) (res Result, err error)

assumes rec is already in scope and initialized

func (*RuleSet) Send

func (rs *RuleSet) Send(run rt.Runtime, evtObj *g.Record, chain []string) (okay bool, err error)

trigger a pattern for each of the targets in the passed chain. return false if stopped

Jump to

Keyboard shortcuts

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