Documentation ¶
Index ¶
Constants ¶
const ImageFormatOVA = vdisk.Format("ova")
ImageFormatOVA ...
Variables ¶
This section is empty.
Functions ¶
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 OVA image is as simple as getting one of these writers and copying a raw image into it.
func NewWriter ¶
NewWriter Creates a tar writer and a VMDK Stream Optimized Writer. The OVA writer wraps the VMDK writer and will write the raw image directly to it. The OVA will only be constructed on the .Close() function, and will do so by adding the built vmdk and a generated ovf to a tar archive. The vmdk writer writes to a temp file.
func (*Writer) Close ¶
Close does the following steps: 1) Close VMDK writer 2) Generate OVF 3) Tar OVF and VMDK, and write that to the OVA 4) Clean up VMDK in temp directory.