Debian Codegraph @

storage/2020-08-04/file/directories/README.md

raw
1 ## File Storage Directories SDK for API version 2020-08-04
2
3 This package allows you to interact with the Directories File 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 ### Limitations
11
12 * At this time the headers `x-ms-file-permission` and `x-ms-file-attributes` are hard-coded (to `inherit` and `None`, respectively).
13
14 ### Example Usage
15
16 ```go
17 package main
18
19 import (
20 "context"
21 "fmt"
22 "time"
23
24 "github.com/Azure/go-autorest/autorest"
25 "github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/directories"
26 )
27
28 func Example() error {
29 accountName := "storageaccount1"
30 storageAccountKey := "ABC123...."
31 shareName := "myshare"
32 directoryName := "myfiles"
33
34 storageAuth := autorest.NewSharedKeyLiteAuthorizer(accountName, storageAccountKey)
35 directoriesClient := directories.New()
36 directoriesClient.Client.Authorizer = storageAuth
37
38 ctx := context.TODO()
39 metadata := map[string]string{
40 "hello": "world",
41 }
42 if _, err := directoriesClient.Create(ctx, accountName, shareName, directoryName, metadata); err != nil {
43 return fmt.Errorf("Error creating Directory: %s", err)
44 }
45
46 return nil
47 }
48 ```