Append appends to the contents of a key.
(args StorageArgs, resp *struct{})
| 206 | |
| 207 | // Append appends to the contents of a key. |
| 208 | func (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. |
| 224 | func (r *rpcServer) Prepend(args StorageArgs, resp *struct{}) error { |
no test coverage detected