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

Method ReadFile

pkg/filestore/blockstore.go:382–388  ·  view source on GitHub ↗

returns (offset, data, error)

(ctx context.Context, zoneId string, name string)

Source from the content-addressed store, hash-verified

380
381// returns (offset, data, error)
382func (s *FileStore) ReadFile(ctx context.Context, zoneId string, name string) (rtnOffset int64, rtnData []byte, rtnErr error) {
383 withLock(s, zoneId, name, func(entry *CacheEntry) error {
384 rtnOffset, rtnData, rtnErr = entry.readAt(ctx, 0, 0, true)
385 return nil
386 })
387 return
388}
389
390type FlushStats struct {
391 FlushDuration time.Duration

Callers 15

GetVarCommandMethod · 0.80
GetAllVarsCommandMethod · 0.80
SetVarCommandMethod · 0.80
copyDirFunction · 0.80
ReadAppFileFunction · 0.80
ReadAppManifestFunction · 0.80
ReadAppSecretBindingsFunction · 0.80
createPublicKeyCallbackFunction · 0.80
readConfigFileFSFunction · 0.80
getSystemSummaryFunction · 0.80

Calls 2

withLockFunction · 0.85
readAtMethod · 0.80

Tested by 5

TestAtomicWriteFileFunction · 0.64
checkFileDataFunction · 0.64
checkFileByteCountFunction · 0.64
TestCircularWritesFunction · 0.64
TestIJsonFunction · 0.64