Documentation ¶
Overview ¶
Package nbd uses the Linux NBD layer to emulate a block device in user space
Index ¶
- Constants
- func FindDevice() (string, error)
- type Device
- type DeviceFinder
- type NBD
- func (nbd *NBD) Close() error
- func (nbd *NBD) Disconnect() error
- func (nbd *NBD) IsConnected() bool
- func (nbd *NBD) OpenDevice(dev string) (string, error)
- func (nbd *NBD) Serve() error
- func (nbd *NBD) SetBlockSize(blocksize int64) error
- func (nbd *NBD) SetSize(size int64) error
- func (nbd *NBD) Size() int64
- type NBDConn
- type NBDServer
Constants ¶
View Source
const (
// Defined in <linux/fs.h>:
BLKROSET = 4701
)
Variables ¶
This section is empty.
Functions ¶
func FindDevice ¶
Types ¶
type Device ¶
type Device interface { ReadAt(b []byte, off int64) (n int, err error) WriteAt(b []byte, off int64) (n int, err error) Sync() error Trim(off, len int64) error Size() uint64 Close() error }
Device interface is a subset of os.File.
type DeviceFinder ¶ added in v0.1.1
type NBD ¶
type NBD struct {
// contains filtered or unexported fields
}
func (*NBD) Disconnect ¶ added in v0.1.0
func (*NBD) SetBlockSize ¶ added in v0.1.0
type NBDServer ¶ added in v0.1.1
type NBDServer struct {
// contains filtered or unexported fields
}
func NewNBDServer ¶ added in v0.1.1
func NewNBDServer(addr string, finder DeviceFinder) (*NBDServer, error)
Click to show internal directories.
Click to hide internal directories.