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

Method Contains

onecache/onecache_rpc.go:276–285  ·  view source on GitHub ↗

Contains returns whether a key exists.

(args StorageArgs, resp *bool)

Source from the content-addressed store, hash-verified

274
275// Contains returns whether a key exists.
276func (r *rpcServer) Contains(args StorageArgs, resp *bool) error {
277 target := r.targetNode(args.Key, args.ExplicitPeer)
278 if target != r.n.name {
279 return r.forward(target, "Node.Contains", args, resp)
280 }
281
282 *resp = r.n.data.Contains(args.Key)
283 r.markClientVersion(args.Key)
284 return nil
285}
286
287// Touch is used to set the experation of a key.
288func (r *rpcServer) Touch(args StorageArgs, resp *struct{}) error {

Callers 4

TestMarkDeletedFunction · 0.45
TestContainsRemoteFunction · 0.45
TestRemoveRemoteFunction · 0.45

Calls 3

targetNodeMethod · 0.95
forwardMethod · 0.95
markClientVersionMethod · 0.95

Tested by 4

TestMarkDeletedFunction · 0.36
TestContainsRemoteFunction · 0.36
TestRemoveRemoteFunction · 0.36