Documentation
¶
Overview ¶
Package site contains site local constants for the shivas
Index ¶
- Constants
- Variables
- func Contains(arr []string, str string) bool
- func DefaultPRPCOptions(e EnvFlags) *prpc.Options
- func GetAuthScopes(defaultScopes []string) []string
- func ProdDefaultPRPCOptions() *prpc.Options
- func SecretsDir() string
- type CommonFlags
- type EnvFlags
- type Environment
- type OutputFlags
Constants ¶
const Major = 7
Major is the Major version number
const Minor = 2
Minor is the Minor version number
const Patch = 0
Patch is the PAtch version number
Variables ¶
var ( // OSLikeNamespaces are namespaces that store primarily chromeos data. // This includes a separate partner namespace which stores chromeos data. OSLikeNamespaces = []string{ufsUtil.OSNamespace, ufsUtil.OSPartnerNamespace} // AllNamespaces contain all namespaces UFS considers valid. AllNamespaces = ufsUtil.ValidClientNamespaceStr() )
var CipdInstalledPath = "go.chromium.org/infra/shivas/"
CipdInstalledPath is the installed path for shivas package.
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", "https://www.googleapis.com/auth/cloud-platform"}
DefaultAuthScopes is the default scopes for shivas login
VersionNumber is the version number for the tool. It follows the Semantic Versioning Specification (http://semver.org) and the format is: "MAJOR.MINOR.0+BUILD_TIME". We can ignore the PATCH part (i.e. it's always 0) to make the maintenance work easier. We can also print out the build time (e.g. 20060102150405) as the METADATA when show version to users.
Functions ¶
func DefaultPRPCOptions ¶
DefaultPRPCOptions is used for PRPC clients. If it is nil, the default value is used. See prpc.Options for details.
This is provided so it can be overridden for testing.
func GetAuthScopes ¶
GetAuthScopes get environment scopes if set Otherwise, return default scopes
func ProdDefaultPRPCOptions ¶
ProdDefaultPRPCOptions returns UFS PRPC client options for the prod project
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 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() Environment
Env returns the environment, either dev or prod.
type Environment ¶
type Environment struct { AdminService string InventoryService string UnifiedFleetService string SwarmingService string SwarmingServiceAccount string LogdogService string QueenService string }
Environment contains environment specific values.
type OutputFlags ¶
type OutputFlags struct {
// contains filtered or unexported fields
}
OutputFlags controls output-related CLI flags.
func (*OutputFlags) Full ¶
func (f *OutputFlags) Full() bool
Full returns if the full format of output is logged in tsv format (without title)
func (*OutputFlags) JSON ¶
func (f *OutputFlags) JSON() bool
JSON returns if the output is logged in json format
func (*OutputFlags) NoEmit ¶
func (f *OutputFlags) NoEmit() bool
NoEmit returns if output json should NOT print/emit unpopulated fields
func (*OutputFlags) Register ¶
func (f *OutputFlags) Register(fl *flag.FlagSet)
Register sets up the output flags.
func (*OutputFlags) Tsv ¶
func (f *OutputFlags) Tsv() bool
Tsv returns if the output is logged in tsv format (without title)