// DoScan executes one Redis command which should be one of the
// scan commands. It returns the cursor and the result set containing
// the key, values or scored values depending on the scan command.
973888
func (conn *Connection) DoScan(cmd string, args ...interface{}) (int, *ResultSet, error) {
	result, err := conn.Do(cmd, args...)
	if err != nil {
		return 0, nil, err
	}
	return result.Scanned()
}
946582
func (db *DB) SRevScan(key []byte, cursor []byte, count int, inclusive bool, match string) ([][]byte, error) {
	return db.sScanGeneric(key, cursor, count, inclusive, match, true)
}
204499
func (obj *Doc) DoSave(ctx context.Context, fileName string) error {
	err := obj.rpc(ctx, "DoSave", nil, fileName)
	return err 
}
483342
func NewScanCmdResult(keys []string, cursor uint64, err error) *ScanCmd {
	var cmd ScanCmd
	cmd.page = keys
	cmd.cursor = cursor
	cmd.setErr(err)
	return &cmd
}
238426
func (dst *Int2) Scan(src interface{}) error {
	if src == nil {
		*dst = Int2{Status: Null}
		return nil
	}

	switch src := src.(type) {
	case int64:
		if src < math.MinInt16 {
			return errors.Errorf("%d is greater than maximum value for Int2", src)
		}
		if src > math.MaxInt16 {
			return errors.Errorf("%d is greater than maximum value for Int2", src)
		}
		*dst = Int2{Int: int16(src), Status: Present}
		return nil
	case string:
		return dst.DecodeText(nil, []byte(src))
	case []byte:
		srcCopy := make([]byte, len(src))
		copy(srcCopy, src)
		return dst.DecodeText(nil, srcCopy)
	}

	return errors.Errorf("cannot scan %T", src)
}
277920
func (c *Client) Scan(cursor string, options ...interface{}) (string, []string, error) {
	return c.scanCommandList("SCAN", "", cursor, options...)
}
1339767
func (j *Jsonb) Scan(value interface{}) error {
	bytes, ok := value.([]byte)
	if !ok {
		return errors.New(fmt.Sprint("Failed to unmarshal JSONB value:", value))
	}

	return json.Unmarshal(bytes, j)
}
563426
func (w *Wallet) Rescan(addrs []btcutil.Address, unspent []wtxmgr.Credit) error {
	return w.rescanWithTarget(addrs, unspent, nil)
}
79086
func (db *DB) HScan(key []byte, cursor []byte, count int, inclusive bool, match string) ([]FVPair, error) {
	return db.hScanGeneric(key, cursor, count, inclusive, match, false)
}
301543
func (c *Command) Scan(src interface{}) error {
	bytes, ok := src.([]byte)
	if !ok {
		return error(errors.New("Scan source was not []bytes"))
	}

	var cmd Command
	if err := json.Unmarshal(bytes, &cmd); err != nil {
		return err
	}
	*c = cmd

	return nil
}
195142
func (m SessionMock) Scan(statement string, results []interface{}, arguments ...interface{}) error {
	return m.Called(statement, results, arguments).Error(0)
}
836118
func (os *OracleString) Scan(value interface{}) error {
	if value == nil {
		os.String, os.Valid = "", false
		return nil
	}
	os.Valid = true
	return os.NullString.Scan(value)
}
417723
func (rs *ResultSet) Scanned() (int, *ResultSet, error) {
	cursor, err := rs.IntAt(0)
	if err != nil {
		return 0, nil, err
	}
	result, err := rs.ResultSetAt(1)
	return cursor, result, err
}
396397
func (s *RevListScanner) scan() ([]byte, string, error) {
	if !s.s.Scan() {
		return nil, "", s.s.Err()
	}

	line := strings.TrimSpace(s.s.Text())
	if len(line) < 40 {
		return nil, "", nil
	}

	sha1, err := hex.DecodeString(line[:40])
	if err != nil {
		return nil, "", err
	}

	var name string
	if len(line) > 40 {
		name = line[41:]
	}

	return sha1, name, nil
}
1076388
func (s *MemoryScheduler) AddScan(sc *scan.Scan) error {
	return s.UpdateScan(sc)
}
1059672
func (c *CronCommand) Scan(command string) error {
	commands := strings.Fields(command)
	fmt.Println(len(commands), commands)
	c.Trigger = commands[0] // cron
	c.Action = ActionType(commands[1])

	switch c.Action {
	case AddAction, RandomAddAction:
		// cron add 1 * * * * * hogehoge
		if len(commands) < 9 {
			return fmt.Errorf("commands length error %d", len(commands))
		}
		c.CronSpec = strings.Join(commands[2:8], " ")
		c.Args = commands[8:]
		c.CronID = generateCronID()
	case DelAction, DeleteAction, StopAction:
		// cron del <cron_id>
		if len(commands) != 3 {
			return fmt.Errorf("commands length error %d", len(commands))
		}
		c.CronID = commands[2]
	case ListAction, RefreshAction, HelpAction:
		// cron list
		if len(commands) != 2 {
			return fmt.Errorf("commands length error %d", len(commands))
		}
	}

	return nil
}
921283
func (scg scanCommandGroup) xsscanCommand(c *client) error {
	args := c.args

	if len(args) < 2 {
		return ErrCmdParams
	}

	key := args[0]

	cursor, match, count, desc, err := scg.parseArgs(args[1:])

	if err != nil {
		return err
	}

	var ay [][]byte

	if !desc {
		ay, err = c.db.SScan(key, cursor, count, false, match)
	} else {
		ay, err = c.db.SRevScan(key, cursor, count, false, match)
	}

	if err != nil {
		return err
	}

	data := make([]interface{}, 2)
	if len(ay) < count {
		data[0] = scg.lastCursor
	} else {
		data[0] = ay[len(ay)-1]
	}

	data[1] = ay

	c.resp.writeArray(data)
	return nil
}