Documentation ¶
Overview ¶
Package gcp declares common Google API clients options.
Index ¶
- func InitFlags(cmd *cobra.Command)
- type Helper
- func (h *Helper) AddInterceptors() error
- func (h *Helper) CollectAPIKeyOption(options []option.ClientOption) []option.ClientOption
- func (h *Helper) CollectCredentialsFileOption(options []option.ClientOption) ([]option.ClientOption, error)
- func (h *Helper) CollectCredentialsOption(options []option.ClientOption) ([]option.ClientOption, error)
- func (h *Helper) GetClientOptions() ([]option.ClientOption, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Helper ¶
Helper provides convenient access to the Google API Cobra flags.
func NewHelper ¶
NewHelper wraps the Cobra command's flags with a utility wrapper to assist in the collection of Google API client options.
func (*Helper) AddInterceptors ¶
AddInterceptors will register interceptors which handle Google load balancer user agent checks for a GCE ingress agent.
func (*Helper) CollectAPIKeyOption ¶
func (h *Helper) CollectAPIKeyOption(options []option.ClientOption) []option.ClientOption
CollectAPIKeyOption adds the Google API key, if passed as a command flag, to the Google API client options.
func (*Helper) CollectCredentialsFileOption ¶
func (h *Helper) CollectCredentialsFileOption(options []option.ClientOption) ([]option.ClientOption, error)
CollectCredentialsFileOption adds the Google credentials file, if passed as a command flag, to the Google API client options.
func (*Helper) CollectCredentialsOption ¶
func (h *Helper) CollectCredentialsOption(options []option.ClientOption) ([]option.ClientOption, error)
CollectCredentialsOption adds the Google credentials, if passed as a command flag, to the Google API client options.
func (*Helper) GetClientOptions ¶
func (h *Helper) GetClientOptions() ([]option.ClientOption, error)
GetClientOptions obtains the Google API client options.