MCPcopy Create free account
hub / github.com/fnproject/fn / EqualsWithAnnotationSubset

Method EqualsWithAnnotationSubset

api/models/trigger.go:46–58  ·  view source on GitHub ↗

EqualsWithAnnotationSubset is equivalent to Equals except it accepts cases where t's annotations are strict subset of t2

(t2 *Trigger)

Source from the content-addressed store, hash-verified

44
45// EqualsWithAnnotationSubset is equivalent to Equals except it accepts cases where t's annotations are strict subset of t2
46func (t *Trigger) EqualsWithAnnotationSubset(t2 *Trigger) bool {
47 eq := true
48 eq = eq && t.ID == t2.ID
49 eq = eq && t.Name == t2.Name
50 eq = eq && t.AppID == t2.AppID
51 eq = eq && t.FnID == t2.FnID
52
53 eq = eq && t.Type == t2.Type
54 eq = eq && t.Source == t2.Source
55 eq = eq && t.Annotations.Subset(t2.Annotations)
56
57 return eq
58}
59
60// TriggerTypeHTTP represents an HTTP trigger
61const TriggerTypeHTTP = "http"

Callers 2

TestTriggerCreateFunction · 0.95
TestTriggerUpdateFunction · 0.95

Calls 1

SubsetMethod · 0.80

Tested by 2

TestTriggerCreateFunction · 0.76
TestTriggerUpdateFunction · 0.76