firmwarerepo

package
v0.0.0-...-f44e450 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractFirmwareFromTarball

func ExtractFirmwareFromTarball(ctx context.Context, tarball []byte) (*uefi.UEFI, string, error)

ExtractFirmwareFromTarball returns a firmware image extracted from tarball.

func ExtractFirmwareImage

func ExtractFirmwareImage(ctx context.Context, originalFilename string, data []byte) (*uefi.UEFI, string, error)

ExtractFirmwareImage tries to extract firmware image from the data obtained by FirmwareStorage

func ParseFirmwareImage

func ParseFirmwareImage(ctx context.Context, data []byte) *uefi.UEFI

ParseFirmwareImage checks if input data represents a firmware image

Types

type ErrGetMeta

type ErrGetMeta struct {
	Err error
}

ErrGetMeta implements "error", for the description see Error.

func (ErrGetMeta) Error

func (err ErrGetMeta) Error() string

func (ErrGetMeta) Unwrap

func (err ErrGetMeta) Unwrap() error

type ErrHTTPGet

type ErrHTTPGet struct {
	Err error
	URL string
}

ErrHTTPGet implements "error", for the description see Error.

func (ErrHTTPGet) Error

func (err ErrHTTPGet) Error() string

func (ErrHTTPGet) Unwrap

func (err ErrHTTPGet) Unwrap() error

type ErrHTTPGetBody

type ErrHTTPGetBody struct {
	Err error
	URL string
}

ErrHTTPGetBody implements "error", for the description see Error.

func (ErrHTTPGetBody) Error

func (err ErrHTTPGetBody) Error() string

func (ErrHTTPGetBody) Unwrap

func (err ErrHTTPGetBody) Unwrap() error

type ErrHTTPMakeRequest

type ErrHTTPMakeRequest struct {
	Err error
	URL string
}

ErrHTTPMakeRequest implements "error", for the description see Error.

func (ErrHTTPMakeRequest) Error

func (err ErrHTTPMakeRequest) Error() string

func (ErrHTTPMakeRequest) Unwrap

func (err ErrHTTPMakeRequest) Unwrap() error

type ErrNoFirmwareFoundInTarGZ

type ErrNoFirmwareFoundInTarGZ struct {
}

ErrNoFirmwareFoundInTarGZ implements "error", for the description see Error.

func (ErrNoFirmwareFoundInTarGZ) Error

func (err ErrNoFirmwareFoundInTarGZ) Error() string

type ErrParseURL

type ErrParseURL struct {
	Err error
	URL string
}

ErrParseURL implements "error", for the description see Error.

func (ErrParseURL) Error

func (err ErrParseURL) Error() string

func (ErrParseURL) Unwrap

func (err ErrParseURL) Unwrap() error

type ErrUnknownFirmwareImage

type ErrUnknownFirmwareImage struct {
}

ErrUnknownFirmwareImage represents situation when firmware image has unknown format

func (ErrUnknownFirmwareImage) Error

func (err ErrUnknownFirmwareImage) Error() string

type FirmwareRepo

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

FirmwareRepo is responsible for providing an original image of a specified firmware version. Currently it is implemented through ugly logic of downloading a tarball and looking for image from it.

TODO: reimplement this logic to download images from Everstore/BlobStorage.

func New

func New(
	baseURL string,
	callerName string,
) *FirmwareRepo

New returns an instance of FirmwareRepo.

func (*FirmwareRepo) DownloadByVersion

func (storage *FirmwareRepo) DownloadByVersion(ctx context.Context, filename string) ([]byte, string, error)

DownloadByVersion downloads a raw firmware file by its name

func (*FirmwareRepo) FetchFirmwareByURL

func (fwRepo *FirmwareRepo) FetchFirmwareByURL(
	ctx context.Context,
	url string,
) (imageBytes []byte, filename string, err error)

FetchFirmwareByURL returns a firmware image by URL.

Jump to

Keyboard shortcuts

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