Type returns the string representation of the type of the value stored at key
(ctx *Context, txn *db.Transaction)
| 232 | |
| 233 | // Type returns the string representation of the type of the value stored at key |
| 234 | func Type(ctx *Context, txn *db.Transaction) (OnCommit, error) { |
| 235 | key := []byte(ctx.Args[0]) |
| 236 | obj, err := txn.Object(key) |
| 237 | if err != nil { |
| 238 | if err == db.ErrKeyNotFound { |
| 239 | return SimpleString(ctx.Out, "none"), nil |
| 240 | } |
| 241 | return nil, errors.New("ERR " + err.Error()) |
| 242 | } |
| 243 | |
| 244 | return SimpleString(ctx.Out, obj.Type.String()), nil |
| 245 | } |
| 246 | |
| 247 | // Keys returns all keys matching pattern |
| 248 | func Keys(ctx *Context, txn *db.Transaction) (OnCommit, error) { |
nothing calls this directly
no test coverage detected