Documentation ¶
Overview ¶
Package swarming implements conversion of Skylab inventory schema to Swarming dimensions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrEmptyKey is reported by Sanitize for empty keys. ErrEmptyKey = errors.New("empty dimension key") )
Functions ¶
func Revert ¶
func Revert(d Dimensions) *inventory.SchedulableLabels
Revert converts Swarming dimensions to DUT inventory labels.
func Sanitize ¶
func Sanitize(dims Dimensions, r ReportFunc)
Sanitize sanitizes the Swarming dimensions. Invalid dimensions are removed or fixed as appropriate. Errors are reported to the ReportFunc because there can be multiple errors and the point of this function is to avoid hard failures in Swarming, thus the common case is to log the errors somewhere.
Types ¶
type Dimensions ¶
Dimensions is the type for Swarming dimensions.
func Convert ¶
func Convert(ls *inventory.SchedulableLabels) Dimensions
Convert converts DUT inventory labels to Swarming dimensions.
type ErrEmptyValue ¶
type ErrEmptyValue struct {
Key string
}
ErrEmptyValue is reported by Sanitize for empty values.
func (ErrEmptyValue) Error ¶
func (e ErrEmptyValue) Error() string
type ErrKeyChars ¶
type ErrKeyChars struct {
Key string
}
ErrKeyChars is reported by Sanitize for keys with invalid characters.
func (ErrKeyChars) Error ¶
func (e ErrKeyChars) Error() string
type ErrLongKey ¶
type ErrLongKey struct {
Key string
}
ErrLongKey is reported by Sanitize for keys that are too long.
func (ErrLongKey) Error ¶
func (e ErrLongKey) Error() string
type ErrLongValue ¶
ErrLongValue is reported by Sanitize for values that are too long.
func (ErrLongValue) Error ¶
func (e ErrLongValue) Error() string
type ErrRepeatedValue ¶
ErrRepeatedValue is reported by Sanitize for values that are repeated.
func (ErrRepeatedValue) Error ¶
func (e ErrRepeatedValue) Error() string