You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: handler.go
    path of file: ./repos/Cloudreve/pkg/filesystem/driver/remote
    
    the code of the file until where you have to start completion: package remote

import (
	"context"
	"encoding/base64"
	"encoding/json"
	"errors"
	"fmt"
	"net/url"
	"path"
	"path/filepath"
	"strings"
	"time"

	model "github.com/cloudreve/Cloudreve/v3/models"
	"github.com/cloudreve/Cloudreve/v3/pkg/auth"
	"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver"
	"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
	"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/response"
	"github.com/cloudreve/Cloudreve/v3/pkg/request"
	"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
	"github.com/cloudreve/Cloudreve/v3/pkg/util"
)

// Driver 远程存储策略适配器
type Driver struct {
	Client       request.Client
	Policy       *model.Policy
	AuthInstance auth.Auth

	uploadClient Client
}

// NewDriver initializes a new Driver from policy
    
func (handler *Driver) List(ctx context.Context, path string, recursive bool) ([]response.Object, error) {
	var res []response.Object

	reqBody := serializer.ListRequest{
		Path:      path,
		Recursive: recursive,
	}
	reqBodyEncoded, err := json.Marshal(reqBody)
	if err != nil {
		return res, err
	}

	// 发送列表请求
	bodyReader := strings.NewReader(string(reqBodyEncoded))
	signTTL := model.GetIntSetting("slave_api_timeout", 60)
	resp, err := handler.Client.Request(
		"POST",
		handler.getAPIUrl("list"),
		bodyReader,
		request.WithCredential(handler.AuthInstance, int64(signTTL)),
		request.WithMasterMeta(),
	).CheckHTTPResponse(200).DecodeResponse()
	if err != nil {
		return res, err
	}

	// 处理列取结果
	if resp.Code != 0 {
		return res, errors.New(resp.Error)
	}

	if resStr, ok := resp.Data.(string); ok {
		err = json.Unmarshal([]byte(resStr), &res)
		if err != nil {
			return res, err
		}
	}

	return res, nil
}