MCPcopy
hub / github.com/wavetermdev/waveterm / loadFileIntoCache

Method loadFileIntoCache

pkg/filestore/blockstore_cache.go:101–111  ·  view source on GitHub ↗

returns err if file does not exist

(ctx context.Context)

Source from the content-addressed store, hash-verified

99
100// returns err if file does not exist
101func (entry *CacheEntry) loadFileIntoCache(ctx context.Context) error {
102 if entry.File != nil {
103 return nil
104 }
105 file, err := entry.loadFileForRead(ctx)
106 if err != nil {
107 return err
108 }
109 entry.File = file
110 return nil
111}
112
113// does not populate the cache entry, returns err if file does not exist
114func (entry *CacheEntry) loadFileForRead(ctx context.Context) (*WaveFile, error) {

Callers 6

WriteMetaMethod · 0.80
WriteFileMethod · 0.80
WriteAtMethod · 0.80
AppendDataMethod · 0.80
CompactIJsonMethod · 0.80
AppendIJsonMethod · 0.80

Calls 1

loadFileForReadMethod · 0.95

Tested by

no test coverage detected