engine

package
v0.0.0-...-8afa43e Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TypeArr = []string{
	"int",
	"float64",
	"int64",
	"string",
	"time",
	"[]int",
	"[]float64",
	"[]string",
	"[]int64",
	"[]mixed",
}
View Source
var TypeMap = map[string]int{}

Functions

func And

func And(data []bool) bool

func Not

func Not(data bool) bool

func Or

func Or(data []bool) bool

func OutAnd

func OutAnd(data bool) bool

Types

type AdvertTag

type AdvertTag struct {
	Id       string            `json:"id"`
	Dnf      string            `json:"dnf"`
	AdTag    []FirstLevel      `json:"ad_tag"`
	TagsMap  map[string]string `json:"tags_map"`
	TagCount int               `json:"tag_count"`
	IsInit   bool              `json:"is_init"`
	sync.RWMutex
	DoOnceSameTime src.DoOnce `json:"-"`
	MatchResult    bool       `json:"match_result"`
}

func New

func New(dnf string) (a *AdvertTag, err error)

func (*AdvertTag) Init

func (a *AdvertTag) Init() (err error)

func (*AdvertTag) MarshalJSON

func (a *AdvertTag) MarshalJSON() ([]byte, error)

func (*AdvertTag) Match

func (a *AdvertTag) Match(tagValues map[string]string) (result bool, err error)

标签匹配方法,匹配则返回true

func (*AdvertTag) Unmarshal

func (a *AdvertTag) Unmarshal(data []byte) error

type DnfMap

type DnfMap map[string]interface{}

type FirstLevel

type FirstLevel struct {
	Cond        []*TagInfo `json:"cond"`
	In          string     `json:"in"`
	Out         string     `json:"out"`
	TypeReflect string     `json:"type_reflect"`
	ResultIn    bool       `json:"result_in"`
	ResultOut   bool       `json:"result_out"`
	Dnf         string     `json:"dnf"`

	FuncIn  func(data []bool) bool
	FuncOut func(data bool) bool

	TagsMap map[string]string `json:"tags_map"`
}

func (*FirstLevel) CondInit

func (f *FirstLevel) CondInit() (err error)

func (*FirstLevel) Init

func (f *FirstLevel) Init() (err error)

func (*FirstLevel) MarshalJSON

func (f *FirstLevel) MarshalJSON() ([]byte, error)

func (*FirstLevel) Match

func (f *FirstLevel) Match(values map[string]string) (result bool, err error)

func (*FirstLevel) Parse

func (f *FirstLevel) Parse(dnf string) (err error)

[(exp_first_attend_status∈{0.000000,1.000000}|4)∧(exp_attend_num={1}|2)]

func (*FirstLevel) SetFuncIn

func (f *FirstLevel) SetFuncIn() (err error)

func (*FirstLevel) SetFuncOut

func (f *FirstLevel) SetFuncOut() (err error)

func (*FirstLevel) Unmarshal

func (f *FirstLevel) Unmarshal(data []byte) error

type T

type T struct {
	Type        string `json:"type"`
	Id          string `json:"id"`
	Symbol      string `json:"symbol"`
	Value       Value  `json:"value"`
	TagType     int    `json:"tag_type"`
	TypeReflect string `json:"type_reflect"`
	Dnf         string `json:"dnf"`
	Relation    string `json:"relation"`
}

type TagInfo

type TagInfo struct {
	Id          string `json:"id"`
	Symbol      string `json:"symbol"`
	Value       Value  `json:"value"`
	TagType     int    `json:"tag_type"`
	Match       func(str string) (result bool, err error)
	TypeReflect string `json:"type_reflect"`
	Dnf         string `json:"dnf"`
	Relation    string `json:"relation"`
	RelationFun func(bool2 bool) bool
	Result      bool `json:"result"`
}

数据类型 big_float, float :浮点型 num:整型 string, time:字符串

func (*TagInfo) Float64ArrMatch

func (t *TagInfo) Float64ArrMatch(value string) (result bool, err error)

func (*TagInfo) Float64Match

func (t *TagInfo) Float64Match(value string) (result bool, err error)

func (*TagInfo) Init

func (t *TagInfo) Init() (err error)

func (*TagInfo) Int64ArrMatch

func (t *TagInfo) Int64ArrMatch(value string) (result bool, err error)

func (*TagInfo) Int64Match

func (t *TagInfo) Int64Match(value string) (result bool, err error)

func (*TagInfo) IntArrMatch

func (t *TagInfo) IntArrMatch(value string) (result bool, err error)

func (*TagInfo) IntMatch

func (t *TagInfo) IntMatch(value string) (result bool, err error)

func (*TagInfo) MarshalJSON

func (t *TagInfo) MarshalJSON() ([]byte, error)

func (*TagInfo) Parse

func (t *TagInfo) Parse(dnf string) (err error)

(exp_first_attend_status∈{0.000000,1.000000}|4)

func (*TagInfo) SetFunRelation

func (t *TagInfo) SetFunRelation() (err error)

func (*TagInfo) SetMatchFun

func (t *TagInfo) SetMatchFun() (err error)

func (*TagInfo) SetValueType

func (t *TagInfo) SetValueType()

func (*TagInfo) StringArrMatch

func (t *TagInfo) StringArrMatch(value string) (result bool, err error)

func (*TagInfo) StringMatch

func (t *TagInfo) StringMatch(value string) (result bool, err error)

func (*TagInfo) TimeMatch

func (t *TagInfo) TimeMatch(value string) (result bool, err error)

func (*TagInfo) UnmarshalJSON

func (t *TagInfo) UnmarshalJSON(data []byte) error

type Value

type Value struct {
	Type       string             `json:"type"`
	Origin     string             `json:"origin"`
	Float64    float64            `json:"float_64"`
	Int        int                `json:"int"`
	Int64      int64              `json:"int64"`
	String     string             `json:"string"`
	Time       time.Time          `json:"time"`
	TagValue   []string           `json:"tag_value"`
	Float64Arr map[float64]string `json:"-"`
	IntArr     map[int]string     `json:"int_arr"`
	Int64Arr   map[int64]string   `json:"int64_arr"`
	StringArr  map[string]string  `json:"string_arr"`
	InputValue interface{}        `json:"input_value"`
}

func (*Value) Init

func (v *Value) Init()

func (*Value) MarshalJSON

func (v *Value) MarshalJSON() ([]byte, error)

func (*Value) ParseValue

func (v *Value) ParseValue() (err error)

func (*Value) UnmarshalJSON

func (v *Value) UnmarshalJSON(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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