MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / create

Function create

cmd/fibratus/app/rules/rules.go:79–88  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

77}
78
79func create(cmd *cobra.Command, args []string) error {
80 if len(args) == 0 {
81 return fmt.Errorf("rule name is required")
82 }
83 if tacticID != "" && tactics[tacticID] == "" {
84 tacts := fmt.Sprintf("Did you mean any of %s?", strings.Join(convert.MapKeysToSlice(tactics), ", "))
85 return fmt.Errorf("invalid tactic id: %s. %s", tacticID, tacts)
86 }
87 return createRule(args[0])
88}
89
90func emo(s string, args ...any) { fmt.Printf(s, args...) }

Callers

nothing calls this directly

Calls 2

MapKeysToSliceFunction · 0.92
createRuleFunction · 0.85

Tested by

no test coverage detected