(m uhaha.Machine, args []string)
| 811 | keys := make([][]byte, 1) |
| 812 | keys[0] = []byte(args[1]) |
| 813 | _, err := ldb.Del(keys...) |
| 814 | if err != nil { |
| 815 | return nil, err |
| 816 | } |
| 817 | return redcon.SimpleString("OK"), nil |
| 818 | } |
| 819 | |
| 820 | if err := ldb.SetEXAT([]byte(args[1]), timestamp, []byte(args[3])); err != nil { |
| 821 | return nil, err |
| 822 | } |
| 823 | |
| 824 | return redcon.SimpleString("OK"), nil |
| 825 | } |
| 826 | |
| 827 | func cmdSETNX(m uhaha.Machine, args []string) (interface{}, error) { |
| 828 | if len(args) != 3 { |
| 829 | return nil, uhaha.ErrWrongNumArgs |
| 830 | } |
| 831 | |
| 832 | n, err := ldb.SetNX([]byte(args[1]), []byte(args[2])) |
| 833 | if err != nil { |
| 834 | return nil, err |
| 835 | } |
| 836 | |
| 837 | return redcon.SimpleInt(n), nil |
| 838 | } |
| 839 | |
| 840 | func cmdGET(m uhaha.Machine, args []string) (interface{}, error) { |
| 841 | if len(args) != 2 { |
| 842 | return nil, uhaha.ErrWrongNumArgs |
| 843 | } |
| 844 | |
| 845 | // Retrieve the value associated with the key |
nothing calls this directly
no outgoing calls
no test coverage detected