cmdlib

package
Version: 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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTaskPriority = 140

DefaultTaskPriority is the default priority for a swarming task.

Functions

func FixSuspiciousHostname

func FixSuspiciousHostname(hostname string) string

FixSuspiciousHostname checks whether a hostname is suspicious and potentially indicates a bug of some kind. The prefix "crossk-" is suspicious and should be removed. The suffix ".cros" is also suspicious and should be removed.

func RegisterRemovalReason

func RegisterRemovalReason(rr *rem.RemovalReason, f *flag.FlagSet)

RegisterRemovalReason sets up the command line arguments for specifying a removal reason.

func SetLogging

func SetLogging(ctx context.Context, level logging.Level) context.Context

SetLogging is used to sets the level for the logger when needed

func SetupContext

func SetupContext(ctx context.Context, namespace string) context.Context

SetupContext sets up context with namespace

Types

type CommonFlags

type CommonFlags struct {
	// contains filtered or unexported fields
}

CommonFlags controls some commonly-used CLI flags.

func (*CommonFlags) Register

func (f *CommonFlags) Register(fl *flag.FlagSet)

Register sets up the common flags.

func (*CommonFlags) Verbose

func (f *CommonFlags) Verbose() bool

Verbose returns if the command is set to verbose mode.

type EnvFlags

type EnvFlags struct {
	// contains filtered or unexported fields
}

EnvFlags controls selection of the environment: either prod (default) or dev.

func (EnvFlags) Env

func (f EnvFlags) Env() site.Environment

Env returns the environment, either dev or prod.

func (*EnvFlags) Register

func (f *EnvFlags) Register(fl *flag.FlagSet)

Register sets up the -dev argument.

Source Files

Jump to

Keyboard shortcuts

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