Documentation
¶
Index ¶
- func InjectIchubRuleCheck(s *RuleCheck)
- func LoadIchubRuleCheck() baseiface.ISingleton
- type RuleCheck
- type RuleDefineDto
- func (self *RuleDefineDto) Check() error
- func (self *RuleDefineDto) CheckParam() error
- func (self *RuleDefineDto) CheckRule() error
- func (self *RuleDefineDto) IfFunc() bool
- func (self RuleDefineDto) Param2String() string
- func (self RuleDefineDto) Result2String() string
- func (self *RuleDefineDto) RuleId2Name() *RuleDefineDto
- func (self *RuleDefineDto) ToLines() *strings.Builder
- func (self *RuleDefineDto) ToRule() string
- type RuleFileDto
- func (self *RuleFileDto) BuildFileName(suffix string) string
- func (self *RuleFileDto) CheckFileExist() bool
- func (self *RuleFileDto) ReadRuleFile() (string, error)
- func (self *RuleFileDto) ReadRuleParamFile() (string, error)
- func (self *RuleFileDto) ReadRuleParamFile2Map() (map[string]any, error)
- func (self *RuleFileDto) ReadRuleResultFile() (string, error)
- func (self *RuleFileDto) ReadRuleResultFile2Map() (map[string]any, error)
- type RuleFilePath
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InjectIchubRuleCheck ¶
func InjectIchubRuleCheck(s *RuleCheck)
func LoadIchubRuleCheck ¶
func LoadIchubRuleCheck() baseiface.ISingleton
Types ¶
type RuleCheck ¶
type RuleCheck struct {
basedto.BaseEntity
//函数
FuncSet *linkedhashset.Set
//参数对象
ObjSet *linkedhashset.Set
//变量
VarSet *linkedhashset.Set
FuncList *list.List `json:"-"`
ObjList *list.List `json:"-"`
VarList *list.List `json:"-"`
RuleNumber int
}
@Title 文件名称: rule_check.go @Description 描述: 规则引擎校验 @Author 作者: leijianming@163.com 时间(2024-02-18 22:38:21) @Update 作者: leijianming@163.com 时间(2024-02-18 22:38:21)
规则引擎校验 keyword: In Out
func FindBeanRuleCheck ¶
func FindBeanRuleCheck() *RuleCheck
func NewRuleCheck ¶
func NewRuleCheck() *RuleCheck
func (*RuleCheck) Check ¶
func (self *RuleCheck) Check(ruleDefine *RuleDefineDto) error
func (*RuleCheck) CheckIdName ¶
func (self *RuleCheck) CheckIdName(defineDto *RuleDefineDto) error
func (*RuleCheck) CheckParam ¶
func (*RuleCheck) CheckRuleLine ¶
check many ruleserver name dup
type RuleDefineDto ¶
type RuleDefineDto struct {
basedto.BaseEntity `json:"-"`
Domain string `json:"domain,omitempty"`
FuncId string `json:"func_id"`
FuncName string `json:"func_name"`
FuncType string `json:"func_type,omitempty"`
Description string `json:"description,omitempty"`
Rule []string `json:"rule,omitempty"`
Param map[string]any `json:"param"`
Result map[string]any `json:"result"`
//结果比对值
Expect []string `json:"expect,omitempty"`
//执行模式:0单一模式10串20并30混40逆50桶
Mode int `json:"mode"`
RuleCheck `json:"-"`
*basedata.DataPath `json:"-"`
}
func NewRuleDefineDto ¶
func NewRuleDefineDto() *RuleDefineDto
func (*RuleDefineDto) Check ¶
func (self *RuleDefineDto) Check() error
func (*RuleDefineDto) CheckParam ¶
func (self *RuleDefineDto) CheckParam() error
func (*RuleDefineDto) CheckRule ¶
func (self *RuleDefineDto) CheckRule() error
func (*RuleDefineDto) IfFunc ¶
func (self *RuleDefineDto) IfFunc() bool
func (RuleDefineDto) Param2String ¶
func (self RuleDefineDto) Param2String() string
func (RuleDefineDto) Result2String ¶
func (self RuleDefineDto) Result2String() string
func (*RuleDefineDto) RuleId2Name ¶
func (self *RuleDefineDto) RuleId2Name() *RuleDefineDto
func (*RuleDefineDto) ToLines ¶
func (self *RuleDefineDto) ToLines() *strings.Builder
func (self *RuleDefineDto) ListFunc(funcId string) (*RuleDefineDto, error) {
var define = NewRuleDefineDto()
define.FuncId = funcId
var err error
define.Rule, err = define.RuleFileDto.ReadRuleFile()
if err != nil {
return nil, err
}
define.Param, _ = define.RuleFileDto.ReadRuleParamFile2Map()
define.Result, _ = define.RuleFileDto.ReadRuleResultFile2Map()
return define, nil
}
func (*RuleDefineDto) ToRule ¶
func (self *RuleDefineDto) ToRule() string
type RuleFileDto ¶
type RuleFileDto struct {
rulecache.RuleCache `json:"-"`
*RuleFilePath
*RuleDefineDto
}
func NewRuleFileDto ¶
func NewRuleFileDto() *RuleFileDto
func (*RuleFileDto) BuildFileName ¶
func (self *RuleFileDto) BuildFileName(suffix string) string
func (*RuleFileDto) CheckFileExist ¶
func (self *RuleFileDto) CheckFileExist() bool
func (*RuleFileDto) ReadRuleFile ¶
func (self *RuleFileDto) ReadRuleFile() (string, error)
func (*RuleFileDto) ReadRuleParamFile ¶
func (self *RuleFileDto) ReadRuleParamFile() (string, error)
func (*RuleFileDto) ReadRuleParamFile2Map ¶
func (self *RuleFileDto) ReadRuleParamFile2Map() (map[string]any, error)
func (*RuleFileDto) ReadRuleResultFile ¶
func (self *RuleFileDto) ReadRuleResultFile() (string, error)
func (*RuleFileDto) ReadRuleResultFile2Map ¶
func (self *RuleFileDto) ReadRuleResultFile2Map() (map[string]any, error)
type RuleFilePath ¶
type RuleFilePath struct {
RuleFileName string
ParamFileName string
ResultFileName string
RuleBasePath string `json:"rule_base_path"`
// contains filtered or unexported fields
}
func NewRuleFilePath ¶
func NewRuleFilePath() *RuleFilePath
func (*RuleFilePath) BuildFileName ¶
func (self *RuleFilePath) BuildFileName(id, suffix string) string
func (*RuleFilePath) RulePath ¶
func (self *RuleFilePath) RulePath() string
func (*RuleFilePath) SetRulePath ¶
func (self *RuleFilePath) SetRulePath(rulePath string)
Click to show internal directories.
Click to hide internal directories.