metadata

package
v1.0.0-...-746469e Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const UpdateMetadataFilename = "updatemetadata.json"

Variables

This section is empty.

Functions

This section is empty.

Types

type CompressedObject

type CompressedObject struct {
	CompressedSize   float64 `json:"required-compressed-size"`
	UncompressedSize float64 `json:"required-uncompressed-size"`
}

type FirmwareMetadata

type FirmwareMetadata struct {
	ProductUID       string            `json:"product-uid"`
	DeviceIdentity   map[string]string `json:"device-identity"`
	Version          string            `json:"version"`
	Hardware         string            `json:"hardware"`
	DeviceAttributes map[string]string `json:"device-attributes"`
}

func NewFirmwareMetadata

func NewFirmwareMetadata(basePath string, store afero.Fs, cmd utils.CmdLineExecuter) (*FirmwareMetadata, error)

func (*FirmwareMetadata) CheckSupportedHardware

func (fm *FirmwareMetadata) CheckSupportedHardware(um *UpdateMetadata) error

type Object

type Object interface {
	Setup() error
	Install(downloadDir string) error
	Cleanup() error

	GetObjectMetadata() ObjectMetadata
}

func NewObjectMetadata

func NewObjectMetadata(bytes []byte) (Object, error)

type ObjectMetadata

type ObjectMetadata struct {
	Object `json:"-"`

	Sha256sum          string      `json:"sha256sum"`
	Mode               string      `json:"mode"`
	Size               int64       `json:"size"`
	Compressed         bool        `json:"bool"`
	InstallIfDifferent interface{} `json:"install-if-different,omitempty"`
}

ObjectMetadata contains the common properties of a package's object from JSON metadata

func (ObjectMetadata) GetObjectMetadata

func (o ObjectMetadata) GetObjectMetadata() ObjectMetadata

type SupportedHardwareChecker

type SupportedHardwareChecker interface {
	CheckSupportedHardware(um *UpdateMetadata) error
}

type UpdateMetadata

type UpdateMetadata struct {
	ProductUID        string      `json:"product"`
	Version           string      `json:"version"`
	Objects           [][]Object  `json:"-"`
	SupportedHardware interface{} `json:"supported-hardware"`
	RawBytes          []byte
}

func NewUpdateMetadata

func NewUpdateMetadata(bytes []byte) (*UpdateMetadata, error)

func (*UpdateMetadata) PackageUID

func (m *UpdateMetadata) PackageUID() string

func (*UpdateMetadata) VerifySignature

func (m *UpdateMetadata) VerifySignature(key *rsa.PublicKey, signature []byte) bool

Jump to

Keyboard shortcuts

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