Documentation
¶
Overview ¶
Package site contains miscellaneous details specific to the fleet-cost project but not really related to the business logic, such as where to stash credentials.
Index ¶
Constants ¶
const MediumRPCDuration = 3 * time.Minute
MediumRPCDuration is the duration for medium RPCs that can touch many records.
const ShortRPCDuration = 30 * time.Second
ShortRPCDuration is the duration for short RPCs.
Variables ¶
var DefaultAuthOptions = chromeinfra.SetDefaultAuthOptions(auth.Options{ Scopes: GetAuthScopes(DefaultAuthScopes), SecretsDir: SecretsDir(), })
DefaultAuthOptions is an auth.Options struct prefilled with chrome-infra defaults.
var DefaultAuthScopes = []string{auth.OAuthScopeEmail, "https://www.googleapis.com/auth/spreadsheets"}
DefaultAuthScopes is the default scopes for fleetcost login
var ErrMediumRPCEnded = errors.New("medium RPC ended")
ErrMediumRPCEnded is used when the MediumRPCDuration deadline has ended.
var ErrShortRPCEnded = errors.New("short RPC ended")
ErrShortRPCEnded is used when the ShortRPCDuration deadline has ended.
var ReservedCostIndicatorNames = map[string]string{
"connectivity-rack-setup": "rack-setup",
"connectivity-phase-deployments": "phase-deployments",
"connectivity-annual-maintenance": "annual-maintenance",
"quota-faft-rack-setup": "rack-setup",
"quota-faft-phase-deployments": "phase-deployments",
"quota-faft-annual-maintenance": "annual-maintenance",
}
ReservedCostIndicatorNames names maps names that are not present in any cost model to the corresponding names that should be used instead.
Functions ¶
func GetAuthScopes ¶
GetAuthScopes get environment scopes if set Otherwise, return default scopes
func SecretsDir ¶
func SecretsDir() string
SecretsDir customizes the location for auth-related secrets.
Types ¶
type CommonFlags ¶
type CommonFlags struct {
// contains filtered or unexported fields
}
CommonFlags are the flags common to all commands.
func (*CommonFlags) HTTP ¶
func (fl *CommonFlags) HTTP() bool
HTTP returns whether to use HTTP or HTTPS (default).
func (*CommonFlags) Host ¶
func (fl *CommonFlags) Host() (string, error)
Host returns the host to contact.
func (*CommonFlags) Prod ¶
func (fl *CommonFlags) Prod() bool
Prod returns whether we are talking to prod or not.
func (*CommonFlags) Register ¶
func (fl *CommonFlags) Register(f *flag.FlagSet)
Register the common flags.
func (*CommonFlags) VerboseLog ¶
func (fl *CommonFlags) VerboseLog(a subcommands.Application, message string)
VerboseLog writes a log message to stderr precisely when the verbose setting is on.