MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / ListFiles

Method ListFiles

pkg/filestore/blockstore.go:190–204  ·  view source on GitHub ↗
(ctx context.Context, zoneId string)

Source from the content-addressed store, hash-verified

188}
189
190func (s *FileStore) ListFiles(ctx context.Context, zoneId string) ([]*WaveFile, error) {
191 files, err := dbGetZoneFiles(ctx, zoneId)
192 if err != nil {
193 return nil, fmt.Errorf("error getting zone files: %v", err)
194 }
195 for idx, file := range files {
196 withLock(s, file.ZoneId, file.Name, func(entry *CacheEntry) error {
197 if entry.File != nil {
198 files[idx] = entry.File.DeepCopy()
199 }
200 return nil
201 })
202 }
203 return files, nil
204}
205
206func (s *FileStore) WriteMeta(ctx context.Context, zoneId string, name string, meta wshrpc.FileMeta, merge bool) error {
207 return withLock(s, zoneId, name, func(entry *CacheEntry) error {

Callers 2

BlockInfoCommandMethod · 0.80
TestDeleteFunction · 0.80

Calls 3

dbGetZoneFilesFunction · 0.85
withLockFunction · 0.85
DeepCopyMethod · 0.80

Tested by 1

TestDeleteFunction · 0.64