fake

package
v0.0.0-...-bbc9ce3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package fake provides a fake in-memory implementation of block.Device.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBlockSize indicates that one of the provided arguments is not a
	// multiple of BlockSize().
	ErrBlockSize = errors.New("argument is not a multiple of blocksize")

	// ErrOutOfBounds indicates that the requested range for a ReadAt or
	// WriteAt call is out of bounds.
	ErrOutOfBounds = errors.New("range is out of bounds")
)

Functions

This section is empty.

Types

type Device

type Device []byte

Device implements block.Device using a []byte.

func (Device) BlockSize

func (Device) BlockSize() int64

BlockSize implements block.Device.BlockSize for Device.

func (Device) Close

func (Device) Close() error

Close implements block.Device.Close for Device.

func (Device) Discard

func (Device) Discard(off, len int64) error

Discard implements block.Device.Discard for Device.

func (Device) Flush

func (Device) Flush() error

Flush implements block.Device.Flush for Device.

func (Device) ReadAt

func (d Device) ReadAt(p []byte, off int64) (int, error)

ReadAt implements block.Device.ReadAt for Device.

func (Device) Size

func (d Device) Size() int64

Size implements block.Device.Size for Device.

func (Device) WriteAt

func (d Device) WriteAt(p []byte, off int64) (int, error)

WriteAt implements block.Device.WriteAt for Device.

Jump to

Keyboard shortcuts

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