MCPcopy Create free account
hub / github.com/dadgar/onecache / getPeerSync

Method getPeerSync

onecache/replicator.go:205–216  ·  view source on GitHub ↗

getPeerSync returns the peer if it has been creaated, and other wise creates it.

(peer string)

Source from the content-addressed store, hash-verified

203// getPeerSync returns the peer if it has been creaated, and other wise creates
204// it.
205func (r *replicator) getPeerSync(peer string) *peerSync {
206 r.lock.Lock()
207 defer r.lock.Unlock()
208 p, ok := r.peers[peer]
209 if ok {
210 return p
211 }
212
213 p = newPeerSync(peer, r)
214 r.peers[peer] = p
215 return p
216}
217
218// peerSync is used to replicate keys to a particular peer
219type peerSync struct {

Callers 4

MarkDirtyMethod · 0.95
MarkTouchedMethod · 0.95
MarkDeletedMethod · 0.95
MarkPeersDirtyMethod · 0.95

Calls 1

newPeerSyncFunction · 0.85

Tested by

no test coverage detected