media

package
v0.0.0-...-fbfb194 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachToMountPoint

func AttachToMountPoint(ctx context.Context, fileSystem afero.Fs, device Entry, configureResolvConf bool) error

func CleanUp

func CleanUp(ctx context.Context, fileSystem afero.Fs, device Entry) error

func CompressImage

func CompressImage(ctx context.Context, fileSystem afero.Fs, client *storage.Client) (string, error)

func DownloadAndVerifyMedia

func DownloadAndVerifyMedia(ctx context.Context, fileSystem afero.Fs, forceOverwrite bool) error

func DownloadFile

func DownloadFile(ctx context.Context, fileSystem afero.Fs, fileName string, url string) error

func ExpandSize

func ExpandSize(ctx context.Context) error

func ExtractImage

func ExtractImage(ctx context.Context) (string, error)

func FileSystemExpansion

func FileSystemExpansion(ctx context.Context, device Entry) error

func Flash

func Flash(ctx context.Context, device string, entry Entry) error

func MountMedia

func MountMedia(ctx context.Context, fileSystem afero.Fs, device string) error

func UploadImage

func UploadImage(ctx context.Context, fileSystem afero.Fs, fileName string, client *storage.Client) error

func ValidateHashes

func ValidateHashes(ctx context.Context, fileName string, mediaBytes []byte, checksumBytes []byte) error

Types

type DeviceOutput

type DeviceOutput struct {
	Loopdevices []Entry `json:"loopdevices"`
}

func (DeviceOutput) ToMap

func (o DeviceOutput) ToMap() map[string]Entry

type Entry

type Entry struct {
	Name      string `json:"name"`
	Sizelimit int    `json:"sizelimit"`
	Offset    int    `json:"offset"`
	Autoclear bool   `json:"autoclear"`
	Ro        bool   `json:"ro"`
	BackFile  string `json:"back-file"`
	Dio       bool   `json:"dio"`
	LogSec    int    `json:"log-sec"`
}

func MountImageToDevice

func MountImageToDevice(ctx context.Context, imageFile string) (Entry, error)

type PartitionEntry

type PartitionEntry struct {
	Number     uint64
	Start      datasize.ByteSize
	End        datasize.ByteSize
	Size       datasize.ByteSize
	FileSystem string
}

Jump to

Keyboard shortcuts

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