gitee.com/quant1x/engine@v1.8.4/rules/rule_impl.go (about) 1 package rules 2 3 import ( 4 "gitee.com/quant1x/engine/config" 5 "gitee.com/quant1x/engine/factors" 6 ) 7 8 type RuleImpl struct { 9 kind Kind 10 name string 11 exec func(rules config.RuleParameter, snapshot factors.QuoteSnapshot) error 12 } 13 14 func (r RuleImpl) Kind() Kind { 15 return r.kind 16 } 17 18 func (r RuleImpl) Name() string { 19 return r.name 20 } 21 22 func (r RuleImpl) Exec(rules config.RuleParameter, snapshot factors.QuoteSnapshot) error { 23 return r.exec(rules, snapshot) 24 } 25 26 func (r RuleImpl) RuleMethod() func(rules config.RuleParameter, snapshot factors.QuoteSnapshot) error { 27 return r.exec 28 }