helper

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AMAVersionStatusToString

func AMAVersionStatusToString(amaVersionStatus models.HashicorpCloudConsulamaAmaVersionStatus) string

AMAVersionStatusToString converts a HashicorpCloudConsulamaAmaVersionStatus to a string.

func FederationTokensHaveSamePrimary

func FederationTokensHaveSamePrimary(encodedToken1, encodedToken2 string) bool

FederationTokensHaveSamePrimary determines if two federation tokens (base64 encoded JWTs) have the same 'Primary' claim, which denotes that the tokens belong to the same primary HCS cluster.

func FlattenTags added in v0.1.0

func FlattenTags(tagMap map[string]*string) map[string]interface{}

FlattenTags converts a tag map of *string values to interface{} values. Adapted from the azurerm provider. https://github.com/terraform-providers/terraform-provider-azurerm/blob/7a46303711d53414249b1829d6d879a5dbdae9c4/azurerm/internal/tags/flatten.go#L9

func IsAutoRestResponseCodeAccepted added in v0.1.0

func IsAutoRestResponseCodeAccepted(resp autorest.Response) bool

IsAutoRestResponseCodeAccepted determines if an AutoRest response code was 202 Accepted.

func IsAutoRestResponseCodeNotFound

func IsAutoRestResponseCodeNotFound(resp autorest.Response) bool

IsAutoRestResponseCodeNotFound determines if an AutoRest response code was 404 not found.

func ParseResourceGroupNameFromID

func ParseResourceGroupNameFromID(id string) (string, error)

ParseResourceGroupNameFromID takes an Azure id string and parses the Azure Resource Group name. The Resource Group name can be the name of a Resource Group or a Managed Resource Group. Azure ids are of the form: /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}

func ParseResourceNameFromID added in v0.3.0

func ParseResourceNameFromID(id string) string

ParseNameFromID takes an Azure id string and parses the Resource name. The Resource name can be the name of a Resource Group or a Managed Resource Group. Azure ids are of the form: /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}

func String

func String(s string) *string

func TagValueToString added in v0.1.0

func TagValueToString(v interface{}) (string, error)

TagValueToString converts a tag interface{} to string. Adapted from the azurerm provider. https://github.com/terraform-providers/terraform-provider-azurerm/blob/b7299d0b8c6f3685db07586530a7f52216dd48e4/azurerm/internal/tags/validation.go#L31

func ToError

func ToError(d diag.Diagnostics) *multierror.Error

ToError will convert the passed in diag.Diagnostics d to an error if it is non-nil and contains an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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