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

Method CompactIJson

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

Source from the content-addressed store, hash-verified

308}
309
310func (s *FileStore) CompactIJson(ctx context.Context, zoneId string, name string) error {
311 return withLock(s, zoneId, name, func(entry *CacheEntry) error {
312 err := entry.loadFileIntoCache(ctx)
313 if err != nil {
314 return err
315 }
316 if !entry.File.Opts.IJson {
317 return fmt.Errorf("file %s:%s is not an ijson file", zoneId, name)
318 }
319 return s.compactIJson(ctx, entry)
320 })
321}
322
323func (s *FileStore) AppendIJson(ctx context.Context, zoneId string, name string, command map[string]any) error {
324 data, err := ijson.ValidateAndMarshalCommand(command)

Callers 1

TestIJsonFunction · 0.80

Calls 3

compactIJsonMethod · 0.95
withLockFunction · 0.85
loadFileIntoCacheMethod · 0.80

Tested by 1

TestIJsonFunction · 0.64