| 1 | ## Blob Storage Blobs SDK for API version 2019-12-12 |
| 2 | |
| 3 | This package allows you to interact with the Blobs 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 | ### Example Usage |
| 11 | |
| 12 | ```go |
| 13 | package main |
| 14 | |
| 15 | import ( |
| 16 | "context" |
| 17 | "fmt" |
| 18 | "time" |
| 19 | |
| 20 | "github.com/Azure/go-autorest/autorest" |
| 21 | "github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/blobs" |
| 22 | ) |
| 23 | |
| 24 | func Example() error { |
| 25 | accountName := "storageaccount1" |
| 26 | storageAccountKey := "ABC123...." |
| 27 | containerName := "mycontainer" |
| 28 | fileName := "example-large-file.iso" |
| 29 | |
| 30 | storageAuth := autorest.NewSharedKeyLiteAuthorizer(accountName, storageAccountKey) |
| 31 | blobClient := blobs.New() |
| 32 | blobClient.Client.Authorizer = storageAuth |
| 33 | |
| 34 | ctx := context.TODO() |
| 35 | copyInput := blobs.CopyInput{ |
| 36 | CopySource: "http://releases.ubuntu.com/14.04/ubuntu-14.04.6-desktop-amd64.iso", |
| 37 | } |
| 38 | refreshInterval := 5 * time.Second |
| 39 | if err := blobClient.CopyAndWait(ctx, accountName, containerName, fileName, copyInput, refreshInterval); err != nil { |
| 40 | return fmt.Errorf("Error copying: %s", err) |
| 41 | } |
| 42 | |
| 43 | return nil |
| 44 | } |
| 45 | |
| 46 | ``` |