"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
fs: Add MimeTypeDirEntry to return the MimeType of a DirEntry
Nick Craig-Woodaadbcce486df
diff --git a/fs/mimetype.go b/fs/mimetype.goindex 22cfb8604..7323adf1f 100644--- a/fs/mimetype.go+++ b/fs/mimetype.go@@ -28,3 +28,17 @@ func MimeType(o ObjectInfo) (mimeType string) {}return MimeTypeFromName(o.Remote())}++// MimeTypeDirEntry returns the MimeType of a DirEntry+//+// It returns "inode/directory" for directories, or uses+// MimeType(Object)+func MimeTypeDirEntry(item DirEntry) string {+ switch x := item.(type) {+ case Object:+ return MimeType(x)+ case Directory:+ return "inode/directory"+ }+ return ""+}