MCPcopy Create free account
hub / github.com/astercloud/aster / NewRule

Function NewRule

pkg/memory/rules/types.go:69–81  ·  view source on GitHub ↗

NewRule 创建新规则

(scope Scope, title, content string)

Source from the content-addressed store, hash-verified

67
68// NewRule 创建新规则
69func 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 创建规则集
84func NewRuleSet() *RuleSet {

Callers

nothing calls this directly

Calls 1

generateIDFunction · 0.70

Tested by

no test coverage detected