client

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteResourceGroupFromSubscriptionSecretRef

func DeleteResourceGroupFromSubscriptionSecretRef(ctx context.Context, c client.Client, secretRef *corev1.SecretReference, resourceGroupName string) error

DeleteResourceGroupFromSubscriptionSecretRef deletes the resource group using subscription details from secretRef .

Types

type Storage

type Storage interface {
	DeleteObjectsWithPrefix(ctx context.Context, container, prefix string) error
	CreateContainerIfNotExists(ctx context.Context, container string) error
	DeleteContainerIfExists(ctx context.Context, container string) error
}

Storage represents a Azure storage client.

type StorageAuth

type StorageAuth struct {
	// StorageAccount is the data field in a secret where the storage account is stored at.
	StorageAccount []byte
	// StorageKey is the data field in a secret where the storage key is stored at.
	StorageKey []byte
}

StorageAuth represents a Azure storage auth.

func NewStorageClientAuthFromSubscriptionSecretRef

func NewStorageClientAuthFromSubscriptionSecretRef(ctx context.Context, c client.Client, secretRef *corev1.SecretReference, resourceGroupName, accountName, region string) (*StorageAuth, error)

NewStorageClientAuthFromSubscriptionSecretRef retrieves the azure storage client auth from specified by the secret reference.

func ReadStorageClientAuthDataFromSecret

func ReadStorageClientAuthDataFromSecret(secret *corev1.Secret) (*StorageAuth, error)

ReadStorageClientAuthDataFromSecret reads the storage client auth details from the given secret.

type StorageClient

type StorageClient struct {
	// contains filtered or unexported fields
}

StorageClient represents a Azure storage client.

func NewStorageClientFromSecretRef

func NewStorageClientFromSecretRef(ctx context.Context, c client.Client, secretRef *corev1.SecretReference) (*StorageClient, error)

NewStorageClientFromSecretRef retrieves the azure client from specified by the secret reference.

func NewStorageClientFromStorageAuth

func NewStorageClientFromStorageAuth(storageAuth *StorageAuth) (*StorageClient, error)

NewStorageClientFromStorageAuth create the storage client from storage auth.

func (*StorageClient) CreateContainerIfNotExists

func (c *StorageClient) CreateContainerIfNotExists(ctx context.Context, container string) error

CreateContainerIfNotExists creates the azure blob container with name <container>. If it already exist, no error is returned.

func (*StorageClient) DeleteContainerIfExists

func (c *StorageClient) DeleteContainerIfExists(ctx context.Context, container string) error

DeleteContainerIfExists deletes the azure blob container with name <container>. If it does not exist, no error is returned.

func (*StorageClient) DeleteObjectsWithPrefix

func (c *StorageClient) DeleteObjectsWithPrefix(ctx context.Context, container, prefix string) error

DeleteObjectsWithPrefix deletes the blob objects with the specific <prefix> from <container>. If it does not exist, no error is returned.

Jump to

Keyboard shortcuts

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