1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-04 17:43:50 +00:00

about: add new command 'about' to get quota info from a remote

Implemented for drive only.

Relates to #1138 and #1564.
This commit is contained in:
a-roussos
2018-02-09 22:48:32 +02:00
committed by Nick Craig-Wood
parent b83814082b
commit 94e277d759
9 changed files with 130 additions and 21 deletions

View File

@@ -377,6 +377,9 @@ type Features struct {
// Don't implement this unless you have a more efficient way
// of listing recursively that doing a directory traversal.
ListR ListRFn
// Get quota information from the Fs
About func() error
}
// Disable nil's out the named feature. If it isn't found then it
@@ -466,6 +469,9 @@ func (ft *Features) Fill(f Fs) *Features {
if do, ok := f.(ListRer); ok {
ft.ListR = do.ListR
}
if do, ok := f.(Abouter); ok {
ft.About = do.About
}
return ft.DisableList(Config.DisableFeatures)
}
@@ -519,6 +525,9 @@ func (ft *Features) Mask(f Fs) *Features {
if mask.ListR == nil {
ft.ListR = nil
}
if mask.About == nil {
ft.About = nil
}
return ft.DisableList(Config.DisableFeatures)
}
@@ -706,6 +715,12 @@ type RangeSeeker interface {
RangeSeek(offset int64, whence int, length int64) (int64, error)
}
// Abouter is an optional interface for Fs
type Abouter interface {
// About gets quota information from the Fs
About() error
}
// ObjectsChan is a channel of Objects
type ObjectsChan chan Object