Documentation ¶
Overview ¶
Package scan does concurrent scanning of an Fs building up a directory tree.
Index ¶
- func Scan(ctx context.Context, f fs.Fs) (chan *Dir, chan error, chan struct{})
- type Attrs
- type Dir
- func (d *Dir) Attr() (size int64, count int64)
- func (d *Dir) AttrI(i int) (attrs Attrs, err error)
- func (d *Dir) AttrWithModTimeI(ctx context.Context, i int) (attrs Attrs, err error)
- func (d *Dir) Entries() fs.DirEntries
- func (d *Dir) GetDir(i int) (subDir *Dir, isDir bool)
- func (d *Dir) Parent() *Dir
- func (d *Dir) Path() string
- func (d *Dir) Remove(i int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attrs ¶
type Attrs struct { ModTime time.Time Size int64 Count int64 CountUnknownSize int64 IsDir bool Readable bool EntriesHaveErrors bool }
Attrs contains accumulated properties for a directory entry
Files with unknown size are counted separately but also included in the total count. They are not included in the size, i.e. treated as empty files, which means the size may be underestimated.
func (*Attrs) AverageSize ¶
AverageSize calculates average size of files in directory
If there are files with unknown size, this returns the average over files with known sizes, which means it may be under- or overestimated.
type Dir ¶
type Dir struct {
// contains filtered or unexported fields
}
Dir represents a directory found in the remote
func (*Dir) AttrWithModTimeI ¶
AttrWithModTimeI returns the modtime, size, count and flags for the i-th directory entry
func (*Dir) Entries ¶
func (d *Dir) Entries() fs.DirEntries
Entries returns a copy of the entries in the directory
func (*Dir) GetDir ¶
GetDir returns the Dir of the i-th entry
returns nil if it is a file returns a flag as to whether is directory or not