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

Method Prepend

onecache/onecache_rpc.go:224–237  ·  view source on GitHub ↗

Prepend prepends to the contents of a key.

(args StorageArgs, resp *struct{})

Source from the content-addressed store, hash-verified

222
223// Prepend prepends to the contents of a key.
224func (r *rpcServer) Prepend(args StorageArgs, resp *struct{}) error {
225 target := r.targetNode(args.Key, args.ExplicitPeer)
226 if target != r.n.name {
227 return r.forward(target, "Node.Prepend", args, resp)
228 }
229
230 if err := r.n.data.Prepend(args.Key, args.Value); err != nil {
231 return err
232 }
233
234 r.n.replicator.MarkDirty(args.Key)
235 r.markClientVersion(args.Key)
236 return nil
237}
238
239// Increment increments the value of a key.
240func (r *rpcServer) Increment(args StorageArgs, resp *int64) 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