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

Function cmdHSET

hashes.go:38–51  ·  view source on GitHub ↗
(m uhaha.Machine, args []string)

Source from the content-addressed store, hash-verified

36}
37
38func cmdHSET(m uhaha.Machine, args []string) (interface{}, error) {
39 if len(args) < 3 || (len(args))%2 != 0 {
40 return nil, uhaha.ErrWrongNumArgs
41 }
42
43 var n int64
44 for i := 2; i < len(args); i += 2 {
45 if r, err := ldb.HSet([]byte(args[1]), []byte(args[i]), []byte(args[i+1])); err == nil {
46 n = n + r
47 }
48 }
49
50 return redcon.SimpleInt(n), nil
51}
52
53func cmdHGET(m uhaha.Machine, args []string) (interface{}, error) {
54 if len(args) != 3 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected