MCPcopy
hub / github.com/crowdsecurity/crowdsec / UniqueKey

Function UniqueKey

pkg/hubops/plan.go:56–58  ·  view source on GitHub ↗

UniqueKey generates a unique string key for a Command based on its operation type, item type, and detail. Is is used to avoid adding duplicate commands to the action plan.

(c Command)

Source from the content-addressed store, hash-verified

54// UniqueKey generates a unique string key for a Command based on its operation type, item type, and detail.
55// Is is used to avoid adding duplicate commands to the action plan.
56func UniqueKey(c Command) string {
57 return fmt.Sprintf("%s:%s:%s", c.OperationType(), c.ItemType(), c.Detail())
58}
59
60// ActionPlan orchestrates the sequence of operations (Commands) to manage CrowdSec hub items.
61type ActionPlan struct {

Callers 1

AddCommandMethod · 0.85

Calls 3

OperationTypeMethod · 0.65
ItemTypeMethod · 0.65
DetailMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…