Debian Codegraph @

storage/2018-11-09/blob/containers/README.md

raw
1 ## Blob Storage Container SDK for API version 2018-11-09
2
3 This package allows you to interact with the Containers Blob Storage API
4
5 ### Supported Authorizers
6
7 * Azure Active Directory (for the Resource Endpoint `https://storage.azure.com`)
8 * SharedKeyLite (Blob, File & Queue)
9
10 Note: when using the `ListBlobs` operation, only `SharedKeyLite` authentication is supported.
11
12 ### Example Usage
13
14 ```go
15 package main
16
17 import (
18 "context"
19 "fmt"
20 "time"
21
22 "github.com/Azure/go-autorest/autorest"
23 "github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/containers"
24 )
25
26 func Example() error {
27 accountName := "storageaccount1"
28 storageAccountKey := "ABC123...."
29 containerName := "mycontainer"
30
31 storageAuth := autorest.NewSharedKeyLiteAuthorizer(accountName, storageAccountKey)
32 containersClient := containers.New()
33 containersClient.Client.Authorizer = storageAuth
34
35 ctx := context.TODO()
36 createInput := containers.CreateInput{
37 AccessLevel: containers.Private,
38 }
39 if _, err := containersClient.Create(ctx, accountName, containerName, createInput); err != nil {
40 return fmt.Errorf("Error creating Container: %s", err)
41 }
42
43 return nil
44 }
45 ```