(path string)
| 43 | } |
| 44 | |
| 45 | func getDirEntries(path string) ([]model.Obj, error) { |
| 46 | ctx := context.Background() |
| 47 | meta, _ := op.GetNearestMeta(path) |
| 48 | fi, err := fs.Get(context.WithValue(ctx, conf.MetaKey, meta), path, &fs.GetArgs{}) |
| 49 | if errs.IsNotFoundError(err) { |
| 50 | return nil, gofakes3.ErrNoSuchKey |
| 51 | } else if err != nil { |
| 52 | return nil, gofakes3.ErrNoSuchKey |
| 53 | } |
| 54 | |
| 55 | if !fi.IsDir() { |
| 56 | return nil, gofakes3.ErrNoSuchKey |
| 57 | } |
| 58 | |
| 59 | dirEntries, err := fs.List(context.WithValue(ctx, conf.MetaKey, meta), path, &fs.ListArgs{}) |
| 60 | if err != nil { |
| 61 | return nil, err |
| 62 | } |
| 63 | |
| 64 | return dirEntries, nil |
| 65 | } |
| 66 | |
| 67 | // func getFileHashByte(node interface{}) []byte { |
| 68 | // b, err := hex.DecodeString(getFileHash(node)) |
no test coverage detected