ReadDirAll shows all files in the current directory
(ctx context.Context)
| 274 | |
| 275 | // ReadDirAll shows all files in the current directory |
| 276 | func (o Object) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) { |
| 277 | objects, err := o.fs.client.GetObjectsByParent(o.objectID) |
| 278 | if nil != err { |
| 279 | Log.Debugf("%v", err) |
| 280 | return nil, fuse.ENOENT |
| 281 | } |
| 282 | |
| 283 | dirs := []fuse.Dirent{} |
| 284 | for _, object := range objects { |
| 285 | if object.IsDir { |
| 286 | dirs = append(dirs, fuse.Dirent{ |
| 287 | Name: object.Name, |
| 288 | Type: fuse.DT_Dir, |
| 289 | }) |
| 290 | } else { |
| 291 | dirs = append(dirs, fuse.Dirent{ |
| 292 | Name: object.Name, |
| 293 | Type: fuse.DT_File, |
| 294 | }) |
| 295 | } |
| 296 | } |
| 297 | return dirs, nil |
| 298 | } |
| 299 | |
| 300 | // Lookup tests if a file is existent in the current directory |
| 301 | func (o Object) Lookup(ctx context.Context, name string) (fs.Node, error) { |
nothing calls this directly
no test coverage detected