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

Method compactIJson

pkg/filestore/blockstore.go:296–308  ·  view source on GitHub ↗
(ctx context.Context, entry *CacheEntry)

Source from the content-addressed store, hash-verified

294}
295
296func (s *FileStore) compactIJson(ctx context.Context, entry *CacheEntry) error {
297 // we don't need to lock the entry because we have the lock on the filestore
298 _, fullData, err := entry.readAt(ctx, 0, 0, true)
299 if err != nil {
300 return err
301 }
302 newBytes, err := ijson.CompactIJson(fullData, entry.File.Opts.IJsonBudget)
303 if err != nil {
304 return err
305 }
306 entry.writeAt(0, newBytes, true)
307 return nil
308}
309
310func (s *FileStore) CompactIJson(ctx context.Context, zoneId string, name string) error {
311 return withLock(s, zoneId, name, func(entry *CacheEntry) error {

Callers 2

CompactIJsonMethod · 0.95
AppendIJsonMethod · 0.95

Calls 3

CompactIJsonFunction · 0.92
readAtMethod · 0.80
writeAtMethod · 0.80

Tested by

no test coverage detected