formats

package
v0.0.0-...-4cb4cf9 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VmxTemplateVarName = "VMXTEMPLATE"
	OvfVarName         = "OVFINFO"
	OvaType            = "ova"
)

OvaType represents the ova format

View Source
const (
	// VhdType represents the vhd virtual drive format
	VhdType = "vhd"

	// VhdxType represents the vhdx virtual drive format
	VhdxType = "vhdx"
)
View Source
const DiffType = "diff"

DiffType represents the diff file system format

View Source
const Ext4Type = "ext4"

Ext4Type represents the ext4 file system format

View Source
const GzipType = "gz"

GzipType represents the gzip format

View Source
const InitrdType = "initrd"

InitrdType represents the format for a compressed initrd file loaded by the Linux kernel at boot

View Source
const (
	// QcowType represents the qcow2 virtual drive format
	QcowType = "qcow2"
)
View Source
const RawType = "raw"

RawType represents the raw format (no conversion)

View Source
const RdiffType = "rdiff"

RdiffType represents the rdiff file system format

View Source
const SquashFSType = "squashfs"

SquashFSType represents the squashfs format

View Source
const TarGzipType = "tar.gz"

TarGzipType represents the tar.gz format

View Source
const TarXzType = "tar.xz"

TarXzType represents the tar.xz format

View Source
const XzType = "xz"

XzType represents the xz format

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

type Converter interface {
	Convert(input, output string, isInputFile bool) error
	Extension() string
}

Converter allows to save the raw disk image as a different image format

type Diff

type Diff struct {
}

Diff implements Converter interface for Diff partitions

func NewDiff

func NewDiff() *Diff

NewDiff returns a new xz format encoder

func (*Diff) Convert

func (e *Diff) Convert(input, output string, isInputFile bool) (err error)

Convert simply makes a copy of the RAW image and renames the extension to .diff

func (*Diff) Extension

func (e *Diff) Extension() string

Extension returns the filetype extension produced by this converter.

type Ext4

type Ext4 struct {
}

Ext4 implements Converter interface for Ext4 partitions

func NewExt4

func NewExt4() *Ext4

NewExt4 returns a new xz format encoder

func (*Ext4) Convert

func (e *Ext4) Convert(input, output string, isInputFile bool) (err error)

Convert simply makes a copy of the RAW image and renames the extension to ext4

func (*Ext4) Extension

func (e *Ext4) Extension() string

Extension returns the filetype extension produced by this converter.

type Gzip

type Gzip struct {
}

Gzip implements Converter interface to convert a RAW image into a gzipped file

func NewGzip

func NewGzip() *Gzip

NewGzip returns a new Gzip format encoder

func (*Gzip) Convert

func (g *Gzip) Convert(input, output string, isInputFile bool) (err error)

Convert converts the image in the Gzip format

func (*Gzip) Extension

func (g *Gzip) Extension() string

Extension returns the filetype extension produced by this converter.

type Initrd

type Initrd struct {
}

Initrd implements Converter interface to convert a directory into an initrd.

func NewInitrd

func NewInitrd() *Initrd

NewInitrd returns a new Initrd format encoder

func (*Initrd) Convert

func (i *Initrd) Convert(input, output string, isInputFile bool) (err error)

Convert converts the image in the initrd.img format

func (*Initrd) Extension

func (i *Initrd) Extension() string

Extension returns the filetype extension produced by this converter.

type Ova

type Ova struct {
}

Ova implements Converter interface to convert a RAW image into an OVA file

func NewOva

func NewOva() *Ova

NewOva returns a new .OVA format encoder

func (*Ova) Convert

func (o *Ova) Convert(input, output string, isInputFile bool) (err error)

Convert converts the image in the OVA format

func (*Ova) Extension

func (o *Ova) Extension() string

Extension returns the filetype extension produced by this converter.

type Qcow

type Qcow struct {
}

Qcow implements Converter interface to convert a RAW image into a qcow2 file

func NewQcow

func NewQcow() *Qcow

NewQcow returns a new qcow format encoder

func (*Qcow) Convert

func (v *Qcow) Convert(input, output string, isInputFile bool) (err error)

Convert converts the image in the qcow2 format

func (*Qcow) Extension

func (v *Qcow) Extension() string

Extension returns the filetype extension produced by this converter.

type Raw

type Raw struct {
}

Raw implements Converter interface for RAW images

func NewRaw

func NewRaw() *Raw

NewRaw returns a new xz format encoder

func (*Raw) Convert

func (r *Raw) Convert(input, output string, isInputFile bool) (err error)

Convert simply makes a copy of the RAW image

func (*Raw) Extension

func (r *Raw) Extension() string

Extension returns the filetype extension produced by this converter.

type Rdiff

type Rdiff struct {
}

Rdiff implements Converter interface for Rdiff partitions

func NewRdiff

func NewRdiff() *Rdiff

NewRdiff returns a new xz format encoder

func (*Rdiff) Convert

func (e *Rdiff) Convert(input, output string, isInputFile bool) (err error)

Convert simply makes a copy of the RAW image and renames the extension to .diff

func (*Rdiff) Extension

func (e *Rdiff) Extension() string

Extension returns the filetype extension produced by this converter.

type SquashFS

type SquashFS struct {
}

SquashFS implements Converter interface to convert a RAW image into a squashfs file

func NewSquashFS

func NewSquashFS() *SquashFS

NewSquashFS returns a new SquashFS format encoder

func (*SquashFS) Convert

func (t *SquashFS) Convert(input, output string, isInputFile bool) (err error)

Convert converts the image in the squashfs format

func (*SquashFS) Extension

func (t *SquashFS) Extension() string

Extension returns the filetype extension produced by this converter.

type TarGzip

type TarGzip struct {
}

TarGzip implements Converter interface to convert a RAW image into a tar.gz file

func NewTarGzip

func NewTarGzip() *TarGzip

NewTarGzip returns a new TarGzip format encoder

func (*TarGzip) Convert

func (t *TarGzip) Convert(input, output string, isInputFile bool) (err error)

Convert converts the image in the tar.gz format

func (*TarGzip) Extension

func (t *TarGzip) Extension() string

Extension returns the filetype extension produced by this converter.

type TarXz

type TarXz struct {
}

TarXz implements Converter interface to convert a RAW image into a tar.xz file

func NewTarXz

func NewTarXz() *TarXz

NewTarXz returns a new TarXz format encoder

func (*TarXz) Convert

func (t *TarXz) Convert(input, output string, isInputFile bool) (err error)

Convert converts the image in the tar.xz format

func (*TarXz) Extension

func (t *TarXz) Extension() string

Extension returns the filetype extension produced by this converter.

type Vhd

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

Vhd implements Converter interface to convert a RAW image into a VHD(x) file

func NewVhd

func NewVhd(generation2 bool) *Vhd

NewVhd returns a new Vhd(x) format encoder

func (*Vhd) Convert

func (v *Vhd) Convert(input, output string, isInputFile bool) (err error)

Convert converts the image in the VHD(x) format

func (*Vhd) Extension

func (v *Vhd) Extension() string

Extension returns the filetype extension produced by this converter.

type Xz

type Xz struct {
}

Xz implements Converter interface to convert a RAW image into a xz file

func NewXz

func NewXz() *Xz

NewXz returns a new xz format encoder

func (*Xz) Convert

func (x *Xz) Convert(input, output string, isInputFile bool) (err error)

Convert converts the image in the xz format

func (*Xz) Extension

func (x *Xz) Extension() string

Extension returns the filetype extension produced by this converter.

Jump to

Keyboard shortcuts

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