init: ops-assistant codebase

This commit is contained in:
OpenClaw Agent
2026-03-19 21:23:28 +08:00
commit 81deba4766
94 changed files with 10767 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package module
import (
"fmt"
"strings"
"gorm.io/gorm"
"ops-assistant/internal/core/policy"
)
func switchFlag(module string) string {
module = strings.TrimSpace(strings.ToLower(module))
if module == "" {
return ""
}
return fmt.Sprintf("enable_module_%s", module)
}
func IsEnabled(db *gorm.DB, module string) bool {
k := switchFlag(module)
if k == "" {
return false
}
return policy.FlagEnabled(db, k)
}