func xscan(db *ledis.DB, tp string, count int) ([][]byte, error) { switch strings.ToUpper(tp) { case KVName: return db.Scan(KV, nil, count, false, "") case HashName: return db.Scan(HASH, nil, count, false, "") case ListName: return db.Scan(LIST, nil, count, false, "") case SetName: return db.Scan(SET, nil, count, false, "") case ZSetName: return db.Scan(ZSET, nil, count, false, "") default: return nil, fmt.Errorf("invalid key type %s", tp) } }