Touch alters the last access time of a key(s)
(ctx *Context, txn *db.Transaction)
| 359 | |
| 360 | // Touch alters the last access time of a key(s) |
| 361 | func Touch(ctx *Context, txn *db.Transaction) (OnCommit, error) { |
| 362 | kv := txn.Kv() |
| 363 | keys := make([][]byte, len(ctx.Args)) |
| 364 | for i := range ctx.Args { |
| 365 | keys[i] = []byte(ctx.Args[i]) |
| 366 | } |
| 367 | count, err := kv.Touch(keys) |
| 368 | if err != nil { |
| 369 | return nil, err |
| 370 | } |
| 371 | return Integer(ctx.Out, count), nil |
| 372 | } |