firmwareindex

package
v0.0.0-...-fc75a81 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index struct {
	Boards    []*IndexBoard
	IsTrusted bool
}

Index represents Boards struct as seen from module_firmware_index.json file.

func LoadIndex

func LoadIndex(jsonIndexFile *paths.Path) (*Index, error)

LoadIndex reads a module_firmware_index.json from a file and returns the corresponding Index structure.

func LoadIndexNoSign

func LoadIndexNoSign(jsonIndexFile *paths.Path) (*Index, error)

LoadIndexNoSign reads a module_firmware_index.json from a file and returns the corresponding Index structure.

func (*Index) GetBoard

func (i *Index) GetBoard(fqbn string) *IndexBoard

GetBoard returns the IndexBoard for the given FQBN

func (*Index) MergeWith

func (i *Index) MergeWith(j *Index)

MergeWith merge this index with the other given index (the boards from the other index) are added to this one.

type IndexBoard

type IndexBoard struct {
	Fqbn            string           `json:"fqbn"`
	Firmwares       []*IndexFirmware `json:"firmware"`
	Module          string           `json:"module"`
	Name            string           `json:"name"`
	UploaderPlugin  string           `json:"uploader_plugin"`
	AdditionalTools []string         `json:"additional_tools"`
}

IndexBoard represents a single entry from module_firmware_index.json file.

func (*IndexBoard) GetFirmware

func (b *IndexBoard) GetFirmware(version string) *IndexFirmware

GetFirmware returns the specified IndexFirmware version for this board. Returns nil if version is not found.

func (*IndexBoard) LatestFirmware

func (b *IndexBoard) LatestFirmware() *IndexFirmware

LatestFirmware returns the latest firmware version for the IndexBoard

func (*IndexBoard) Overlaps

func (b *IndexBoard) Overlaps(x *IndexBoard) bool

Overlaps returns true if the two IndexBoard represent the same board.

type IndexFirmware

type IndexFirmware struct {
	Version  *semver.RelaxedVersion `json:"version"`
	URL      string                 `json:"url"`
	Checksum string                 `json:"checksum"`
	Size     json.Number            `json:"size"`
	Module   string                 `json:"module"`
}

IndexFirmware represents a single Firmware version from module_firmware_index.json file.

type IndexSketch

type IndexSketch struct {
	URL      string      `json:"url"`
	Checksum string      `json:"checksum"`
	Size     json.Number `json:"size"`
}

IndexSketch represents a sketch used to manage firmware on a board.

type IndexUploaderCommand

type IndexUploaderCommand struct {
	Linux   string `json:"linux"`
	Windows string `json:"windows"`
	Macosx  string `json:"macosx"`
}

IndexUploaderCommand represents the command-line to use for different OS

Jump to

Keyboard shortcuts

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