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: retrieve.go
    path of file: ./repos/sliver/vendor/tailscale.com/taildrop
    
    the code of the file until where you have to start completion: // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause

package taildrop

import (
	"context"
	"errors"
	"io"
	"io/fs"
	"os"
	"path/filepath"
	"runtime"
	"sort"
	"time"

	"tailscale.com/client/tailscale/apitype"
	"tailscale.com/logtail/backoff"
)

// HasFilesWaiting reports whether any files are buffered in [Handler.Dir].
// This always returns false when [Handler.DirectFileMode] is false.
func (m *Manager) HasFilesWaiting() (has bool) {
	if m == nil || m.opts.Dir == "" || m.opts.DirectFileMode {
		return false
	}

	// Optimization: this is usually empty, so avoid opening
	// the directo
    
func (m *Manager) WaitingFiles() (ret []apitype.WaitingFile, err error) {
	if m == nil || m.opts.Dir == "" {
		return nil, ErrNoTaildrop
	}
	if m.opts.DirectFileMode {
		return nil, nil
	}
	if err := rangeDir(m.opts.Dir, func(de fs.DirEntry) bool {
		name := de.Name()
		if isPartialOrDeleted(name) || !de.Type().IsRegular() {
			return true
		}
		_, err := os.Stat(filepath.Join(m.opts.Dir, name+deletedSuffix))
		if os.IsNotExist(err) {
			fi, err := de.Info()
			if err != nil {
				return true
			}
			ret = append(ret, apitype.WaitingFile{
				Name: filepath.Base(name),
				Size: fi.Size(),
			})
		}
		return true
	}); err != nil {
		return nil, redactError(err)
	}
	sort.Slice(ret, func(i, j int) bool { return ret[i].Name < ret[j].Name })
	return ret, nil
}