| 308 | } |
| 309 | |
| 310 | func (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 | |
| 323 | func (s *FileStore) AppendIJson(ctx context.Context, zoneId string, name string, command map[string]any) error { |
| 324 | data, err := ijson.ValidateAndMarshalCommand(command) |