vhdfile

package
v0.0.0-...-10c22ef Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileFactory

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

FileFactory is a type to create VhdFile representing VHD in the local machine

func (*FileFactory) Create

func (f *FileFactory) Create(vhdPath string) (*VhdFile, error)

Create creates a new VhdFile representing a VHD in the local machine located at vhdPath

func (*FileFactory) CreateFromReaderAtReader

func (f *FileFactory) CreateFromReaderAtReader(r reader.ReadAtReader, size int64) (*VhdFile, error)

CreateFromReaderAtReader creates a new VhdFile from a reader.ReadAtReader, which is a reader associated with a VHD in the local machine. The parameter size is the size of the VHD in bytes

func (*FileFactory) Dispose

func (f *FileFactory) Dispose(err error)

Dispose disposes this instance of VhdFileFactory and VhdFileFactory instances of parent and child VHDs

type VhdFile

type VhdFile struct {
	// Footer represents the disk's footer.
	Footer *footer.Footer

	Header *header.Header
	// BlockAllocationTable represents the table holding absolute offset to the first sector
	// of blocks in the disk. Only Dynamic and Differencing disk has BAT.
	BlockAllocationTable *bat.BlockAllocationTable
	// VhdReader is the reader that can be used to read the disk.
	VhdReader *reader.VhdReader
	// Parent represents the parent VHD of Differencing disk, this field is nil for fixed
	// and dynamic disk.
	Parent *VhdFile
}

VhdFile represents a VHD.

func (*VhdFile) GetBlockFactory

func (f *VhdFile) GetBlockFactory() (block.Factory, error)

GetBlockFactory returns a BlockFactory instance that can be used to create Block instances that represents blocks in the disk.

func (*VhdFile) GetDiskType

func (f *VhdFile) GetDiskType() footer.DiskType

GetDiskType returns the type of the disk. Possible values are DiskTypeFixed, DiskTypeDynamic and DiskTypeDifferencing.

func (*VhdFile) GetIdentityChain

func (f *VhdFile) GetIdentityChain() []string

GetIdentityChain returns VHD identity chain, for differencing disk this will be a slice with unique ids of this and all it's ancestor disks. For fixed and dynamic disk, this will be a slice with one entry representing disk's unique id.

Jump to

Keyboard shortcuts

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