Documentation
¶
Overview ¶
Example (Container_BatchDelete) ¶
ExampleContainerBatchDelete shows blob batch operations for delete and set tier.
package main
import (
"context"
"fmt"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob"
"log"
"os"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
)
func handleError(err error) {
if err != nil {
log.Fatal(err.Error())
}
}
func main() {
accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
if !ok {
panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
}
accountKey, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_KEY")
if !ok {
panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
}
const containerName = "testcontainer"
// create shared key credential
cred, err := azblob.NewSharedKeyCredential(accountName, accountKey)
handleError(err)
// create container batch client
containerURL := fmt.Sprintf("https://%s.blob.core.windows.net/%s", accountName, containerName)
cntBatchClient, err := container.NewClientWithSharedKeyCredential(containerURL, cred, nil)
handleError(err)
// create new batch builder
bb, err := cntBatchClient.NewBatchBuilder()
handleError(err)
// add operations to the batch builder
err = bb.Delete("testBlob0", nil)
handleError(err)
err = bb.Delete("testBlob1", &container.BatchDeleteOptions{
VersionID: to.Ptr("2023-01-03T11:57:25.4067017Z"), // version id for deletion
})
handleError(err)
err = bb.Delete("testBlob2", &container.BatchDeleteOptions{
Snapshot: to.Ptr("2023-01-03T11:57:25.6515618Z"), // snapshot for deletion
})
handleError(err)
err = bb.Delete("testBlob3", &container.BatchDeleteOptions{
DeleteOptions: blob.DeleteOptions{
DeleteSnapshots: to.Ptr(blob.DeleteSnapshotsOptionTypeOnly),
BlobDeleteType: to.Ptr(blob.DeleteTypeNone),
},
})
handleError(err)
resp, err := cntBatchClient.SubmitBatch(context.TODO(), bb, nil)
if err != nil {
fmt.Println(err.Error())
}
// get response for individual sub-requests
for _, resp := range resp.Responses {
if resp.ContainerName != nil && resp.BlobName != nil {
fmt.Println("Container: " + *resp.ContainerName)
fmt.Println("Blob: " + *resp.BlobName)
}
if resp.Error == nil {
fmt.Println("Successful sub-request")
} else {
fmt.Println("Error: " + resp.Error.Error())
}
}
}
Example (Container_BatchSetTier) ¶
ExampleContainerBatchSetTier shows blob batch operations for delete and set tier.
package main
import (
"context"
"fmt"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob"
"log"
"os"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
)
func handleError(err error) {
if err != nil {
log.Fatal(err.Error())
}
}
func main() {
accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
if !ok {
panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
}
tenantID, ok := os.LookupEnv("AZURE_STORAGE_TENANT_ID")
if !ok {
panic("AZURE_STORAGE_TENANT_ID could not be found")
}
clientID, ok := os.LookupEnv("AZURE_STORAGE_CLIENT_ID")
if !ok {
panic("AZURE_STORAGE_CLIENT_ID could not be found")
}
clientSecret, ok := os.LookupEnv("AZURE_STORAGE_CLIENT_SECRET")
if !ok {
panic("AZURE_STORAGE_CLIENT_SECRET could not be found")
}
const containerName = "testcontainer"
// create client secret credential
cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, clientSecret, nil)
handleError(err)
// create container batch client
containerURL := fmt.Sprintf("https://%s.blob.core.windows.net/%s", accountName, containerName)
cntBatchClient, err := container.NewClient(containerURL, cred, nil)
handleError(err)
// create new batch builder
bb, err := cntBatchClient.NewBatchBuilder()
handleError(err)
// add operations to the batch builder
err = bb.SetTier("testBlob1", blob.AccessTierHot, nil)
handleError(err)
err = bb.SetTier("testBlob2", blob.AccessTierCool, &container.BatchSetTierOptions{
VersionID: to.Ptr("2023-01-03T11:57:25.4067017Z"),
})
handleError(err)
err = bb.SetTier("testBlob3", blob.AccessTierCool, &container.BatchSetTierOptions{
Snapshot: to.Ptr("2023-01-03T11:57:25.6515618Z"),
})
handleError(err)
err = bb.SetTier("testBlob4", blob.AccessTierCool, &container.BatchSetTierOptions{
SetTierOptions: blob.SetTierOptions{
RehydratePriority: to.Ptr(blob.RehydratePriorityStandard),
},
})
handleError(err)
resp, err := cntBatchClient.SubmitBatch(context.TODO(), bb, nil)
if err != nil {
fmt.Println(err.Error())
}
// get response for individual sub-requests
for _, resp := range resp.Responses {
if resp.ContainerName != nil && resp.BlobName != nil {
fmt.Println("Container: " + *resp.ContainerName)
fmt.Println("Blob: " + *resp.BlobName)
}
if resp.Error == nil {
fmt.Println("Successful sub-request")
} else {
fmt.Println("Error: " + resp.Error.Error())
}
}
}
Example (Container_ClientCreate) ¶
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
)
func handleError(err error) {
if err != nil {
log.Fatal(err.Error())
}
}
func main() {
accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
if !ok {
panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
}
containerName := "testcontainer"
containerURL := fmt.Sprintf("https://%s.blob.core.windows.net/%s", accountName, containerName)
cred, err := azidentity.NewDefaultAzureCredential(nil)
handleError(err)
containerClient, err := container.NewClient(containerURL, cred, nil)
handleError(err)
containerCreateResponse, err := containerClient.Create(context.TODO(), &container.CreateOptions{
Metadata: map[string]*string{"Foo": to.Ptr("Bar")},
})
handleError(err)
fmt.Println(containerCreateResponse)
}
Example (Container_ClientDelete) ¶
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
)
func handleError(err error) {
if err != nil {
log.Fatal(err.Error())
}
}
func main() {
accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
if !ok {
panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
}
containerName := "testcontainer"
containerURL := fmt.Sprintf("https://%s.blob.core.windows.net/%s", accountName, containerName)
cred, err := azidentity.NewDefaultAzureCredential(nil)
handleError(err)
containerClient, err := container.NewClient(containerURL, cred, nil)
handleError(err)
containerDeleteResponse, err := containerClient.Delete(context.TODO(), nil)
handleError(err)
fmt.Println(containerDeleteResponse)
}
Example (Container_ClientGetSASURL) ¶
package main
import (
"fmt"
"log"
"os"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/sas"
)
func handleError(err error) {
if err != nil {
log.Fatal(err.Error())
}
}
func main() {
accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
if !ok {
panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
}
containerName := "testcontainer"
containerURL := fmt.Sprintf("https://%s.blob.core.windows.net/%s", accountName, containerName)
cred, err := azidentity.NewDefaultAzureCredential(nil)
handleError(err)
containerClient, err := container.NewClient(containerURL, cred, nil)
handleError(err)
permission := sas.ContainerPermissions{Read: true}
start := time.Now()
expiry := start.AddDate(1, 0, 0)
options := container.GetSASURLOptions{StartTime: &start}
sasURL, err := containerClient.GetSASURL(permission, expiry, &options)
handleError(err)
_ = sasURL
}
Example (Container_ClientListBlobsFlat) ¶
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
)
func handleError(err error) {
if err != nil {
log.Fatal(err.Error())
}
}
func main() {
accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
if !ok {
panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
}
containerName := "testcontainer"
containerURL := fmt.Sprintf("https://%s.blob.core.windows.net/%s", accountName, containerName)
cred, err := azidentity.NewDefaultAzureCredential(nil)
handleError(err)
containerClient, err := container.NewClient(containerURL, cred, nil)
handleError(err)
pager := containerClient.NewListBlobsFlatPager(&container.ListBlobsFlatOptions{
Include: container.ListBlobsInclude{Snapshots: true, Versions: true},
})
for pager.More() {
resp, err := pager.NextPage(context.TODO())
if err != nil {
log.Fatal(err)
}
for _, blob := range resp.Segment.BlobItems {
fmt.Println(*blob.Name)
}
}
}
Example (Container_ClientListBlobsHierarchy) ¶
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
)
func handleError(err error) {
if err != nil {
log.Fatal(err.Error())
}
}
func main() {
accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
if !ok {
panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
}
containerName := "testcontainer"
containerURL := fmt.Sprintf("https://%s.blob.core.windows.net/%s", accountName, containerName)
cred, err := azidentity.NewDefaultAzureCredential(nil)
handleError(err)
containerClient, err := container.NewClient(containerURL, cred, nil)
handleError(err)
maxResults := int32(5)
pager := containerClient.NewListBlobsHierarchyPager("/", &container.ListBlobsHierarchyOptions{
Include: container.ListBlobsInclude{Metadata: true, Tags: true},
MaxResults: &maxResults,
})
for pager.More() {
resp, err := pager.NextPage(context.TODO())
if err != nil {
log.Fatal(err)
}
for _, blob := range resp.ListBlobsHierarchySegmentResponse.Segment.BlobItems {
fmt.Println(*blob.Name)
}
}
}
Example (Container_ClientNewAppendBlobClient) ¶
package main
import (
"fmt"
"log"
"os"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
)
func handleError(err error) {
if err != nil {
log.Fatal(err.Error())
}
}
func main() {
accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
if !ok {
panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
}
containerName := "testcontainer"
containerURL := fmt.Sprintf("https://%s.blob.core.windows.net/%s", accountName, containerName)
cred, err := azidentity.NewDefaultAzureCredential(nil)
handleError(err)
containerClient, err := container.NewClient(containerURL, cred, nil)
handleError(err)
appendBlobClient := containerClient.NewAppendBlobClient("test_append_blob")
handleError(err)
fmt.Println(appendBlobClient.URL())
}
Example (Container_ClientNewBlobClient) ¶
package main
import (
"fmt"
"log"
"os"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
)
func handleError(err error) {
if err != nil {
log.Fatal(err.Error())
}
}
func main() {
accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
if !ok {
panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
}
containerName := "testcontainer"
containerURL := fmt.Sprintf("https://%s.blob.core.windows.net/%s", accountName, containerName)
cred, err := azidentity.NewDefaultAzureCredential(nil)
handleError(err)
containerClient, err := container.NewClient(containerURL, cred, nil)
handleError(err)
blobClient := containerClient.NewBlobClient("test_blob")
handleError(err)
fmt.Println(blobClient.URL())
}
Example (Container_ClientNewBlockBlobClient) ¶
package main
import (
"fmt"
"log"
"os"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
)
func handleError(err error) {
if err != nil {
log.Fatal(err.Error())
}
}
func main() {
accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
if !ok {
panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
}
containerName := "testcontainer"
containerURL := fmt.Sprintf("https://%s.blob.core.windows.net/%s", accountName, containerName)
cred, err := azidentity.NewDefaultAzureCredential(nil)
handleError(err)
containerClient, err := container.NewClient(containerURL, cred, nil)
handleError(err)
blockBlobClient := containerClient.NewBlockBlobClient("test_block_blob")
handleError(err)
fmt.Println(blockBlobClient.URL())
}
Example (Container_ClientNewPageBlobClient) ¶
package main
import (
"fmt"
"log"
"os"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
)
func handleError(err error) {
if err != nil {
log.Fatal(err.Error())
}
}
func main() {
accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
if !ok {
panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
}
containerName := "testcontainer"
containerURL := fmt.Sprintf("https://%s.blob.core.windows.net/%s", accountName, containerName)
cred, err := azidentity.NewDefaultAzureCredential(nil)
handleError(err)
containerClient, err := container.NewClient(containerURL, cred, nil)
handleError(err)
pageBlobClient := containerClient.NewPageBlobClient("test_page_blob")
handleError(err)
fmt.Println(pageBlobClient.URL())
}
Example (Container_ClientSetAccessPolicy) ¶
This example shows how to manipulate a container's permissions.
package main
import (
"bytes"
"context"
"fmt"
"io"
"log"
"net/http"
"os"
"strings"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
)
func handleError(err error) {
if err != nil {
log.Fatal(err.Error())
}
}
func main() {
accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
if !ok {
panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
}
containerName := "testcontainer"
containerURL := fmt.Sprintf("https://%s.blob.core.windows.net/%s", accountName, containerName)
cred, err := azidentity.NewDefaultAzureCredential(nil)
handleError(err)
containerClient, err := container.NewClient(containerURL, cred, nil)
handleError(err)
// Create the container
_, err = containerClient.Create(context.TODO(), nil)
handleError(err)
// Upload a simple blob.
blockBlobClient := containerClient.NewBlockBlobClient("HelloWorld.txt")
handleError(err)
_, err = blockBlobClient.Upload(context.TODO(), streaming.NopCloser(strings.NewReader("Hello World!")), nil)
handleError(err)
// Attempt to read the blob
get, err := http.Get(blockBlobClient.URL())
handleError(err)
if get.StatusCode == http.StatusNotFound {
// ChangeLease the blob to be public access blob
_, err := containerClient.SetAccessPolicy(
context.TODO(),
&container.SetAccessPolicyOptions{
Access: to.Ptr(container.PublicAccessTypeBlob),
},
)
if err != nil {
log.Fatal(err)
}
// Now, this works
get, err = http.Get(blockBlobClient.URL())
if err != nil {
log.Fatal(err)
}
var text bytes.Buffer
_, err = text.ReadFrom(get.Body)
if err != nil {
return
}
defer func(Body io.ReadCloser) {
_ = Body.Close()
}(get.Body)
fmt.Println("Public access blob data: ", text.String())
}
}
Example (Container_ClientSetMetadata) ¶
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
)
func handleError(err error) {
if err != nil {
log.Fatal(err.Error())
}
}
func main() {
accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
if !ok {
panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
}
containerName := "testcontainer"
containerURL := fmt.Sprintf("https://%s.blob.core.windows.net/%s", accountName, containerName)
cred, err := azidentity.NewDefaultAzureCredential(nil)
handleError(err)
containerClient, err := container.NewClient(containerURL, cred, nil)
handleError(err)
// Create a container with some metadata, key names are converted to lowercase before being sent to the service.
// You should always use lowercase letters, especially when querying a map for a metadata key.
creatingApp, err := os.Executable()
handleError(err)
_, err = containerClient.Create(context.TODO(), &container.CreateOptions{Metadata: map[string]*string{"author": to.Ptr("azblob"), "app": to.Ptr(creatingApp)}})
handleError(err)
// Query the container's metadata
containerGetPropertiesResponse, err := containerClient.GetProperties(context.TODO(), nil)
handleError(err)
if containerGetPropertiesResponse.Metadata == nil {
log.Fatal("metadata is empty!")
}
for k, v := range containerGetPropertiesResponse.Metadata {
fmt.Printf("%s=%s\n", k, *v)
}
// Update the metadata and write it back to the container
containerGetPropertiesResponse.Metadata["author"] = to.Ptr("Mohit")
_, err = containerClient.SetMetadata(context.TODO(), &container.SetMetadataOptions{Metadata: containerGetPropertiesResponse.Metadata})
handleError(err)
// NOTE: SetMetadata & SetProperties methods update the container's ETag & LastModified properties
}
Example (Container_NewClient) ¶
package main
import (
"fmt"
"log"
"os"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
)
func handleError(err error) {
if err != nil {
log.Fatal(err.Error())
}
}
func main() {
accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
if !ok {
panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
}
containerName := "testcontainer"
containerURL := fmt.Sprintf("https://%s.blob.core.windows.net/%s", accountName, containerName)
cred, err := azidentity.NewDefaultAzureCredential(nil)
handleError(err)
containerClient, err := container.NewClient(containerURL, cred, nil)
handleError(err)
fmt.Println(containerClient.URL())
}
Example (Container_NewClientFromConnectionString) ¶
package main
import (
"fmt"
"log"
"os"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
)
func handleError(err error) {
if err != nil {
log.Fatal(err.Error())
}
}
func main() {
// Your connection string can be obtained from the Azure Portal.
connectionString, ok := os.LookupEnv("AZURE_STORAGE_CONNECTION_STRING")
if !ok {
log.Fatal("the environment variable 'AZURE_STORAGE_CONNECTION_STRING' could not be found")
}
containerName := "testcontainer"
containerClient, err := container.NewClientFromConnectionString(connectionString, containerName, nil)
handleError(err)
fmt.Println(containerClient.URL())
}
Example (Container_NewClientWithNoCredential) ¶
package main
import (
"fmt"
"log"
"os"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
)
func handleError(err error) {
if err != nil {
log.Fatal(err.Error())
}
}
func main() {
accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME")
if !ok {
panic("AZURE_STORAGE_ACCOUNT_NAME could not be found")
}
sharedAccessSignature, ok := os.LookupEnv("AZURE_STORAGE_SHARED_ACCESS_SIGNATURE")
if !ok {
panic("AZURE_STORAGE_SHARED_ACCESS_SIGNATURE could not be found")
}
containerName := "testcontainer"
containerURL := fmt.Sprintf("https://%s.blob.core.windows.net/%s?%s", accountName, containerName, sharedAccessSignature)
containerClient, err := container.NewClientWithNoCredential(containerURL, nil)
handleError(err)
fmt.Println(containerClient.URL())
}
Index ¶
- type AccessConditions
- type AccessPolicy
- type AccessPolicyPermission
- type AccessTier
- type AccountKind
- type ArchiveStatus
- type BatchBuilder
- type BatchDeleteOptions
- type BatchResponseItem
- type BatchSetTierOptions
- type BlobFlatListSegment
- type BlobHierarchyListSegment
- type BlobItem
- type BlobPrefix
- type BlobProperties
- type BlobTag
- type BlobTags
- type BlobType
- type CPKScopeInfo
- type Client
- func NewClient(containerURL string, cred azcore.TokenCredential, options *ClientOptions) (*Client, error)
- func NewClientFromConnectionString(connectionString string, containerName string, options *ClientOptions) (*Client, error)
- func NewClientWithNoCredential(containerURL string, options *ClientOptions) (*Client, error)
- func NewClientWithSharedKeyCredential(containerURL string, cred *SharedKeyCredential, options *ClientOptions) (*Client, error)
- func (c *Client) Create(ctx context.Context, options *CreateOptions) (CreateResponse, error)
- func (c *Client) Delete(ctx context.Context, options *DeleteOptions) (DeleteResponse, error)
- func (c *Client) GetAccessPolicy(ctx context.Context, o *GetAccessPolicyOptions) (GetAccessPolicyResponse, error)
- func (c *Client) GetAccountInfo(ctx context.Context, o *GetAccountInfoOptions) (GetAccountInfoResponse, error)
- func (c *Client) GetProperties(ctx context.Context, o *GetPropertiesOptions) (GetPropertiesResponse, error)
- func (c *Client) GetSASURL(permissions sas.ContainerPermissions, expiry time.Time, o *GetSASURLOptions) (string, error)
- func (c *Client) NewAppendBlobClient(blobName string) *appendblob.Client
- func (c *Client) NewBatchBuilder() (*BatchBuilder, error)
- func (c *Client) NewBlobClient(blobName string) *blob.Client
- func (c *Client) NewBlockBlobClient(blobName string) *blockblob.Client
- func (c *Client) NewListBlobsFlatPager(o *ListBlobsFlatOptions) *runtime.Pager[ListBlobsFlatResponse]
- func (c *Client) NewListBlobsHierarchyPager(delimiter string, o *ListBlobsHierarchyOptions) *runtime.Pager[ListBlobsHierarchyResponse]
- func (c *Client) NewPageBlobClient(blobName string) *pageblob.Client
- func (c *Client) Restore(ctx context.Context, deletedContainerVersion string, options *RestoreOptions) (RestoreResponse, error)
- func (c *Client) SetAccessPolicy(ctx context.Context, o *SetAccessPolicyOptions) (SetAccessPolicyResponse, error)
- func (c *Client) SetMetadata(ctx context.Context, o *SetMetadataOptions) (SetMetadataResponse, error)
- func (c *Client) SubmitBatch(ctx context.Context, bb *BatchBuilder, options *SubmitBatchOptions) (SubmitBatchResponse, error)
- func (c *Client) URL() string
- type ClientOptions
- type CopyStatusType
- type CreateOptions
- type CreateResponse
- type DeleteOptions
- type DeleteResponse
- type GetAccessPolicyOptions
- type GetAccessPolicyResponse
- type GetAccountInfoOptions
- type GetAccountInfoResponse
- type GetPropertiesOptions
- type GetPropertiesResponse
- type GetSASURLOptions
- type ImmutabilityPolicyMode
- type LeaseAccessConditions
- type ListBlobsFlatOptions
- type ListBlobsFlatResponse
- type ListBlobsFlatSegmentResponse
- type ListBlobsHierarchyOptions
- type ListBlobsHierarchyResponse
- type ListBlobsHierarchySegmentResponse
- type ListBlobsInclude
- type ModifiedAccessConditions
- type PublicAccessType
- type RehydratePriority
- type RestoreOptions
- type RestoreResponse
- type SKUName
- type SetAccessPolicyOptions
- type SetAccessPolicyResponse
- type SetMetadataOptions
- type SetMetadataResponse
- type SharedKeyCredential
- type SignedIdentifier
- type SubmitBatchOptions
- type SubmitBatchResponse
Examples ¶
- Package (Container_BatchDelete)
- Package (Container_BatchSetTier)
- Package (Container_ClientCreate)
- Package (Container_ClientDelete)
- Package (Container_ClientGetSASURL)
- Package (Container_ClientListBlobsFlat)
- Package (Container_ClientListBlobsHierarchy)
- Package (Container_ClientNewAppendBlobClient)
- Package (Container_ClientNewBlobClient)
- Package (Container_ClientNewBlockBlobClient)
- Package (Container_ClientNewPageBlobClient)
- Package (Container_ClientSetAccessPolicy)
- Package (Container_ClientSetMetadata)
- Package (Container_NewClient)
- Package (Container_NewClientFromConnectionString)
- Package (Container_NewClientWithNoCredential)
- Package (Container_NewClientWithSharedKeyCredential)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessConditions ¶
type AccessConditions = exported.ContainerAccessConditions
AccessConditions identifies container-specific access conditions which you optionally set.
type AccessPolicyPermission ¶
type AccessPolicyPermission = exported.AccessPolicyPermission
AccessPolicyPermission type simplifies creating the permissions string for a container's access policy. Initialize an instance of this type and then call its String method to set AccessPolicy's Permission field.
type AccessTier ¶ added in v0.6.0
type AccessTier = generated.AccessTier
AccessTier defines values for blob access tiers.
const ( AccessTierArchive AccessTier = generated.AccessTierArchive AccessTierCool AccessTier = generated.AccessTierCool AccessTierHot AccessTier = generated.AccessTierHot AccessTierP10 AccessTier = generated.AccessTierP10 AccessTierP15 AccessTier = generated.AccessTierP15 AccessTierP20 AccessTier = generated.AccessTierP20 AccessTierP30 AccessTier = generated.AccessTierP30 AccessTierP4 AccessTier = generated.AccessTierP4 AccessTierP40 AccessTier = generated.AccessTierP40 AccessTierP50 AccessTier = generated.AccessTierP50 AccessTierP6 AccessTier = generated.AccessTierP6 AccessTierP60 AccessTier = generated.AccessTierP60 AccessTierP70 AccessTier = generated.AccessTierP70 AccessTierP80 AccessTier = generated.AccessTierP80 AccessTierPremium AccessTier = generated.AccessTierPremium )
func PossibleAccessTierValues ¶ added in v0.6.0
func PossibleAccessTierValues() []AccessTier
PossibleAccessTierValues returns the possible values for the AccessTier const type.
type AccountKind ¶
type AccountKind = generated.AccountKind
AccountKind defines values for AccountKind
const ( AccountKindStorage AccountKind = generated.AccountKindStorage AccountKindBlobStorage AccountKind = generated.AccountKindBlobStorage AccountKindStorageV2 AccountKind = generated.AccountKindStorageV2 AccountKindFileStorage AccountKind = generated.AccountKindFileStorage AccountKindBlockBlobStorage AccountKind = generated.AccountKindBlockBlobStorage )
func PossibleAccountKindValues ¶
func PossibleAccountKindValues() []AccountKind
PossibleAccountKindValues returns the possible values for the AccountKind const type.
type ArchiveStatus ¶
type ArchiveStatus = generated.ArchiveStatus
ArchiveStatus defines values for ArchiveStatus
const ( ArchiveStatusRehydratePendingToCool ArchiveStatus = generated.ArchiveStatusRehydratePendingToCool ArchiveStatusRehydratePendingToHot ArchiveStatus = generated.ArchiveStatusRehydratePendingToHot )
func PossibleArchiveStatusValues ¶
func PossibleArchiveStatusValues() []ArchiveStatus
PossibleArchiveStatusValues returns the possible values for the ArchiveStatus const type.
type BatchBuilder ¶ added in v1.1.0
type BatchBuilder struct {
// contains filtered or unexported fields
}
BatchBuilder is used for creating the batch operations list. It contains the list of either delete or set tier sub-requests. NOTE: All sub-requests in the batch must be of the same type, either delete or set tier.
func (*BatchBuilder) Delete ¶ added in v1.1.0
func (bb *BatchBuilder) Delete(blobName string, options *BatchDeleteOptions) error
Delete operation is used to add delete sub-request to the batch builder.
func (*BatchBuilder) SetTier ¶ added in v1.1.0
func (bb *BatchBuilder) SetTier(blobName string, accessTier blob.AccessTier, options *BatchSetTierOptions) error
SetTier operation is used to add set tier sub-request to the batch builder.
type BatchDeleteOptions ¶ added in v1.1.0
type BatchDeleteOptions struct {
blob.DeleteOptions
VersionID *string
Snapshot *string
}
BatchDeleteOptions contains the optional parameters for the BatchBuilder.Delete method.
type BatchResponseItem ¶ added in v1.1.0
type BatchResponseItem = exported.BatchResponseItem
BatchResponseItem contains the response for the individual sub-requests.
type BatchSetTierOptions ¶ added in v1.1.0
type BatchSetTierOptions struct {
blob.SetTierOptions
VersionID *string
Snapshot *string
}
BatchSetTierOptions contains the optional parameters for the BatchBuilder.SetTier method.
type BlobFlatListSegment ¶ added in v1.0.0
type BlobFlatListSegment = generated.BlobFlatListSegment
BlobFlatListSegment - List of BlobItem.
type BlobHierarchyListSegment ¶ added in v1.0.0
type BlobHierarchyListSegment = generated.BlobHierarchyListSegment
BlobHierarchyListSegment - List of BlobItem and BlobPrefix.
type BlobPrefix ¶ added in v0.6.0
type BlobPrefix = generated.BlobPrefix
BlobPrefix is a blob's prefix when hierarchically listing blobs.
type BlobProperties ¶
type BlobProperties = generated.BlobProperties
BlobProperties - Properties of a blob.
type BlobType ¶
BlobType defines values for BlobType
const ( BlobTypeBlockBlob BlobType = generated.BlobTypeBlockBlob BlobTypePageBlob BlobType = generated.BlobTypePageBlob BlobTypeAppendBlob BlobType = generated.BlobTypeAppendBlob )
func PossibleBlobTypeValues ¶
func PossibleBlobTypeValues() []BlobType
PossibleBlobTypeValues returns the possible values for the BlobType const type.
type CPKScopeInfo ¶ added in v1.0.0
type CPKScopeInfo = generated.ContainerCPKScopeInfo
CPKScopeInfo contains a group of parameters for the ContainerClient.Create method.
type Client ¶
type Client base.Client[generated.ContainerClient]
Client represents a URL to the Azure Storage container allowing you to manipulate its blobs.
func NewClient ¶
func NewClient(containerURL string, cred azcore.TokenCredential, options *ClientOptions) (*Client, error)
NewClient creates an instance of Client with the specified values.
- containerURL - the URL of the container e.g. https://<account>.blob.core.windows.net/container
- cred - an Azure AD credential, typically obtained via the azidentity module
- options - client options; pass nil to accept the default values
func NewClientFromConnectionString ¶
func NewClientFromConnectionString(connectionString string, containerName string, options *ClientOptions) (*Client, error)
NewClientFromConnectionString creates an instance of Client with the specified values.
- connectionString - a connection string for the desired storage account
- containerName - the name of the container within the storage account
- options - client options; pass nil to accept the default values
func NewClientWithNoCredential ¶
func NewClientWithNoCredential(containerURL string, options *ClientOptions) (*Client, error)
NewClientWithNoCredential creates an instance of Client with the specified values. This is used to anonymously access a container or with a shared access signature (SAS) token.
- containerURL - the URL of the container e.g. https://<account>.blob.core.windows.net/container?<sas token>
- options - client options; pass nil to accept the default values
func NewClientWithSharedKeyCredential ¶
func NewClientWithSharedKeyCredential(containerURL string, cred *SharedKeyCredential, options *ClientOptions) (*Client, error)
NewClientWithSharedKeyCredential creates an instance of Client with the specified values.
- containerURL - the URL of the container e.g. https://<account>.blob.core.windows.net/container
- cred - a SharedKeyCredential created with the matching container's storage account and access key
- options - client options; pass nil to accept the default values
func (*Client) Create ¶
func (c *Client) Create(ctx context.Context, options *CreateOptions) (CreateResponse, error)
Create creates a new container within a storage account. If a container with the same name already exists, the operation fails. For more information, see https://docs.microsoft.com/rest/api/storageservices/create-container.
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, options *DeleteOptions) (DeleteResponse, error)
Delete marks the specified container for deletion. The container and any blobs contained within it are later deleted during garbage collection. For more information, see https://docs.microsoft.com/rest/api/storageservices/delete-container.
func (*Client) GetAccessPolicy ¶
func (c *Client) GetAccessPolicy(ctx context.Context, o *GetAccessPolicyOptions) (GetAccessPolicyResponse, error)
GetAccessPolicy returns the container's access policy. The access policy indicates whether container's blobs may be accessed publicly. For more information, see https://docs.microsoft.com/rest/api/storageservices/get-container-acl.
func (*Client) GetAccountInfo ¶ added in v1.1.0
func (c *Client) GetAccountInfo(ctx context.Context, o *GetAccountInfoOptions) (GetAccountInfoResponse, error)
GetAccountInfo provides account level information For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/get-account-information?tabs=shared-access-signatures.
func (*Client) GetProperties ¶
func (c *Client) GetProperties(ctx context.Context, o *GetPropertiesOptions) (GetPropertiesResponse, error)
GetProperties returns the container's properties. For more information, see https://docs.microsoft.com/rest/api/storageservices/get-container-metadata.
func (*Client) GetSASURL ¶
func (c *Client) GetSASURL(permissions sas.ContainerPermissions, expiry time.Time, o *GetSASURLOptions) (string, error)
GetSASURL is a convenience method for generating a SAS token for the currently pointed at container. It can only be used if the credential supplied during creation was a SharedKeyCredential.
func (*Client) NewAppendBlobClient ¶
func (c *Client) NewAppendBlobClient(blobName string) *appendblob.Client
NewAppendBlobClient creates a new appendblob.Client object by concatenating blobName to the end of this Client's URL. The blob name will be URL-encoded. The new appendblob.Client uses the same request policy pipeline as this Client.
func (*Client) NewBatchBuilder ¶ added in v1.1.0
func (c *Client) NewBatchBuilder() (*BatchBuilder, error)
NewBatchBuilder creates an instance of BatchBuilder using the same auth policy as the client. BatchBuilder is used to build the batch consisting of either delete or set tier sub-requests. All sub-requests in the batch must be of the same type, either delete or set tier.
func (*Client) NewBlobClient ¶
NewBlobClient creates a new blob.Client object by concatenating blobName to the end of Client's URL. The blob name will be URL-encoded. The new blob.Client uses the same request policy pipeline as this Client.
func (*Client) NewBlockBlobClient ¶
NewBlockBlobClient creates a new blockblob.Client object by concatenating blobName to the end of this Client's URL. The blob name will be URL-encoded. The new blockblob.Client uses the same request policy pipeline as this Client.
func (*Client) NewListBlobsFlatPager ¶
func (c *Client) NewListBlobsFlatPager(o *ListBlobsFlatOptions) *runtime.Pager[ListBlobsFlatResponse]
NewListBlobsFlatPager returns a pager for blobs starting from the specified Marker. Use an empty Marker to start enumeration from the beginning. Blob names are returned in lexicographic order. For more information, see https://docs.microsoft.com/rest/api/storageservices/list-blobs.
func (*Client) NewListBlobsHierarchyPager ¶
func (c *Client) NewListBlobsHierarchyPager(delimiter string, o *ListBlobsHierarchyOptions) *runtime.Pager[ListBlobsHierarchyResponse]
NewListBlobsHierarchyPager returns a channel of blobs starting from the specified Marker. Use an empty Marker to start enumeration from the beginning. Blob names are returned in lexicographic order. After getting a segment, process it, and then call ListBlobsHierarchicalSegment again (passing the previously-returned Marker) to get the next segment. For more information, see https://docs.microsoft.com/rest/api/storageservices/list-blobs.
func (*Client) NewPageBlobClient ¶
NewPageBlobClient creates a new pageblob.Client object by concatenating blobName to the end of this Client's URL. The blob name will be URL-encoded. The new pageblob.Client uses the same request policy pipeline as this Client.
func (*Client) Restore ¶
func (c *Client) Restore(ctx context.Context, deletedContainerVersion string, options *RestoreOptions) (RestoreResponse, error)
Restore operation restore the contents and properties of a soft deleted container to a specified container. For more information, see https://docs.microsoft.com/en-us/rest/api/storageservices/restore-container.
func (*Client) SetAccessPolicy ¶
func (c *Client) SetAccessPolicy(ctx context.Context, o *SetAccessPolicyOptions) (SetAccessPolicyResponse, error)
SetAccessPolicy sets the container's permissions. The access policy indicates whether blobs in a container may be accessed publicly. For more information, see https://docs.microsoft.com/rest/api/storageservices/set-container-acl.
func (*Client) SetMetadata ¶
func (c *Client) SetMetadata(ctx context.Context, o *SetMetadataOptions) (SetMetadataResponse, error)
SetMetadata sets the container's metadata. For more information, see https://docs.microsoft.com/rest/api/storageservices/set-container-metadata.
func (*Client) SubmitBatch ¶ added in v1.1.0
func (c *Client) SubmitBatch(ctx context.Context, bb *BatchBuilder, options *SubmitBatchOptions) (SubmitBatchResponse, error)
SubmitBatch operation allows multiple API calls to be embedded into a single HTTP request. It builds the request body using the BatchBuilder object passed. BatchBuilder contains the list of operations to be submitted. It supports up to 256 sub-requests in a single batch. For more information, see https://docs.microsoft.com/rest/api/storageservices/blob-batch.
type ClientOptions ¶
type ClientOptions base.ClientOptions
ClientOptions contains the optional parameters when creating a Client.
type CopyStatusType ¶
type CopyStatusType = generated.CopyStatusType
CopyStatusType defines values for CopyStatusType
const ( CopyStatusTypePending CopyStatusType = generated.CopyStatusTypePending CopyStatusTypeSuccess CopyStatusType = generated.CopyStatusTypeSuccess CopyStatusTypeAborted CopyStatusType = generated.CopyStatusTypeAborted CopyStatusTypeFailed CopyStatusType = generated.CopyStatusTypeFailed )
func PossibleCopyStatusTypeValues ¶
func PossibleCopyStatusTypeValues() []CopyStatusType
PossibleCopyStatusTypeValues returns the possible values for the CopyStatusType const type.
type CreateOptions ¶
type CreateOptions struct {
// Specifies whether data in the container may be accessed publicly and the level of access.
Access *PublicAccessType
// Optional. Specifies a user-defined name-value pair associated with the blob.
Metadata map[string]*string
// Optional. Specifies the encryption scope settings to set on the container.
CPKScopeInfo *CPKScopeInfo
}
CreateOptions contains the optional parameters for the Client.Create method.
type CreateResponse ¶
type CreateResponse = generated.ContainerClientCreateResponse
CreateResponse contains the response from method Client.Create.
type DeleteOptions ¶
type DeleteOptions struct {
AccessConditions *AccessConditions
}
DeleteOptions contains the optional parameters for the Client.Delete method.
type DeleteResponse ¶
type DeleteResponse = generated.ContainerClientDeleteResponse
DeleteResponse contains the response from method Client.Delete.
type GetAccessPolicyOptions ¶
type GetAccessPolicyOptions struct {
LeaseAccessConditions *LeaseAccessConditions
}
GetAccessPolicyOptions contains the optional parameters for the Client.GetAccessPolicy method.
type GetAccessPolicyResponse ¶
type GetAccessPolicyResponse = generated.ContainerClientGetAccessPolicyResponse
GetAccessPolicyResponse contains the response from method Client.GetAccessPolicy.
type GetAccountInfoOptions ¶ added in v1.1.0
type GetAccountInfoOptions struct {
}
GetAccountInfoOptions provides set of options for Client.GetAccountInfo
type GetAccountInfoResponse ¶ added in v1.1.0
type GetAccountInfoResponse = generated.ContainerClientGetAccountInfoResponse
GetAccountInfoResponse contains the response from method Client.GetAccountInfo.
type GetPropertiesOptions ¶
type GetPropertiesOptions struct {
LeaseAccessConditions *LeaseAccessConditions
}
GetPropertiesOptions contains the optional parameters for the ContainerClient.GetProperties method.
type GetPropertiesResponse ¶
type GetPropertiesResponse = generated.ContainerClientGetPropertiesResponse
GetPropertiesResponse contains the response from method Client.GetProperties.
type GetSASURLOptions ¶ added in v1.0.0
GetSASURLOptions contains the optional parameters for the Client.GetSASURL method.
type ImmutabilityPolicyMode ¶
type ImmutabilityPolicyMode = generated.ImmutabilityPolicyMode
ImmutabilityPolicyMode defines values for ImmutabilityPolicyMode
const ( ImmutabilityPolicyModeMutable ImmutabilityPolicyMode = generated.ImmutabilityPolicyModeMutable ImmutabilityPolicyModeUnlocked ImmutabilityPolicyMode = generated.ImmutabilityPolicyModeUnlocked ImmutabilityPolicyModeLocked ImmutabilityPolicyMode = generated.ImmutabilityPolicyModeLocked )
func PossibleImmutabilityPolicyModeValues ¶
func PossibleImmutabilityPolicyModeValues() []ImmutabilityPolicyMode
PossibleImmutabilityPolicyModeValues returns the possible values for the ImmutabilityPolicyMode const type.
type LeaseAccessConditions ¶
type LeaseAccessConditions = exported.LeaseAccessConditions
LeaseAccessConditions contains optional parameters to access leased entity.
type ListBlobsFlatOptions ¶
type ListBlobsFlatOptions struct {
// Include this parameter to specify one or more datasets to include in the response.
Include ListBlobsInclude
// A string value that identifies the portion of the list of containers to be returned with the next listing operation. The
// operation returns the NextMarker value within the response body if the listing
// operation did not return all containers remaining to be listed with the current page. The NextMarker value can be used
// as the value for the marker parameter in a subsequent call to request the next
// page of list items. The marker value is opaque to the client.
Marker *string
// Specifies the maximum number of containers to return. If the request does not specify MaxResults, or specifies a value
// greater than 5000, the server will return up to 5000 items. Note that if the
// listing operation crosses a partition boundary, then the service will return a continuation token for retrieving the remainder
// of the results. For this reason, it is possible that the service will
// return fewer results than specified by MaxResults, or than the default of 5000.
MaxResults *int32
// Filters the results to return only containers whose name begins with the specified prefix.
Prefix *string
}
ListBlobsFlatOptions contains the optional parameters for the ContainerClient.ListBlobFlatSegment method.
type ListBlobsFlatResponse ¶
type ListBlobsFlatResponse = generated.ContainerClientListBlobFlatSegmentResponse
ListBlobsFlatResponse contains the response from method Client.ListBlobFlatSegment.
type ListBlobsFlatSegmentResponse ¶ added in v1.0.0
type ListBlobsFlatSegmentResponse = generated.ListBlobsFlatSegmentResponse
ListBlobsFlatSegmentResponse - An enumeration of blobs
type ListBlobsHierarchyOptions ¶
type ListBlobsHierarchyOptions struct {
// Include this parameter to specify one or more datasets to include in the response.
Include ListBlobsInclude
// A string value that identifies the portion of the list of containers to be returned with the next listing operation. The
// operation returns the NextMarker value within the response body if the listing
// operation did not return all containers remaining to be listed with the current page. The NextMarker value can be used
// as the value for the marker parameter in a subsequent call to request the next
// page of list items. The marker value is opaque to the client.
Marker *string
// Specifies the maximum number of containers to return. If the request does not specify MaxResults, or specifies a value
// greater than 5000, the server will return up to 5000 items. Note that if the
// listing operation crosses a partition boundary, then the service will return a continuation token for retrieving the remainder
// of the results. For this reason, it is possible that the service will
// return fewer results than specified by MaxResults, or than the default of 5000.
MaxResults *int32
// Filters the results to return only containers whose name begins with the specified prefix.
Prefix *string
}
ListBlobsHierarchyOptions provides set of configurations for Client.NewListBlobsHierarchyPager
type ListBlobsHierarchyResponse ¶
type ListBlobsHierarchyResponse = generated.ContainerClientListBlobHierarchySegmentResponse
ListBlobsHierarchyResponse contains the response from method Client.ListBlobHierarchySegment.
type ListBlobsHierarchySegmentResponse ¶ added in v1.0.0
type ListBlobsHierarchySegmentResponse = generated.ListBlobsHierarchySegmentResponse
ListBlobsHierarchySegmentResponse - An enumeration of blobs
type ListBlobsInclude ¶
type ListBlobsInclude struct {
Copy, Metadata, Snapshots, UncommittedBlobs, Deleted, Tags, Versions, LegalHold, ImmutabilityPolicy, DeletedWithVersions bool
}
ListBlobsInclude indicates what additional information the service should return with each blob.
type ModifiedAccessConditions ¶
type ModifiedAccessConditions = exported.ModifiedAccessConditions
ModifiedAccessConditions contains a group of parameters for specifying access conditions.
type PublicAccessType ¶
type PublicAccessType = generated.PublicAccessType
PublicAccessType defines values for AccessType - private (default) or blob or container.
const ( PublicAccessTypeBlob PublicAccessType = generated.PublicAccessTypeBlob PublicAccessTypeContainer PublicAccessType = generated.PublicAccessTypeContainer )
func PossiblePublicAccessTypeValues ¶
func PossiblePublicAccessTypeValues() []PublicAccessType
PossiblePublicAccessTypeValues returns the possible values for the PublicAccessType const type.
type RehydratePriority ¶
type RehydratePriority = generated.RehydratePriority
RehydratePriority - If an object is in rehydrate pending state then this header is returned with priority of rehydrate. Valid values are High and Standard.
const ( RehydratePriorityHigh RehydratePriority = generated.RehydratePriorityHigh RehydratePriorityStandard RehydratePriority = generated.RehydratePriorityStandard )
func PossibleRehydratePriorityValues ¶
func PossibleRehydratePriorityValues() []RehydratePriority
PossibleRehydratePriorityValues returns the possible values for the RehydratePriority const type.
type RestoreOptions ¶
type RestoreOptions struct {
}
RestoreOptions contains the optional parameters for the Client.Restore method.
type RestoreResponse ¶
type RestoreResponse = generated.ContainerClientRestoreResponse
RestoreResponse contains the response from method Client.Restore.
type SKUName ¶
SKUName defines values for SkuName - LRS, GRS, RAGRS, ZRS, Premium LRS.
const ( SKUNameStandardLRS SKUName = generated.SKUNameStandardLRS SKUNameStandardGRS SKUName = generated.SKUNameStandardGRS SKUNameStandardRAGRS SKUName = generated.SKUNameStandardRAGRS SKUNameStandardZRS SKUName = generated.SKUNameStandardZRS SKUNamePremiumLRS SKUName = generated.SKUNamePremiumLRS )
func PossibleSKUNameValues ¶
func PossibleSKUNameValues() []SKUName
PossibleSKUNameValues returns the possible values for the SKUName const type.
type SetAccessPolicyOptions ¶
type SetAccessPolicyOptions struct {
// Specifies whether data in the container may be accessed publicly and the level of access.
// If this header is not included in the request, container data is private to the account owner.
Access *PublicAccessType
AccessConditions *AccessConditions
ContainerACL []*SignedIdentifier
}
SetAccessPolicyOptions provides set of configurations for ContainerClient.SetAccessPolicy operation.
type SetAccessPolicyResponse ¶
type SetAccessPolicyResponse = generated.ContainerClientSetAccessPolicyResponse
SetAccessPolicyResponse contains the response from method Client.SetAccessPolicy.
type SetMetadataOptions ¶
type SetMetadataOptions struct {
Metadata map[string]*string
LeaseAccessConditions *LeaseAccessConditions
ModifiedAccessConditions *ModifiedAccessConditions
}
SetMetadataOptions contains the optional parameters for the Client.SetMetadata method.
type SetMetadataResponse ¶
type SetMetadataResponse = generated.ContainerClientSetMetadataResponse
SetMetadataResponse contains the response from method Client.SetMetadata.
type SharedKeyCredential ¶
type SharedKeyCredential = exported.SharedKeyCredential
SharedKeyCredential contains an account's name and its primary or secondary key.
func NewSharedKeyCredential ¶
func NewSharedKeyCredential(accountName, accountKey string) (*SharedKeyCredential, error)
NewSharedKeyCredential creates an immutable SharedKeyCredential containing the storage account's name and either its primary or secondary key.
type SignedIdentifier ¶
type SignedIdentifier = generated.SignedIdentifier
SignedIdentifier - signed identifier.
type SubmitBatchOptions ¶ added in v1.1.0
type SubmitBatchOptions struct {
}
SubmitBatchOptions contains the optional parameters for the Client.SubmitBatch method.
type SubmitBatchResponse ¶ added in v1.1.0
type SubmitBatchResponse struct {
// Responses contains the responses of the sub-requests in the batch
Responses []*BatchResponseItem
// ContentType contains the information returned from the Content-Type header response.
ContentType *string
// RequestID contains the information returned from the x-ms-request-id header response.
RequestID *string
// Version contains the information returned from the x-ms-version header response.
Version *string
}
SubmitBatchResponse contains the response from method Client.SubmitBatch.