MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / cmdMGET

Function cmdMGET

strings.go:813–842  ·  view source on GitHub ↗
(m uhaha.Machine, args []string)

Source from the content-addressed store, hash-verified

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
827func 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
840func 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected