added sftp client implementation
This commit is contained in:
parent
ad41ddbe54
commit
ce73f0472c
175 changed files with 28135 additions and 13 deletions
|
|
@ -5,10 +5,13 @@ package parse
|
|||
import (
|
||||
"cachefs/pkg/provider"
|
||||
"cachefs/pkg/provider/mount"
|
||||
"cachefs/pkg/provider/sftp"
|
||||
"errors"
|
||||
"fmt"
|
||||
neturl "net/url"
|
||||
"path/filepath"
|
||||
|
||||
"k8s.io/klog/v2/klogr"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -26,9 +29,9 @@ func FS(url string) (provider.FS, error) {
|
|||
}
|
||||
switch u.Scheme {
|
||||
case "file":
|
||||
return mount.NewFS(u.Path), nil
|
||||
//case "sftp":
|
||||
// return sftp.FS(u.Path), nil
|
||||
return mount.NewFS(u.Path)
|
||||
case "sftp":
|
||||
return sftp.NewFS(u, klogr.New().WithName("sftp"))
|
||||
}
|
||||
return nil, fmt.Errorf("%w: %s", ErrUnsupportedScheme, u.Scheme)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue