models

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: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FirmwareTypeUndefined = FirmwareType(iota)
	FirmwareTypeBIOS

	EndOfFirmwareType
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Firmware

type Firmware struct {
	ID       int64        `db:"id,pk"`
	Type     FirmwareType `db:"type"`
	Version  string       `db:"version"`
	ImageURL string       `db:"image_url"`

	// loaded from other tables
	Targets      []*FirmwareTarget      `db:"-"`
	Measurements []*FirmwareMeasurement `db:"-"`
}

Firmware represent a row of table containing metadata about firmware images.

type FirmwareMeasurement

type FirmwareMeasurement struct {
	ID                int64                `db:"id,pk"`
	FirmwareID        int64                `db:"firmware_id"`
	MeasurementTypeID int64                `db:"type_id"`
	Value             types.ConvertedBytes `db:"value"`

	// loaded from other tables
	Firmware                *Firmware                `db:"-"`
	FirmwareMeasurementType *FirmwareMeasurementType `db:"-"`
}

type FirmwareMeasurementMetadata

type FirmwareMeasurementMetadata struct {
	ID                int64  `db:"id,pk"`
	MeasurementTypeID int64  `db:"type_id"`
	Key               string `db:"key"`
	Value             string `db:"value"`

	// loaded from other tables
	FirmwareMeasurementType *FirmwareMeasurementType `db:"-"`
}

type FirmwareMeasurementType

type FirmwareMeasurementType struct {
	ID          int64  `db:"id,pk"`
	Name        string `db:"name"`
	Description string `db:"description"`

	// loaded from other tables
	Metadata []*FirmwareMeasurementMetadata `db:"-"`
}

type FirmwareTarget

type FirmwareTarget struct {
	ID         int64   `db:"id,pk"`
	FirmwareID int64   `db:"firmware_id"`
	ModelID    *int64  `db:"model_id"`
	Hostname   *string `db:"hostname"`

	// loaded from other tables
	Firmware *Firmware `db:"-"`
}

FirmwareTarget represent a row of table containing connections information where a firmware should be applied

type FirmwareType

type FirmwareType uint

func (*FirmwareType) Scan

func (t *FirmwareType) Scan(srcI any) error

Scan converts DB's a value to the FirmwareType.

func (FirmwareType) String

func (t FirmwareType) String() string

func (FirmwareType) Value

func (t FirmwareType) Value() (driver.Value, error)

Value converts the value to be stored in DB.

Jump to

Keyboard shortcuts

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