if file doesn't exsit, returns fs.ErrNotExist
(ctx context.Context, zoneId string, name string)
| 175 | |
| 176 | // if file doesn't exsit, returns fs.ErrNotExist |
| 177 | func (s *FileStore) Stat(ctx context.Context, zoneId string, name string) (*WaveFile, error) { |
| 178 | return withLockRtn(s, zoneId, name, func(entry *CacheEntry) (*WaveFile, error) { |
| 179 | file, err := entry.loadFileForRead(ctx) |
| 180 | if err != nil { |
| 181 | if err == fs.ErrNotExist { |
| 182 | return nil, err |
| 183 | } |
| 184 | return nil, fmt.Errorf("error getting file: %v", err) |
| 185 | } |
| 186 | return file.DeepCopy(), nil |
| 187 | }) |
| 188 | } |
| 189 | |
| 190 | func (s *FileStore) ListFiles(ctx context.Context, zoneId string) ([]*WaveFile, error) { |
| 191 | files, err := dbGetZoneFiles(ctx, zoneId) |