Documentation
¶
Overview ¶
Package geography provides helpers for working with HCP geographies using the HCP SDK.
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func GetCachedGeography ¶
GetCachedGeography reads the geography from the SDK's credential cache file. This returns the geography that the user actually authenticated against during browser login.
func GetDefaultGeography ¶
func GetDefaultGeography() string
GetDefaultGeography returns the default geography as a string. This leverages the HCP SDK's Default constant.
func GetSupportedGeographies ¶
func GetSupportedGeographies() []string
GetSupportedGeographies returns a slice of all supported geography strings. This leverages the HCP SDK's Geographies slice to ensure consistency.
func IsValidGeography ¶
IsValidGeography checks if the provided geography string is valid. This leverages the HCP SDK's ValidateGeo function.
Types ¶
type CredentialCache ¶
type CredentialCache struct {
Login CredentialCacheLogin `json:"login"`
}
CredentialCache represents the structure of the SDK credential cache file
type CredentialCacheLogin ¶
type CredentialCacheLogin struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
AccessTokenExpiry string `json:"access_token_expiry"`
Geography string `json:"geography"`
}
CredentialCacheLogin represents the login section of the SDK credential cache