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

Function cmdMSET

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

Source from the content-addressed store, hash-verified

785 keys[0] = []byte(args[1])
786 _, err := ldb.Del(keys...)
787 if err != nil {
788 return nil, err
789 }
790 return redcon.SimpleString("OK"), nil
791 }
792
793 if err := ldb.SetEXAT([]byte(args[1]), timestamp, []byte(args[3])); err != nil {
794 return nil, err
795 }
796
797 return redcon.SimpleString("OK"), nil
798}
799
800func cmdSETEXAT(m uhaha.Machine, args []string) (interface{}, error) {
801 if len(args) < 4 {
802 return nil, uhaha.ErrWrongNumArgs
803 }
804 timestamp, err := ledis.StrInt64([]byte(args[2]), nil)
805 if err != nil {
806 return nil, err
807 }
808
809 //If the timestamp is less than the current time, delete operation
810 if timestamp < time.Now().Unix() {
811 keys := make([][]byte, 1)
812 keys[0] = []byte(args[1])
813 _, err := ldb.Del(keys...)
814 if err != nil {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected