swarming

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package swarming implements conversion of Skylab inventory schema to Swarming dimensions.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyKey is reported by Sanitize for empty keys.
	ErrEmptyKey = errors.New("empty dimension key")
)

Functions

func Revert

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

type Dimensions map[string][]string

Dimensions is the type for Swarming dimensions.

func Convert

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

type ErrLongValue struct {
	Key   string
	Value string
}

ErrLongValue is reported by Sanitize for values that are too long.

func (ErrLongValue) Error

func (e ErrLongValue) Error() string

type ErrRepeatedValue

type ErrRepeatedValue struct {
	Key   string
	Value string
}

ErrRepeatedValue is reported by Sanitize for values that are repeated.

func (ErrRepeatedValue) Error

func (e ErrRepeatedValue) Error() string

type ReportFunc

type ReportFunc func(error)

ReportFunc is used to report errors.

Jump to

Keyboard shortcuts

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