mirror of
https://github.com/rclone/rclone.git
synced 2025-08-17 00:51:34 +02:00
fspath: Implement a connection string parser #4996
This is implemented as a state machine parser so it can emit sensible error messages. It does not use the connection strings elsewhere in rclone yet - see subsequent commits. An optional fuzzer is implemented for the Parse function.
This commit is contained in:
4
fs/fs.go
4
fs/fs.go
@ -1206,10 +1206,12 @@ func MustFind(name string) *RegInfo {
|
||||
// ParseRemote deconstructs a path into configName, fsPath, looking up
|
||||
// the fsName in the config file (returning NotFoundInConfigFile if not found)
|
||||
func ParseRemote(path string) (fsInfo *RegInfo, configName, fsPath string, err error) {
|
||||
configName, fsPath, err = fspath.Parse(path)
|
||||
parsed, err := fspath.Parse(path)
|
||||
if err != nil {
|
||||
return nil, "", "", err
|
||||
}
|
||||
configName, fsPath = parsed.Name, parsed.Path
|
||||
// FIXME do something with parsed.Config
|
||||
var fsName string
|
||||
var ok bool
|
||||
if configName != "" {
|
||||
|
Reference in New Issue
Block a user