Documentation ¶
Index ¶
- Constants
- func GetHostFromRedisURI(uri string) (string, error)
- func IsAzureEndpoint(hostname string) bool
- func IsCacheForRedisEndpoint(endpoint string) bool
- func IsDatabaseEndpoint(endpoint string) bool
- func IsMSSQLServerEndpoint(endpoint string) bool
- func IsRedisEndpoint(endpoint string) bool
- func IsRedisEnterpriseEndpoint(endpoint string) bool
- func NormalizeLocation(input string) string
- func ParseCacheForRedisEndpoint(endpoint string) (name string, err error)
- func ParseDatabaseEndpoint(endpoint string) (name string, err error)
- func ParseMSSQLEndpoint(endpoint string) (name string, err error)
Constants ¶
const ( // DatabaseEndpointSuffix is the Azure database endpoint suffix. Used for // MySQL, PostgreSQL, etc. DatabaseEndpointSuffix = ".database.azure.com" // RedisEndpointSuffix is the endpoint suffix for Redis. RedisEndpointSuffix = ".redis.cache.windows.net" // RedisEnterpriseEndpointSuffix is the endpoint suffix for Redis Enterprise. RedisEnterpriseEndpointSuffix = ".redisenterprise.cache.azure.net" // MSSQLEndpointSuffix is the Azure SQL Server endpoint suffix. MSSQLEndpointSuffix = ".database.windows.net" )
Variables ¶
This section is empty.
Functions ¶
func GetHostFromRedisURI ¶
GetHostFromRedisURI extracts host name from a Redis URI. The URI may start with "redis://", "rediss://", or without. The URI may also have parameters like "?mode=cluster".
func IsAzureEndpoint ¶
IsAzureEndpoint returns true if the input URI is an Azure endpoint.
The code implements approximate solution based on: - https://management.azure.com/metadata/endpoints?api-version=2019-05-01 - https://github.com/Azure/azure-cli/blob/dev/src/azure-cli-core/azure/cli/core/cloud.py
func IsCacheForRedisEndpoint ¶
IsCacheForRedisEndpoint returns true if provided endpoint is a valid Azure Cache for Redis endpoint.
func IsDatabaseEndpoint ¶
IsDatabaseEndpoint returns true if provided endpoint is a valid database endpoint.
func IsMSSQLServerEndpoint ¶
IsMSSQLServerEndpoint returns true if provided endpoint is a valid SQL server database endpoint.
func IsRedisEndpoint ¶
IsRedisEndpoint returns true if provided endpoint is a valid Redis (non-Enterprise tier) endpoint.
func IsRedisEnterpriseEndpoint ¶
IsRedisEnterpriseEndpoint returns true if provided endpoint is a valid Redis Enterprise endpoint.
func NormalizeLocation ¶
NormalizeLocation converts a Azure location in various formats to the same simple format.
This function assumes the input location is in one of the following formats: - Name (the "simple" format): "northcentralusstage" - Display name: "North Central US (Stage)" - Regional display name: "(US) North Central US (Stage)"
Note that the location list can be generated from `az account list-locations -o table`. However, this CLI command only lists the locations for the current active subscription so it may not show locations in other parititions like Government or China.
func ParseCacheForRedisEndpoint ¶
ParseCacheForRedisEndpoint extracts database server name from Azure Cache for Redis endpoint.
func ParseDatabaseEndpoint ¶
ParseDatabaseEndpoint extracts database server name from Azure endpoint.
func ParseMSSQLEndpoint ¶
ParseMSSQLEndpoint extracts database server name from Azure endpoint.
Types ¶
This section is empty.