MCPcopy
hub / github.com/pocketbase/pocketbase / List

Method List

tools/filesystem/filesystem.go:178–197  ·  view source on GitHub ↗

List returns a flat list with info for all files under the specified prefix.

(prefix string)

Source from the content-addressed store, hash-verified

176
177// List returns a flat list with info for all files under the specified prefix.
178func (s *System) List(prefix string) ([]*blob.ListObject, error) {
179 files := []*blob.ListObject{}
180
181 iter := s.bucket.List(&blob.ListOptions{
182 Prefix: prefix,
183 })
184
185 for {
186 obj, err := iter.Next(s.ctx)
187 if err != nil {
188 if !errors.Is(err, io.EOF) {
189 return nil, err
190 }
191 break
192 }
193 files = append(files, obj)
194 }
195
196 return files, nil
197}
198
199// Upload writes content into the fileKey location.
200func (s *System) Upload(content []byte, fileKey string) error {

Callers 7

TestFileSystemListFunction · 0.45
DeletePrefixMethod · 0.45
IsEmptyDirMethod · 0.45
checkRecordFilesFunction · 0.45
backupsListFunction · 0.45
getBackupFilesFunction · 0.45

Calls 2

IsMethod · 0.80
NextMethod · 0.65

Tested by 3

TestFileSystemListFunction · 0.36
checkRecordFilesFunction · 0.36
getBackupFilesFunction · 0.36