page_chunk.go 350 B

12345678910111213141516
  1. package page_writer
  2. import (
  3. "io"
  4. )
  5. type SaveToStorageFunc func(reader io.Reader, offset int64, size int64, cleanupFn func())
  6. type PageChunk interface {
  7. FreeResource()
  8. WriteDataAt(src []byte, offset int64) (n int)
  9. ReadDataAt(p []byte, off int64) (maxStop int64)
  10. IsComplete() bool
  11. WrittenSize() int64
  12. SaveContent(saveFn SaveToStorageFunc)
  13. }