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

Function cmdLRANGE

lists.go:323–347  ·  view source on GitHub ↗
(m uhaha.Machine, args []string)

Source from the content-addressed store, hash-verified

321
322 if err := ldb.LSet([]byte(args[1]), int32(index), []byte(args[3])); err != nil {
323 return nil, err
324 }
325 return redcon.SimpleString("OK"), nil
326}
327
328func cmdLRANGE(m uhaha.Machine, args []string) (interface{}, error) {
329 if len(args) != 4 {
330 return nil, uhaha.ErrWrongNumArgs
331 }
332
333 var start int64
334 var stop int64
335 var err error
336
337 start, err = ledis.StrInt64([]byte(args[2]), nil)
338 if err != nil {
339 return nil, err
340 }
341
342 stop, err = ledis.StrInt64([]byte(args[3]), nil)
343 if err != nil {
344 return nil, err
345 }
346
347 v, err := ldb.LRange([]byte(args[1]), int32(start), int32(stop))
348 if err != nil {
349 return nil, err
350 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected