config

package
v0.0.0-...-57c00fc Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

package config manages loading configuration from environment and command-line params

Index

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

func AppendRandomSuffix(prefix string) string

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 BaseGroupName

func BaseGroupName() string

BaseGroupName() returns a prefix for new groups.

func ClientID

func ClientID() string

ClientID is the OAuth client ID.

func ClientSecret

func ClientSecret() string

ClientSecret is the OAuth client secret.

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

func GenerateGroupName(affixes ...string) string

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 TenantID

func TenantID() string

TenantID is the AAD tenant to which this client belongs.

func UseDeviceFlow

func UseDeviceFlow() bool

UseDeviceFlow() specifies if interactive auth should be used. Interactive auth uses the OAuth Device Flow grant type.

func UserAgent

func UserAgent() string

UserAgent() specifies a string to append to the agent identifier.

Types

This section is empty.

Jump to

Keyboard shortcuts

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