Documentation ¶
Index ¶
- Variables
- type DataContext
- func (ctx *DataContext) Add(key string, obj interface{}) error
- func (ctx *DataContext) ExecMethod(methodName string, args []reflect.Value) (reflect.Value, error)
- func (ctx *DataContext) GetType(variable string) (reflect.Type, error)
- func (ctx *DataContext) GetValue(variable string) (reflect.Value, error)
- func (ctx *DataContext) IsRestracted(key string) bool
- func (ctx *DataContext) Reset()
- func (ctx *DataContext) Retract(key string)
- func (ctx *DataContext) SetValue(variable string, newValue reflect.Value) error
- type KnowledgeContext
- type RuleContext
Constants ¶
This section is empty.
Variables ¶
var ( FactNotFoundError = errors.New("Fact not found") FactRetractedError = errors.New("Fact is retracted") )
Functions ¶
This section is empty.
Types ¶
type DataContext ¶
type DataContext struct { ObjectStore map[string]interface{} Retracted []string VariableChangeCount uint64 }
DataContext holds all structs instance to be used in rule execution environment.
func NewDataContext ¶
func NewDataContext() *DataContext
NewDataContext will create a new DataContext instance
func (*DataContext) Add ¶
func (ctx *DataContext) Add(key string, obj interface{}) error
Add will add struct instance into rule execution context
func (*DataContext) ExecMethod ¶
ExecMethod will execute instance member variable using the supplied arguments.
func (*DataContext) GetType ¶
func (ctx *DataContext) GetType(variable string) (reflect.Type, error)
GetType will extract type information of data in this context.
func (*DataContext) GetValue ¶
func (ctx *DataContext) GetValue(variable string) (reflect.Value, error)
GetValue will get member variables Value information. Used by the rule execution to obtain variable value.
func (*DataContext) IsRestracted ¶
func (ctx *DataContext) IsRestracted(key string) bool
IsRestracted checks if a key fact is currently retracted.
func (*DataContext) Reset ¶
func (ctx *DataContext) Reset()
Reset will un-retract all fact, making them available for evaluation and modification.
func (*DataContext) Retract ¶
func (ctx *DataContext) Retract(key string)
Retract temporary retract a fact from data context, making it unavailable for evaluation or modification.
type KnowledgeContext ¶
type KnowledgeContext struct { }
type RuleContext ¶
type RuleContext struct { }