MCPcopy
hub / github.com/evilsocket/opensnitch / unmarshalOperatorList

Method unmarshalOperatorList

daemon/rule/loader.go:357–366  ·  view source on GitHub ↗

Deprecated: rule.Operator.Data no longer holds the operator list in json format as string.

(op *Operator)

Source from the content-addressed store, hash-verified

355
356// Deprecated: rule.Operator.Data no longer holds the operator list in json format as string.
357func (l *Loader) unmarshalOperatorList(op *Operator) error {
358 if op.Type == List && len(op.List) == 0 && op.Data != "" {
359 if err := json.Unmarshal([]byte(op.Data), &op.List); err != nil {
360 return fmt.Errorf("error loading rule of type list: %s", err)
361 }
362 op.Data = ""
363 }
364
365 return nil
366}
367
368func (l *Loader) sortRules() {
369 l.activeRules = make([]string, 0, len(l.rules))

Callers 2

loadRuleMethod · 0.95
replaceUserRuleMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected