options

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequiredAnnotation = "eiam_required_flag"
)

Flag annotation strings

Variables

View Source
var (
	ProjectFlag             = flagName{"project", "p"}
	ReasonFlag              = flagName{"reason", "R"}
	RegionFlag              = flagName{"region", "r"}
	ServiceAccountEmailFlag = flagName{"service-account-email", "s"}
	YesFlag                 = flagName{"yes", "y"}
	ZoneFlag                = flagName{"zone", "z"}
)

Flag names and shorthands

View Source
var (
	ComputeInstanceFlag = flagName{"instance", "i"}
	PubSubTopicFlag     = flagName{"topic", "t"}
	StorageBucketFlag   = flagName{"bucket", "b"}
)

Flag names and shorthands

View Source
var YesOption = false

YesOption designates whether to prompt for confirmation or not

Functions

func AddComputeInstanceFlag

func AddComputeInstanceFlag(fs *pflag.FlagSet, instance *string, required bool)

AddComputeInstanceFlag adds the --instance/-i flag to the command

func AddPersistentFlags

func AddPersistentFlags(fs *pflag.FlagSet)

AddPersistentFlags add persistent flags to the root command

func AddProjectFlag

func AddProjectFlag(fs *pflag.FlagSet, project *string)

AddProjectFlag adds the --project/-p flag to the command

func AddPubSubTopicFlag

func AddPubSubTopicFlag(fs *pflag.FlagSet, topic *string, required bool)

AddPubSubTopicFlag adds the --topic/-t flag to the command

func AddReasonFlag

func AddReasonFlag(fs *pflag.FlagSet, reason *string, required bool)

AddReasonFlag adds the --reason/-R flag

func AddRegionFlag

func AddRegionFlag(fs *pflag.FlagSet, region *string, required bool)

AddRegionFlag adds the --region/-r flag to the command

func AddServiceAccountEmailFlag

func AddServiceAccountEmailFlag(fs *pflag.FlagSet, serviceAccountEmail *string, required bool)

AddServiceAccountEmailFlag adds the --service-account-email/-s flag

func AddStorageBucketFlag

func AddStorageBucketFlag(fs *pflag.FlagSet, bucket *string, required bool)

AddStorageBucketFlag adds the --bucket/-b flag to the command

func AddZoneFlag

func AddZoneFlag(fs *pflag.FlagSet, zone *string, required bool)

AddZoneFlag adds the --zone/-z flag to the command

func CheckRequired

func CheckRequired(flag *pflag.Flag)

CheckRequired ensures that a command's required flags have been set

Types

type CmdConfig

type CmdConfig struct {
	ComputeInstance     string
	Project             string
	PubSubTopic         string
	Reason              string
	Region              string
	ServiceAccountEmail string
	StorageBucket       string
	Zone                string
}

CmdConfig holds the values passed to a command

Jump to

Keyboard shortcuts

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