Documentation
¶
Index ¶
- Variables
- func LooksLikeHeader(rec []string) bool
- func LooksLikeLabstation(hostname string) bool
- func LooksLikeSatlabDevice(hostname string) bool
- func LooksLikeSatlabRemoteAccessContainer() (bool, error)
- func NormalizeBotNameToDeviceName(hostname string) string
- func NormalizeServoNameToDeviceName(servo string) string
- func NormalizeTextualData(data string) string
- func ParseUsingCommand(c *subcommands.Command, args []string, ...) (*flag.FlagSet, error)
- func TruncateErrorString(msg string) string
- type TaskType
Constants ¶
This section is empty.
Variables ¶
var HwSwarmingBotIDPrefixes = []string{"crossk-", "cros-"}
HwSwarmingBotIDPrefixes includes all possible prefix for bots for DUTs
var LooksLikeFieldMask = regexp.MustCompile(`\A[a-z][A-Za-z0-9\.]*\z`).MatchString
LooksLikeFieldMask checks whether a given string looks like a field mask.
var LooksLikeValidPool = regexp.MustCompile(`\A[A-Za-z_][-A-Za-z0-9_]*\z`).MatchString
looksLikeValidPool heuristically checks a string to see if it looks like a valid pool. A heuristically valid pool name contains only a-z, A-Z, 0-9, -, and _ . A pool name cannot begin with - and 0-9 .
Functions ¶
func LooksLikeHeader ¶
LooksLikeHeader heuristically determines whether a CSV line looks like a CSV header for the MCSV format.
func LooksLikeLabstation ¶
LooksLikeLabstation returns whether a hostname or botID appears to be a labstation or not. This function exists so that we always use the same heuristic everywhere when identifying labstations.
func LooksLikeSatlabDevice ¶
LooksLikeSatlabDevice returns whether a hostname or botID appears to be a satlab-managed device. This function exists so that we use the same heuristic everywhere when identifying satlab devices.
func LooksLikeSatlabRemoteAccessContainer ¶
LooksLikeSatlabRemoteAccessContainer determines whether the container we are running on looks like a satlab remote access container.
func NormalizeBotNameToDeviceName ¶
NormalizeBotNameToDeviceName takes a bot name or a DUT name and normalizes it to a DUT name. The prefix "crossk-" or "cros-" is suspicious and should be removed. The suffix ".cros" is also suspicious and should be removed.
func NormalizeServoNameToDeviceName ¶
NormalizeServoNameToDeviceName converts a servo name (ending in "-servo") to a device name by stripping the "-servo" suffix, which is a longstanding convention.
func NormalizeTextualData ¶
NormalizeTextualData lowercases data and removes leading and trailing whitespace.
func ParseUsingCommand ¶
func ParseUsingCommand(c *subcommands.Command, args []string, validate func(subcommands.CommandRun) error) (*flag.FlagSet, error)
ParseUsingCommand is a test helper for subcommands.
func TruncateErrorString ¶
TruncateErrorString truncates a string to 1400 characters, a number that can safely be stored in both datastore and bigquery. Returns the truncated string.