ramdisk

package
v0.0.0-...-8218a20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2022 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RAMDisk

type RAMDisk struct {
	usbdlib.DefaultBlockSize
	// contains filtered or unexported fields
}

RAMDisk is a simple memory (heap) backed user-space block device

func NewRAMDisk

func NewRAMDisk(size int64) *RAMDisk

NewRAMDisk constructs a memory backed user-space device of the provided size

func (*RAMDisk) Close

func (rdsk *RAMDisk) Close() error

Close fufills io.Closer and in turn part of usbdlib.Device

func (*RAMDisk) Flush

func (rdsk *RAMDisk) Flush() error

Flush fufills part of usbdlib.Device

func (*RAMDisk) ReadAt

func (rdsk *RAMDisk) ReadAt(buf []byte, pos int64) (count int, err error)

ReadAt fufills io.ReaderAt and in turn part of usbdlib.Device

func (*RAMDisk) Size

func (rdsk *RAMDisk) Size() int64

Size of this device in bytes

func (*RAMDisk) Trim

func (rdsk *RAMDisk) Trim(pos int64, count int) error

Trim fufills part of usbdlib.Device

func (*RAMDisk) WriteAt

func (rdsk *RAMDisk) WriteAt(buf []byte, pos int64) (count int, err error)

WriteAt fufills io.WriterAt and in turn part of usbdlib.Device

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL