Increment increments the value of a key.
(args StorageArgs, resp *int64)
| 238 | |
| 239 | // Increment increments the value of a key. |
| 240 | func (r *rpcServer) Increment(args StorageArgs, resp *int64) error { |
| 241 | target := r.targetNode(args.Key, args.ExplicitPeer) |
| 242 | if target != r.n.name { |
| 243 | return r.forward(target, "Node.Increment", args, resp) |
| 244 | } |
| 245 | |
| 246 | incr, err := r.n.data.Increment(args.Key, args.Delta) |
| 247 | if err != nil { |
| 248 | return err |
| 249 | } |
| 250 | *resp = incr |
| 251 | |
| 252 | r.n.replicator.MarkDirty(args.Key) |
| 253 | r.markClientVersion(args.Key) |
| 254 | return nil |
| 255 | } |
| 256 | |
| 257 | // Decrement decrements the value of a key. |
| 258 | func (r *rpcServer) Decrement(args StorageArgs, resp *int64) error { |
no test coverage detected