Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlignedBuffer ¶
AlignedBuffer allocates aligned buffer.
Allocate a buffer of at least size bytes, aligned to align bytes.
size and align must be multiple of 512 bytes.
Examples:
AlignedBuffer(1048576, 4096)
func OpenFile ¶
OpenFile opens a file with direct I/O enabled.
Write and read to the file must use AlignedBuffer.
func Receive ¶
func Receive(path string, reader io.Reader, size int64, offset int64, progress Progress) (received int64, err error)
Receive copies size bytes from reader to path, staring at offset.
Todo:
- Check the option of Operation struct keeping the current progress, like the Python version. Can be useful when we need to add cancling support.
- There are too many parameters, would be nice to accept options struct instead.
Types ¶
Click to show internal directories.
Click to hide internal directories.