MCPcopy
hub / github.com/safing/portmaster / Match

Method Match

service/profile/endpoints/endpoints.go:91–103  ·  view source on GitHub ↗

Match checks whether the given entity matches any of the endpoint definitions in the list.

(ctx context.Context, entity *intel.Entity)

Source from the content-addressed store, hash-verified

89
90// Match checks whether the given entity matches any of the endpoint definitions in the list.
91func (e Endpoints) Match(ctx context.Context, entity *intel.Entity) (result EPResult, reason Reason) {
92 for _, entry := range e {
93 if entry == nil {
94 continue
95 }
96
97 if result, reason = entry.Matches(ctx, entity); result != NoMatch {
98 return
99 }
100 }
101
102 return NoMatch, nil
103}
104
105// MatchMulti checks whether the given entities match any of the endpoint
106// definitions in the list. Every rule is evaluated against all given entities

Calls 1

MatchesMethod · 0.65

Tested by

no test coverage detected