mirror of
https://github.com/rclone/rclone.git
synced 2025-08-17 09:01:33 +02:00
link: allow creating public link to files and folders - closes #1562
This commit is contained in:
12
fs/fs.go
12
fs/fs.go
@ -328,6 +328,9 @@ type Features struct {
|
||||
// as an optional interface
|
||||
DirCacheFlush func()
|
||||
|
||||
// PublicLink generates a public link to the remote path (usually readable by anyone)
|
||||
PublicLink func(remote string) (string, error)
|
||||
|
||||
// Put in to the remote path with the modTime given of the given size
|
||||
//
|
||||
// May create the object even if it returns an error - if so
|
||||
@ -443,6 +446,9 @@ func (ft *Features) Fill(f Fs) *Features {
|
||||
if do, ok := f.(DirCacheFlusher); ok {
|
||||
ft.DirCacheFlush = do.DirCacheFlush
|
||||
}
|
||||
if do, ok := f.(PublicLinker); ok {
|
||||
ft.PublicLink = do.PublicLink
|
||||
}
|
||||
if do, ok := f.(PutUncheckeder); ok {
|
||||
ft.PutUnchecked = do.PutUnchecked
|
||||
}
|
||||
@ -642,6 +648,12 @@ type PutStreamer interface {
|
||||
PutStream(in io.Reader, src ObjectInfo, options ...OpenOption) (Object, error)
|
||||
}
|
||||
|
||||
// PublicLinker is an optional interface for Fs
|
||||
type PublicLinker interface {
|
||||
// PublicLink generates a public link to the remote path (usually readable by anyone)
|
||||
PublicLink(remote string) (string, error)
|
||||
}
|
||||
|
||||
// MergeDirser is an option interface for Fs
|
||||
type MergeDirser interface {
|
||||
// MergeDirs merges the contents of all the directories passed
|
||||
|
Reference in New Issue
Block a user