azure

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiskType

type DiskType uint32

DiskType is the kind of disk created using the Azure API.

const (
	// DiskTypeUnknown is default value for DiskType.
	DiskTypeUnknown DiskType = iota
	// DiskTypeNormal creates a normal Azure disk (single block device).
	DiskTypeNormal
	// DiskTypeWithVMGS creates a disk with VMGS (also called secure disk)
	// that has an additional block device for the VMGS disk.
	DiskTypeWithVMGS
)

func FromString

func FromString(s string) DiskType

FromString converts a string into an DiskType.

func (DiskType) String

func (i DiskType) String() string

type Prepper

type Prepper struct{}

func (*Prepper) Prepare

func (p *Prepper) Prepare(_ context.Context, imagePath, _ string) (string, error)

type Uploader

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

Uploader can upload and remove os images on Azure.

func NewUploader

func NewUploader(config config.Config, log *log.Logger) (*Uploader, error)

NewUploader creates a new config.

func (*Uploader) Upload

func (u *Uploader) Upload(ctx context.Context, image io.ReadSeeker, size int64) (refs []string, retErr error)

Upload uploads an OS image to Azure.

type VHDFixedHeader

type VHDFixedHeader struct {
	Cookie             [8]byte   // offset 0
	Features           [4]byte   // offset 8
	FileFormatVersion  [4]byte   // offset 12
	DataOffset         [8]byte   // offset 16
	Timestamp          [4]byte   // offset 24
	CreatorApplication [4]byte   // offset 28
	CreatorVersion     [4]byte   // offset 32
	CreatorHostOS      [4]byte   // offset 36
	OriginalSize       [8]byte   // offset 40
	CurrentSize        [8]byte   // offset 48
	DiskGeometry       [4]byte   // offset 56
	DiskType           [4]byte   // offset 60
	Checksum           [4]byte   // offset 64
	UniqueId           [16]byte  // offset 68
	SavedState         [1]byte   // offset 84
	Reserved           [427]byte // offset 85
}

VHDFixedHeader is the fixed size (512 byte) trailing header of a VHD file.

Jump to

Keyboard shortcuts

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