| 1 |
## File Storage Files SDK for API version 2019-12-12 |
| 2 |
|
| 3 |
This package allows you to interact with the Files 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/2019-12-12/file/files" |
| 26 |
) |
| 27 |
|
| 28 |
func Example() error { |
| 29 |
accountName := "storageaccount1" |
| 30 |
storageAccountKey := "ABC123...." |
| 31 |
shareName := "myshare" |
| 32 |
directoryName := "myfiles" |
| 33 |
fileName := "example.txt" |
| 34 |
|
| 35 |
storageAuth := autorest.NewSharedKeyLiteAuthorizer(accountName, storageAccountKey) |
| 36 |
filesClient := files.New() |
| 37 |
filesClient.Client.Authorizer = storageAuth |
| 38 |
|
| 39 |
ctx := context.TODO() |
| 40 |
input := files.CreateInput{} |
| 41 |
if _, err := filesClient.Create(ctx, accountName, shareName, directoryName, fileName, input); err != nil { |
| 42 |
return fmt.Errorf("Error creating File: %s", err) |
| 43 |
} |
| 44 |
|
| 45 |
return nil |
| 46 |
} |
| 47 |
``` |