link: allow creating public link to files and folders - closes #1562
This commit is contained in:
parent
9df266a6b4
commit
a8267d1628
31 changed files with 275 additions and 41 deletions
|
@ -1470,6 +1470,15 @@ func Rcat(fdst fs.Fs, dstFileName string, in io.ReadCloser, modTime time.Time) (
|
|||
return dst, nil
|
||||
}
|
||||
|
||||
// PublicLink adds a "readable by anyone with link" permission on the given file or folder.
|
||||
func PublicLink(f fs.Fs, remote string) (string, error) {
|
||||
doPublicLink := f.Features().PublicLink
|
||||
if doPublicLink == nil {
|
||||
return "", errors.Errorf("%v doesn't support public links", f)
|
||||
}
|
||||
return doPublicLink(remote)
|
||||
}
|
||||
|
||||
// Rmdirs removes any empty directories (or directories only
|
||||
// containing empty directories) under f, including f.
|
||||
func Rmdirs(f fs.Fs, dir string, leaveRoot bool) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue