MCPcopy Create free account
hub / github.com/CyCoreSystems/ari-proxy / App

Method App

client/cluster/cluster.go:76–91  ·  view source on GitHub ↗

App returns a list of all cluster members for the given ARI Application whose LastActive time is no older than the given maxAge.

(app string, maxAge time.Duration)

Source from the content-addressed store, hash-verified

74
75// App returns a list of all cluster members for the given ARI Application whose LastActive time is no older than the given maxAge.
76func (c *Cluster) App(app string, maxAge time.Duration) (list []Member) {
77 c.mu.Lock()
78 defer c.mu.Unlock()
79
80 for k, v := range c.members {
81 i, a := dehash(k)
82 if app == a && (maxAge == 0 || time.Since(v) < maxAge) {
83 list = append(list, Member{
84 ID: i,
85 App: a,
86 LastActive: v,
87 })
88 }
89 }
90 return
91}
92
93// Matching returns a list of all cluster members for whom the given proxy Metadata matches
94func (c *Cluster) Matching(id, app string, maxAge time.Duration) (list []Member) {

Callers 2

ConnectedMethod · 0.80
TestAppFunction · 0.80

Calls 1

dehashFunction · 0.85

Tested by 1

TestAppFunction · 0.64