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

Method Contains

session/objects.go:15–26  ·  view source on GitHub ↗

Contains finds the id, if it exists

(id string)

Source from the content-addressed store, hash-verified

13
14// Contains finds the id, if it exists
15func (o *Objects) Contains(id string) (int, bool) {
16 o.mutex.RLock()
17 defer o.mutex.RUnlock()
18
19 idx := sort.SearchStrings(o.ids, id)
20
21 if idx == len(o.ids) || o.ids[idx] != id {
22 return -1, false
23 }
24
25 return idx, true
26}
27
28// Add adds the given object
29func (o *Objects) Add(id string) bool {

Callers 2

AddMethod · 0.95
RemoveMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected