image

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

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 22 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFileInfo

func CheckFileInfo(ctx context.Context, fileName string, fileInfo FileInfo) (err error)

CheckFileInfo checks if file matches FileInfo.

func Copy

func Copy(dst, src string) (copied int64, err error)

Copy copies one file content to another.

func CopyFromGzipArchive

func CopyFromGzipArchive(dst, src string) (copied int64, err error)

CopyFromGzipArchive copies gzip archive to file.

func CopyFromGzipArchiveToDevice

func CopyFromGzipArchiveToDevice(dst, src string, direct bool) (copied int64, err error)

CopyFromGzipArchiveToDevice copies gzip archive to device.

func CopyToDevice

func CopyToDevice(dst, src string, direct bool) (copied int64, err error)

CopyToDevice copies file content to device.

func Download

func Download(ctx context.Context, destination, url string) (fileName string, err error)

Download downloads the file by url.

func GetImageManifest

func GetImageManifest(imagePath string) (*aostypes.ServiceManifest, error)

GetImageManifest gets image manifest data from file.

func GetLayersFromManifest

func GetLayersFromManifest(manifest *aostypes.ServiceManifest) (layers []string)

GetLayersFromManifest gets image layers.

func GetUncompressedTarContentSize

func GetUncompressedTarContentSize(path string) (size int64, err error)

GetUncompressedTarContentSize calculates tar content size.

func UnpackTarImage

func UnpackTarImage(source, destination string) error

UnpackTarImage extracts tar image.

func UntarGZArchive

func UntarGZArchive(ctx context.Context, source, destination string) (err error)

UntarGZArchive extract data from tar.gz archive.

func ValidateDigest

func ValidateDigest(installDir string, digest digest.Digest) (err error)

ValidateDigest validates digest.

Types

type FileInfo

type FileInfo struct {
	Sha256 []byte
	Sha512 []byte
	Size   uint64
}

FileInfo file info.

func CreateFileInfo

func CreateFileInfo(ctx context.Context, fileName string) (fileInfo FileInfo, err error)

CreateFileInfo creates FileInfo from existing file.

Jump to

Keyboard shortcuts

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