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

Method Remove

onecache/onecache_rpc.go:304–317  ·  view source on GitHub ↗

Remove removes the key.

(args StorageArgs, resp *struct{})

Source from the content-addressed store, hash-verified

302
303// Remove removes the key.
304func (r *rpcServer) Remove(args StorageArgs, resp *struct{}) error {
305 target := r.targetNode(args.Key, args.ExplicitPeer)
306 if target != r.n.name {
307 return r.forward(target, "Node.Remove", args, resp)
308 }
309
310 if err := r.n.data.Delete(args.Key); err != nil {
311 return err
312 }
313
314 r.n.replicator.MarkDeleted(args.Key)
315 r.markClientVersion(args.Key)
316 return nil
317}
318
319// Get returns the value of the key.
320func (r *rpcServer) Get(args StorageArgs, resp *ttlstore.KeyData) error {

Callers 6

runMethod · 0.45
removeMethod · 0.45
getClientMethod · 0.45
replicateDeleteMethod · 0.45
TestRemoveRemoteFunction · 0.45
TestRemoveRemoteInvalidFunction · 0.45

Calls 5

targetNodeMethod · 0.95
forwardMethod · 0.95
markClientVersionMethod · 0.95
DeleteMethod · 0.80
MarkDeletedMethod · 0.65

Tested by 2

TestRemoveRemoteFunction · 0.36
TestRemoveRemoteInvalidFunction · 0.36