location

package
v0.63.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheSupportedLocations

func CacheSupportedLocations(ctx context.Context, resourceManagerEndpoint string)

CacheSupportedLocations attempts to retrieve the supported locations from the Azure MetaData Service and caches them, for used in enhanced validation

func DiffSuppressFunc

func DiffSuppressFunc(_, old, new string, _ *schema.ResourceData) bool

func EnhancedValidate

func EnhancedValidate(i interface{}, k string) ([]string, []error)

EnhancedValidate returns a validation function which attempts to validate the location against the list of Locations supported by this Azure Location.

NOTE: this is best-effort - if the users offline, or the API doesn't return it we'll fall back to the original approach

func Normalize

func Normalize(input string) string

Normalize transforms the human readable Azure Region/Location names (e.g. `West US`) into the canonical value to allow comparisons between user-code and API Responses

func NormalizeNilable

func NormalizeNilable(input *string) string

NormalizeNilable normalizes the Location field even if it's nil to ensure this field can always have a value

func StateFunc

func StateFunc(location interface{}) string

Types

type SupportedLocations

type SupportedLocations struct {
	// Locations is a list of Locations which are supported on this Azure Endpoint.
	// This could be nil when the user is offline, or the Azure MetaData Service does not have this
	// information and as such this should be used as best-effort, rather than guaranteed
	Locations *[]string
}

Jump to

Keyboard shortcuts

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