NewRule 创建新规则
(scope Scope, title, content string)
| 67 | |
| 68 | // NewRule 创建新规则 |
| 69 | func NewRule(scope Scope, title, content string) *Rule { |
| 70 | now := time.Now() |
| 71 | return &Rule{ |
| 72 | ID: generateID(), |
| 73 | Scope: scope, |
| 74 | Title: title, |
| 75 | Content: content, |
| 76 | Priority: 0, |
| 77 | Enabled: true, |
| 78 | CreatedAt: now, |
| 79 | UpdatedAt: now, |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | // NewRuleSet 创建规则集 |
| 84 | func NewRuleSet() *RuleSet { |
nothing calls this directly
no test coverage detected