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

Method Set

onecache/onecache_rpc.go:144–157  ·  view source on GitHub ↗

Set is used to set the value of a key.

(args StorageArgs, resp *struct{})

Source from the content-addressed store, hash-verified

142
143// Set is used to set the value of a key.
144func (r *rpcServer) Set(args StorageArgs, resp *struct{}) error {
145 target := r.targetNode(args.Key, args.ExplicitPeer)
146 if target != r.n.name {
147 return r.forward(target, "Node.Set", args, resp)
148 }
149
150 if err := r.n.data.Set(args.Key, args.Value, args.Exp, args.Flags); err != nil {
151 return err
152 }
153
154 r.n.replicator.MarkDirty(args.Key)
155 r.markClientVersion(args.Key)
156 return nil
157}
158
159// Cas is used to set the value of a key using a check and set.
160func (r *rpcServer) Cas(args StorageArgs, resp *struct{}) error {

Callers 14

runMethod · 0.45
ringCopyMethod · 0.45
ReplicaSetMethod · 0.45
fillNodeFunction · 0.45
TestMarkDirtyValueFunction · 0.45
TestMarkDeletedFunction · 0.45
TestMarkTouchedFunction · 0.45
TestStoreRemoteFunction · 0.45
TestContainsRemoteFunction · 0.45
TestTouchRemoteFunction · 0.45

Calls 4

targetNodeMethod · 0.95
forwardMethod · 0.95
markClientVersionMethod · 0.95
MarkDirtyMethod · 0.65

Tested by 11

fillNodeFunction · 0.36
TestMarkDirtyValueFunction · 0.36
TestMarkDeletedFunction · 0.36
TestMarkTouchedFunction · 0.36
TestStoreRemoteFunction · 0.36
TestContainsRemoteFunction · 0.36
TestTouchRemoteFunction · 0.36
TestRemoveRemoteFunction · 0.36
TestGetRemoteFunction · 0.36