firmwaredb

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

Documentation

Index

Constants

View Source
const (
	// BiosFirmwareType represents BIOS
	FirmwareTypeBIOS = models.FirmwareTypeBIOS
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	Get(ctx context.Context, filters ...Filter) ([]*Firmware, error)
}

type Err

type Err[T fmt.Stringer] struct {
	Err         error
	Description T
}

func (Err[T]) Error

func (err Err[T]) Error() string

func (Err[T]) Unwrap

func (err Err[T]) Unwrap() error

type ErrNotFound

type ErrNotFound = Err[NotFound]

type Filter

type Filter interface {
	// WhereCond returns an SQL substring for "WHERE" with placeholders for
	// arguments (if required) and the arguments.
	//
	// A result of a query using WhereCond may contain extra values, due
	// to inability to perform effective fine filtering on SQL level, thus
	// use function Match to do the actual filtering after fetching the
	// entries from an RDBMS.
	WhereCond() (string, []any)

	// Match returns true if the firmware satisfies the filter conditions.
	Match(*Firmware) bool
}

Filter defines conditions to select firmware entries

type FilterIDs

type FilterIDs []int64

FilterIDs filters only the entries with the specified IDs.

func (FilterIDs) Match

func (f FilterIDs) Match(fw *Firmware) bool

Match implements Filter.

func (FilterIDs) WhereCond

func (f FilterIDs) WhereCond() (string, []any)

WhereCond implements Filter.

type FilterMeasurementMetadata

type FilterMeasurementMetadata struct {
	Key   string
	Value string
}

FilterPCR0Tag filters only the entries which are associated with a measurement with a specified metadata value.

func (FilterMeasurementMetadata) Match

Match implements Filter.

func (FilterMeasurementMetadata) WhereCond

func (f FilterMeasurementMetadata) WhereCond() (string, []any)

WhereCond implements Filter.

type FilterModelIDs

type FilterModelIDs []int64

FilterModelFamilyIDs filters only the entries with the specified model family IDs.

func (FilterModelIDs) Match

func (f FilterModelIDs) Match(fw *Firmware) bool

Match implements Filter.

func (FilterModelIDs) WhereCond

func (f FilterModelIDs) WhereCond() (string, []any)

WhereCond implements Filter.

type FilterNot

type FilterNot []Filter

FilterNot inverts conditions. If any of the nested filters are satisfied, then FilterNot result is "not satisfied".

func (FilterNot) Match

func (f FilterNot) Match(fw *Firmware) bool

Match implements Filter.

func (FilterNot) WhereCond

func (f FilterNot) WhereCond() (string, []any)

WhereCond implements Filter.

type FilterTypes

type FilterTypes []models.FirmwareType

FilterTypes defines a firmware types condition to select firmwares.

func (FilterTypes) Match

func (f FilterTypes) Match(fw *Firmware) bool

Match implements Filter.

func (FilterTypes) WhereCond

func (f FilterTypes) WhereCond() (string, []any)

WhereCond implements Filter.

type FilterVersion

type FilterVersion string

FilterVersion defines a firmware version condition to select firmwares.

func (FilterVersion) Match

func (f FilterVersion) Match(fw *Firmware) bool

Match implements Filter.

func (FilterVersion) WhereCond

func (f FilterVersion) WhereCond() (string, []any)

WhereCond implements Filter.

type Filters

type Filters []Filter

Filters is a set of Filter (logically joined through "AND").

func (Filters) Match

func (f Filters) Match(fw *Firmware) bool

Match implements Filter.

func (Filters) WhereCond

func (f Filters) WhereCond() (string, []any)

WhereCond implements Filter.

type FiltersOR

type FiltersOR []Filter

FiltersOR combines internal filter using OR

func (FiltersOR) Match

func (f FiltersOR) Match(fw *Firmware) bool

Match implements Filter.

func (FiltersOR) WhereCond

func (f FiltersOR) WhereCond() (string, []any)

WhereCond implements Filter.

type Firmware

type Firmware = models.Firmware

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

type FirmwareMeasurement

type FirmwareMeasurement = models.FirmwareMeasurement

type FirmwareMeasurementMetadata

type FirmwareMeasurementMetadata = models.FirmwareMeasurementMetadata

type FirmwareMeasurementType

type FirmwareMeasurementType = models.FirmwareMeasurementType

type FirmwareTarget

type FirmwareTarget = models.FirmwareTarget

type FirmwareType

type FirmwareType = models.FirmwareType

FirmwareType represents description of firmware type values

type NotFound

type NotFound struct {
	Filters Filters
}

func (NotFound) String

func (e NotFound) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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