blobstorage

package
v1.15.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBlobHTTPHeadersFromRequest

func CreateBlobHTTPHeadersFromRequest(meta map[string]string, contentType *string, log logger.Logger) (blob.HTTPHeaders, error)

func SanitizeMetadata

func SanitizeMetadata(log logger.Logger, metadata map[string]string) map[string]*string

SanitizeMetadata is used by Azure Blob Storage components to sanitize the metadata. Keys can only contain [A-Za-z0-9], and values are only allowed characters in the ASCII table.

Types

type BlobStorageMetadata

type BlobStorageMetadata struct {
	ContainerClientOpts     `json:",inline" mapstructure:",squash"`
	DecodeBase64            bool `json:"decodeBase64,string" mapstructure:"decodeBase64" mdonly:"bindings"`
	PublicAccessLevel       azblob.PublicAccessType
	DisableEntityManagement bool `json:"disableEntityManagement,string" mapstructure:"disableEntityManagement"`
}

func CreateContainerStorageClient

func CreateContainerStorageClient(parentCtx context.Context, log logger.Logger, meta map[string]string) (*container.Client, *BlobStorageMetadata, error)

CreateContainerStorageClient returns a container.Client and the parsed metadata from the metadata dictionary.

type ContainerClientOpts

type ContainerClientOpts struct {
	// Use a connection string
	ConnectionString string
	ContainerName    string

	// Use a shared account key
	AccountName string
	AccountKey  string

	// Misc
	RetryCount int32 `json:"retryCount,string"`
	// contains filtered or unexported fields
}

func (*ContainerClientOpts) EnsureContainer

func (opts *ContainerClientOpts) EnsureContainer(ctx context.Context, client *container.Client, accessLevel *azblob.PublicAccessType) error

EnsureContainer creates the container if it doesn't already exist. Property "accessLevel" indicates the public access level; nil-value means the container is private

func (*ContainerClientOpts) GetContainerURL

func (opts *ContainerClientOpts) GetContainerURL(azEnvSettings azauth.EnvironmentSettings) (u *url.URL, err error)

GetContainerURL returns the URL of the container, needed by some auth methods.

func (*ContainerClientOpts) InitContainerClient

func (opts *ContainerClientOpts) InitContainerClient(azEnvSettings azauth.EnvironmentSettings) (client *container.Client, err error)

InitContainerClient returns a new container.Client object from the given options.

Jump to

Keyboard shortcuts

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