Documentation
¶
Index ¶
Constants ¶
View Source
const RuleActionApprove = "approve"
View Source
const RuleActionChallenge = "challenge"
View Source
const RuleActionReject = "reject"
Variables ¶
This section is empty.
Functions ¶
func BenchmarkHello ¶
func GetAvailableRules ¶
func GetAvailableRules() []string
func RegisterRule ¶
func RegisterRule(name string, f CreateRuleFunc)
Types ¶
type CreateRuleFunc ¶
type CreateRuleFunc func() IsRule
type RuleContext ¶
type RuleModel ¶
func (*RuleModel) GetRuleCode ¶
type RuleResult ¶
type RuleResult struct { IsMatched bool Action string Score int Channels []string ContextActions map[string]string }
func (*RuleResult) ActionPrio ¶
func (m *RuleResult) ActionPrio(currentAction string) string
ActionPrio If current action has a higher priority return that, else return the result action
type RulesService ¶
type RulesService interface { Check(model m.RuleAPIRequest) (res m.RuleAPIResponse, err error) Rules() (rules []string, err error) }
type SimpleRuleService ¶
type SimpleRuleService struct { }
func (SimpleRuleService) Check ¶
func (s SimpleRuleService) Check(request m.RuleAPIRequest) (res *m.RuleAPIResponse, err error)
func (SimpleRuleService) Rules ¶
func (s SimpleRuleService) Rules() (rules []string, err error)
type VelocityCheckRule ¶
type VelocityCheckRule struct { }
func (*VelocityCheckRule) Exec ¶
func (c *VelocityCheckRule) Exec() (*RuleResult, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.