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

Method GetAll

pkg/acquisition/modules/docker/tracker/tracker.go:35–41  ·  view source on GitHub ↗

GetAll returns a snapshot copy of all items currently in the tracker. The returned map is a shallow copy: modifying it will not affect the underlying tracker contents. Safe for concurrent use.

()

Source from the content-addressed store, hash-verified

33// The returned map is a shallow copy: modifying it will not affect
34// the underlying tracker contents. Safe for concurrent use.
35func (t *Tracker[T]) GetAll() map[string]T {
36 t.mu.RLock()
37 snapshot := make(map[string]T, len(t.items))
38 maps.Copy(snapshot, t.items)
39 t.mu.RUnlock()
40 return snapshot
41}
42
43// Get returns the item stored under the given id, along with a boolean
44// indicating whether it was found.

Callers 6

checkServicesMethod · 0.80
checkContainersMethod · 0.80
ContainerManagerMethod · 0.80
ServiceManagerMethod · 0.80
TestTrackerBasicFunction · 0.80

Calls

no outgoing calls

Tested by 2

TestTrackerBasicFunction · 0.64