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

Method Touch

onecache/onecache_rpc.go:288–301  ·  view source on GitHub ↗

Touch is used to set the experation of a key.

(args StorageArgs, resp *struct{})

Source from the content-addressed store, hash-verified

286
287// Touch is used to set the experation of a key.
288func (r *rpcServer) Touch(args StorageArgs, resp *struct{}) error {
289 target := r.targetNode(args.Key, args.ExplicitPeer)
290 if target != r.n.name {
291 return r.forward(target, "Node.Touch", args, resp)
292 }
293
294 if err := r.n.data.Touch(args.Key, args.Exp); err != nil {
295 return err
296 }
297
298 r.n.replicator.MarkTouched(args.Key)
299 r.markClientVersion(args.Key)
300 return nil
301}
302
303// Remove removes the key.
304func (r *rpcServer) Remove(args StorageArgs, resp *struct{}) error {

Callers 4

runMethod · 0.45
ReplicaTouchMethod · 0.45
TestTouchRemoteFunction · 0.45
TestTouchRemoteInvalidFunction · 0.45

Calls 4

targetNodeMethod · 0.95
forwardMethod · 0.95
markClientVersionMethod · 0.95
MarkTouchedMethod · 0.65

Tested by 2

TestTouchRemoteFunction · 0.36
TestTouchRemoteInvalidFunction · 0.36