Documentation ¶
Overview ¶
package config manages loading configuration from environment and command-line params
Index ¶
- func AddFlags() error
- func AppendRandomSuffix(prefix string) string
- func AuthorizationServerURL() string
- func BaseGroupName() string
- func ClientID() string
- func ClientSecret() string
- func DefaultLocation() string
- func Environment() *azure.Environment
- func GenerateGroupName(affixes ...string) string
- func GroupName() string
- func KeepResources() bool
- func Location() string
- func ParseEnvironment() error
- func SetGroupName(name string)
- func SubscriptionID() string
- func TenantID() string
- func UseDeviceFlow() bool
- func UserAgent() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFlags ¶
func AddFlags() error
AddFlags adds flags applicable to all services. Remember to call `flag.Parse()` in your main or TestMain.
func AppendRandomSuffix ¶
AppendRandomSuffix will append a suffix of five random characters to the specified prefix.
func AuthorizationServerURL ¶
func AuthorizationServerURL() string
AuthorizationServerURL is the OAuth authorization server URL. Q: Can this be gotten from the `azure.Environment` in `Environment()`?
func DefaultLocation ¶
func DefaultLocation() string
DefaultLocation() returns the default location wherein to create new resources. Some resource types are not available in all locations so another location might need to be chosen.
func Environment ¶
func Environment() *azure.Environment
Environment() returns an `azure.Environment{...}` for the current cloud.
func GenerateGroupName ¶
GenerateGroupName leverages BaseGroupName() to return a more detailed name, helping to avoid collisions. It appends each of the `affixes` to BaseGroupName() separated by dashes, and adds a 5-character random string.
func GroupName ¶
func GroupName() string
deprecated: do not use global group names utilize `BaseGroupName()` for a shared prefix
func KeepResources ¶
func KeepResources() bool
KeepResources() specifies whether to keep resources created by samples.
func Location ¶
func Location() string
deprecated: use DefaultLocation() instead Location returns the Azure location to be utilized.
func ParseEnvironment ¶
func ParseEnvironment() error
ParseEnvironment loads a sibling `.env` file then looks through all environment variables to set global configuration.
func SetGroupName ¶
func SetGroupName(name string)
deprecated: we have to set this because we use a global for group names once that's fixed this should be removed
func SubscriptionID ¶
func SubscriptionID() string
SubscriptionID is a target subscription for Azure resources.
func UseDeviceFlow ¶
func UseDeviceFlow() bool
UseDeviceFlow() specifies if interactive auth should be used. Interactive auth uses the OAuth Device Flow grant type.
Types ¶
This section is empty.