disk

package
v0.0.0-...-845907b Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2016 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

22 october 2015

Index

Constants

View Source
const SectorSize = 512

Variables

This section is empty.

Functions

This section is empty.

Types

type Disk

type Disk struct {
	// contains filtered or unexported fields
}

Disk is currently not safe for concurrent use.

func Open

func Open(filename string, size int64) (d *Disk, err error)

func (*Disk) Close

func (d *Disk) Close() error

func (*Disk) Iter

func (d *Disk) Iter(startAt int64, countPer int) (*SectorIter, error)

func (*Disk) ReadSectorsAt

func (d *Disk) ReadSectorsAt(sectors []byte, pos int64) (int, error)

func (*Disk) ReverseIter

func (d *Disk) ReverseIter(startAt int64) (*SectorIter, error)

TODO allow different sized iter blocks if we ever split this into its own package; this requires handling the last short read in Next()

func (*Disk) Size

func (d *Disk) Size() int64

type SectorIter

type SectorIter struct {
	// contains filtered or unexported fields
}

func (*SectorIter) Err

func (s *SectorIter) Err() error

func (*SectorIter) Next

func (s *SectorIter) Next() bool

func (*SectorIter) Pos

func (s *SectorIter) Pos() int64

func (*SectorIter) Sectors

func (s *SectorIter) Sectors() []byte

Jump to

Keyboard shortcuts

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