xva

package
v0.0.0-...-79a645e Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sizer

type Sizer interface {
	Size() int64
}

Sizer is an interface that shouldn't exist in a vacuum, but does because our other image formats follow a similar patten and need more information. A Sizer should return the true and final RAW size of the image and be callable before the first byte of data is written to the Writer. Note that our vimg.Builder implements this interface and is the intended argument in most cases.

type Writer

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

Writer implements io.Closer, io.Writer, and io.Seeker interfaces. Creating an XVA image is as simple as getting one of these writers and copying a raw image into it.

func NewWriter

func NewWriter(w io.Writer, h Sizer, cfg *vcfg.VCFG) (*Writer, error)

NewWriter returns a Writer to which a RAW image can be copied in order to create an XVA format disk image. The Sizer 'h' must accurately return the true and final RAW size of the image.

func (*Writer) Close

func (w *Writer) Close() error

Close implements io.Closer

func (*Writer) Seek

func (w *Writer) Seek(offset int64, whence int) (int64, error)

Seek implements io.Seeker

func (*Writer) Write

func (w *Writer) Write(p []byte) (n int, err error)

Write implements io.Writer.

Jump to

Keyboard shortcuts

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