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

Method Get

onecache/onecache_rpc.go:320–333  ·  view source on GitHub ↗

Get returns the value of the key.

(args StorageArgs, resp *ttlstore.KeyData)

Source from the content-addressed store, hash-verified

318
319// Get returns the value of the key.
320func (r *rpcServer) Get(args StorageArgs, resp *ttlstore.KeyData) error {
321 target := r.targetNode(args.Key, args.ExplicitPeer)
322 if target != r.n.name {
323 return r.forward(target, "Node.Get", args, resp)
324 }
325
326 data, err := r.n.data.Get(args.Key)
327 if err != nil {
328 return err
329 }
330
331 *resp = *data
332 return nil
333}
334
335// ReplicaStorageArgs is a versioned key set by a replica peer.
336type ReplicaStorageArgs struct {

Callers 14

runMethod · 0.45
replicateDirtyValueMethod · 0.45
replicateBackfillMethod · 0.45
replicateTouchMethod · 0.45
TestMarkPeersDirtySingleFunction · 0.45
TestMarkDirtyValueFunction · 0.45
TestMarkTouchedFunction · 0.45
TestStoreRemoteFunction · 0.45
TestTouchRemoteFunction · 0.45

Calls 2

targetNodeMethod · 0.95
forwardMethod · 0.95

Tested by 10

TestMarkPeersDirtySingleFunction · 0.36
TestMarkDirtyValueFunction · 0.36
TestMarkTouchedFunction · 0.36
TestStoreRemoteFunction · 0.36
TestTouchRemoteFunction · 0.36
TestGetRemoteFunction · 0.36
TestGetRemoteInvalidFunction · 0.36