File: block_device.go

package info (click to toggle)
golang-github-mitchellh-go-fs 0.0~git20150611.0.a34c1b9-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 160 kB
  • ctags: 141
  • sloc: makefile: 2
file content (22 lines) | stat: -rw-r--r-- 721 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package fs

// A BlockDevice is the raw device that is meant to store a filesystem.
type BlockDevice interface {
	// Closes this block device. No more methods may be called on a
	// closed device.
	Close() error

	// Len returns the number of bytes in this block device.
	Len() int64

	// SectorSize returns the size of a single sector on this device.
	SectorSize() int

	// ReadAt reads data from the block device from the given
	// offset. See io.ReaderAt for more information on this function.
	ReadAt(p []byte, off int64) (n int, err error)

	// WriteAt writes data to the block device at the given offset.
	// See io.WriterAt for more information on this function.
	WriteAt(p []byte, off int64) (n int, err error)
}