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

Method Append

onecache/onecache_rpc.go:208–221  ·  view source on GitHub ↗

Append appends to the contents of a key.

(args StorageArgs, resp *struct{})

Source from the content-addressed store, hash-verified

206
207// Append appends to the contents of a key.
208func (r *rpcServer) Append(args StorageArgs, resp *struct{}) error {
209 target := r.targetNode(args.Key, args.ExplicitPeer)
210 if target != r.n.name {
211 return r.forward(target, "Node.Append", args, resp)
212 }
213
214 if err := r.n.data.Append(args.Key, args.Value); err != nil {
215 return err
216 }
217
218 r.n.replicator.MarkDirty(args.Key)
219 r.markClientVersion(args.Key)
220 return nil
221}
222
223// Prepend prepends to the contents of a key.
224func (r *rpcServer) Prepend(args StorageArgs, resp *struct{}) error {

Callers 1

runMethod · 0.45

Calls 4

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

Tested by

no test coverage detected