returns (offset, data, error) we return the offset because the offset may have been adjusted if the size was too big (for circular files)
(ctx context.Context, zoneId string, name string, offset int64, size int64)
| 368 | // returns (offset, data, error) |
| 369 | // we return the offset because the offset may have been adjusted if the size was too big (for circular files) |
| 370 | func (s *FileStore) ReadAt(ctx context.Context, zoneId string, name string, offset int64, size int64) (rtnOffset int64, rtnData []byte, rtnErr error) { |
| 371 | if size < 0 || size > math.MaxInt { |
| 372 | return 0, nil, fmt.Errorf("size must be non-negative and less than MaxInt") |
| 373 | } |
| 374 | withLock(s, zoneId, name, func(entry *CacheEntry) error { |
| 375 | rtnOffset, rtnData, rtnErr = entry.readAt(ctx, offset, size, false) |
| 376 | return nil |
| 377 | }) |
| 378 | return |
| 379 | } |
| 380 | |
| 381 | // returns (offset, data, error) |
| 382 | func (s *FileStore) ReadFile(ctx context.Context, zoneId string, name string) (rtnOffset int64, rtnData []byte, rtnErr error) { |