Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
Rules RuleRepository
}
func NewHandler ¶
func NewHandler() *Handler
func (*Handler) AddRules ¶
func (h *Handler) AddRules(rules RuleRepository)
func (*Handler) RemoveRule ¶
type Rule ¶
type Rule struct { Id int `json:"id"` Setup string `json:"setup,omitempty"` When string `json:"when"` Then string `json:"then"` }
Rules will have when-then structure. Rule execution should be decoupled. When a rule is executed, it won't have a link to the next rule. It will be applied to all the applicable rules. When and Then clauses will be P* code.
type RuleRepository ¶
type RuleRepository []Rule
func (*RuleRepository) ToString ¶
func (r *RuleRepository) ToString() string
Build a rule file from a rule repository:
Setup: def AnInt: {sint64 i} def AFloat: {fp32 f} When: when (Numbers numbers): return Then: then (Numbers numbers): return
Click to show internal directories.
Click to hide internal directories.