encodings: add all known backend encodings

This commit is contained in:
Fabian Möller
2019-09-30 14:05:49 +01:00
committed by Nick Craig-Wood
parent a56c9ab61d
commit c09b62a088
6 changed files with 388 additions and 21 deletions
+46
View File
@@ -0,0 +1,46 @@
// +build noencode
package encodings
import (
"github.com/rclone/rclone/lib/encoder"
)
// Fake encodings used for testing
const (
Base = encoder.MultiEncoder(
encoder.EncodeZero |
encoder.EncodeSlash)
Display = Base
LocalUnix = Base
LocalWindows = Base
AmazonCloudDrive = Base
B2 = Base
Box = Base
Drive = Base
Dropbox = Base
GoogleCloudStorage = Base
JottaCloud = Base
Koofr = Base
Mega = Base
OneDrive = Base
OpenDrive = Base
Pcloud = Base
)
// ByName returns the encoder for a give backend name or nil
func ByName(name string) encoder.Encoder {
return Base
}
// Local returns the local encoding for the current platform
func Local() encoder.MultiEncoder {
return Base
}
// Names returns the list of known encodings as accepted by ByName
func Names() []string {
return []string{
"base",
}
}