helpers

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArmEndpoint

func ArmEndpoint() string

ArmEndpoint specifies resource manager URI

func DeviceFlow

func DeviceFlow() bool

DeviceFlow returns if device flow has been set as auth grant type

func GetRandomLetterSequence

func GetRandomLetterSequence(n int) string

GetRandomLetterSequence returns a sequence of English characters of length n.

func GroupPrefix

func GroupPrefix() string

GroupPrefix specifies the prefix sample resource groups should have

func KeepResources

func KeepResources() bool

KeepResources indicates whether resources created by samples should be retained.

func Location

func Location() string

Location specifies the Azure region to use.

func OverrideCanaryLocation

func OverrideCanaryLocation(usableLocation string)

OverrideCanaryLocation ovverrides the specified canary location where to create Azure resources.

func OverrideLocation

func OverrideLocation(available []string)

OverrideLocation ovverrides the specified location where to create Azure resources. This can be used when the selection location does not have the desired resource provider available yet

func ParseArgs

func ParseArgs() error

ParseArgs picks up shared env vars and flags and finishes parsing flags Other packages should declare their flags then call helpers.ParseArgs()

func ParseDeviceFlow

func ParseDeviceFlow() error

ParseDeviceFlow parses the auth grant type to be used The caller should do flag.Parse()

func ParseSubscriptionID

func ParseSubscriptionID() error

ParseSubscriptionID gets the subscription id from either an env var, .env file or flag The caller should do flag.Parse()

func PrintAndLog

func PrintAndLog(message string)

PrintAndLog writes to stdout and to a logger.

func ReadEnvFile

func ReadEnvFile() error

ReadEnvFile reads the .env file and loads its environment variables.

func ReadJSON

func ReadJSON(path string) (*map[string]interface{}, error)

ReadJSON reads a json file, and unmashals it. Very useful for template deployments.

func ResourceGroupName

func ResourceGroupName() string

ResourceGroupName returns the name of the resource group to use.

func ServicePrincipalObjectID

func ServicePrincipalObjectID() string

ServicePrincipalObjectID returns the object ID of the service principal in use.

func SetPrefix

func SetPrefix(prefix string)

SetPrefix sets a prefix for resource group names

func SetResourceGroupName

func SetResourceGroupName(suffix string)

SetResourceGroupName sets a name for the resource group. It takes into account the resource group prefix, and adds some random letters to ensure uniqueness

func SubscriptionID

func SubscriptionID() string

SubscriptionID returns the ID of the subscription to use.

func UserAgent

func UserAgent() string

UserAgent return the string to be appended to user agent header

Types

This section is empty.

Jump to

Keyboard shortcuts

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