util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package util represent few common functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfMetaKeysExistsInResources

func CheckIfMetaKeysExistsInResources(t *testing.T, res []resource.Resource, expectedMetaDataKeys []string)

CheckIfMetaKeysExistsInResources Checks if all the keys in the given list exist in the metaData of all the Resources

func GetAWSResourceTagByARN

func GetAWSResourceTagByARN(ctx context.Context, resourceTaggingService ResourceTaggingServiceClient, arn string) (map[string]string, error)

GetAWSResourceTagByARN provides tags for any resource from ARN

func IsFieldExistsInConfig

func IsFieldExistsInConfig(value string, fields []string) bool

IsFieldExistsInConfig to check if specific field exists in config

func RetryWithExponentialBackoff

func RetryWithExponentialBackoff(fn func() error, maxRetries int, initialBackoffSeconds int) error

RetryWithExponentialBackoff retries a function with exponential backoff in case of errors

Types

type ResourceTaggingServiceClient

type ResourceTaggingServiceClient interface {
	GetResources(context.Context, *resourcegroupstaggingapi.GetResourcesInput, ...func(*resourcegroupstaggingapi.Options)) (*resourcegroupstaggingapi.GetResourcesOutput, error)
}

ResourceTaggingServiceClient construct resource tagging service

Jump to

Keyboard shortcuts

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