Debian Codegraph @

storage/2017-07-29/blob/blobs/README.md

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