site

package
v0.0.0-...-9994f1b Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 10 Imported by: 0

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

View Source
const MediumRPCDuration = 3 * time.Minute

MediumRPCDuration is the duration for medium RPCs that can touch many records.

View Source
const ShortRPCDuration = 30 * time.Second

ShortRPCDuration is the duration for short RPCs.

Variables

View Source
var DefaultAuthOptions = chromeinfra.SetDefaultAuthOptions(auth.Options{
	Scopes:     GetAuthScopes(DefaultAuthScopes),
	SecretsDir: SecretsDir(),
})

DefaultAuthOptions is an auth.Options struct prefilled with chrome-infra defaults.

View Source
var DefaultAuthScopes = []string{auth.OAuthScopeEmail, "https://www.googleapis.com/auth/spreadsheets"}

DefaultAuthScopes is the default scopes for fleetcost login

View Source
var ErrMediumRPCEnded = errors.New("medium RPC ended")

ErrMediumRPCEnded is used when the MediumRPCDuration deadline has ended.

View Source
var ErrShortRPCEnded = errors.New("short RPC ended")

ErrShortRPCEnded is used when the ShortRPCDuration deadline has ended.

View Source
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

func GetAuthScopes(defaultScopes []string) []string

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.

Jump to

Keyboard shortcuts

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