Documentation ¶
Overview ¶
Package testonly provides support for storage tests.
Index ¶
Constants ¶
View Source
const MemBlockSize = 512
MemBlockSize is the number of bytes in a single memory block.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemDev ¶
type MemDev struct { Storage [][MemBlockSize]byte // OnBlockWritten is called just after a mem block has been written. OnBlockWritten func(lba uint) }
MemDev is a simple in-memory block device.
func (MemDev) ReadBlocks ¶
ReadBlocks reads len(b) bytes into b from contiguous storage blocks starting at the given block address. b must be an integer multiple of the device's block size.
func (MemDev) WriteBlocks ¶
WriteBlocks writes len(b) bytes from b to contiguous storage blocks starting at the given block address. b must be an integer multiple of the device's block size.
Returns the number of blocks written, or an error.
Click to show internal directories.
Click to hide internal directories.