azure

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AzureBlobStorageURL = ".blob.core.windows.net/"
)
View Source
const E2EInstanceTagKey = "e2e_instance"

Variables

This section is empty.

Functions

func CreateAdminClient added in v1.15.0

func CreateAdminClient(ctx context.Context, region string, name string, nsCli *servicebus.NamespacesClient) *svadmin.Client

CreateAdminClient will create a servicebus admin client.

func CreateBlobContainer

func CreateBlobContainer(ctx context.Context, rg, saName, subscriptionID, name string) armstorage.BlobContainer

CreateBlobContainer will create a new blob storage container

func CreateBlobStorageAccount

func CreateBlobStorageAccount(ctx context.Context, cli *armstorage.AccountsClient, rgName, region string) armstorage.Account

CreateBlobStorageAccount creates an Azure storage account in the given resource group and region. Because storage account names are globally unique, this helper generates a random name to reduce the risk of running into naming conflicts.

func CreateClient added in v1.15.0

func CreateClient(ctx context.Context, region string, name string, nsCli *servicebus.NamespacesClient) *sv.Client

CreateClient will create a servicebus client.

func CreateDevice

func CreateDevice(hubName, deviceName, iotownerKey string) (string, error)

CreateDevice relies on the REST API to create a new device for testing returning the primary key used for the newly created device.

func CreateEventHubCommon

func CreateEventHubCommon(ctx context.Context, subscriptionID, name, region, rg string, omitHub bool) *armeventhub.Eventhub

func CreateEventHubComponents

func CreateEventHubComponents(ctx context.Context, subscriptionID, name, region, rg string) *armeventhub.Eventhub

func CreateEventHubNamespaceOnly

func CreateEventHubNamespaceOnly(ctx context.Context, subscriptionID, name, region, rg string) *armeventhub.Eventhub

func CreateIOTHubComponents

func CreateIOTHubComponents(ctx context.Context, subscriptionID, rg, region, name string) (string, string)

CreateIOTHubComponents Will create the Azure IOT Hub, and a device to produce data

func CreateQueueStorage

func CreateQueueStorage(ctx context.Context, name, accountName string, accountKey string) *azqueue.MessagesURL

CreateQueueStorage will create a queue storage message url

func CreateQueueStorageAccount

func CreateQueueStorageAccount(ctx context.Context, cli *armstorage.AccountsClient, name, rgName, region string) armstorage.Account

CreateQueueStorageAccount provides a wrapper to support Queue storage test

func CreateResourceGroup

func CreateResourceGroup(ctx context.Context, subscriptionID, name, region string) armresources.ResourceGroup

CreateResourceGroup will create the resource group containing all of the eventhub components.

func CreateSaSToken

func CreateSaSToken(uri, name, key string, withName bool) string

CreateSaSToken will create a shared access signature to interact with the Azure IOTEventHub for device management.

func CreateServiceBusNamespace

func CreateServiceBusNamespace(ctx context.Context, cli servicebus.NamespacesClient, rgName, nsName, region string) error

func CreateServiceBusNamespaceClient

func CreateServiceBusNamespaceClient(ctx context.Context, subscriptionID, region string) *servicebus.NamespacesClient

CreateServiceBusNamespaceClient will create the servicebus client

func CreateStorageAccountCommon

func CreateStorageAccountCommon(ctx context.Context, cli *armstorage.AccountsClient, name, rgName, region string, isBlob bool) armstorage.Account

CreateStorageAccountCommon will create an azure storage account for both blob and queue storage tests

func CreateStorageAccountsClient

func CreateStorageAccountsClient(subscriptionID string) *armstorage.AccountsClient

CreateStorageAccountsClient will create the storage account client

func DeleteBlob

func DeleteBlob(ctx context.Context, containerName, saName, name string)

DeleteBlob will delete the blob located at the name location

func DeleteResourceGroup

func DeleteResourceGroup(ctx context.Context, subscriptionID, name string) *runtime.Poller[armresources.ResourceGroupsClientDeleteResponse]

DeleteResourceGroup will delete everything under it allowing for easy cleanup

func GetStorageAccountKey

func GetStorageAccountKey(ctx context.Context, cli *armstorage.AccountsClient, name, rgName string) (armstorage.AccountsClientListKeysResponse, error)

GetStorageAccountKey will return the storage account keys

func ReadSeekCloser

func ReadSeekCloser(r *strings.Reader) readSeekCloser

ReadSeekCloser implements a closer with Seek, Read, and Close

func UploadBlob

func UploadBlob(ctx context.Context, containerName, saName, name, data string)

UploadBlob will upload a new chunk of data to the blob storage

func WaitForFutureDeletion

func WaitForFutureDeletion(ctx context.Context, subscriptionID string, future *runtime.Poller[armresources.ResourceGroupsClientDeleteResponse])

WaitForFutureDeletion will wait on the resource group to be deleted before continuing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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