| 1 | package endpointsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/endpoints`/ |
| 2 | |
| 3 | import ( |
| 4 | "fmtscip-go gomod github.com/golang/go/src go1.13 fmt/" |
| 5 | "stringsscip-go gomod github.com/golang/go/src go1.13 strings/" |
| 6 | ) |
| 7 | |
| 8 | func GetAccountNameFromEndpointscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/endpoints`/GetAccountNameFromEndpoint().(endpoint string) (*string, error) { |
| 9 | segments := stringsscip-go gomod github.com/golang/go/src go1.13 strings/.Splitscip-go gomod github.com/golang/go/src go1.13 strings/Split().(endpoint, ".") |
| 10 | if len(segments) == 0 { |
| 11 | return nil, fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.13 fmt/Errorf().("The Endpoint contained no segments") |
| 12 | } |
| 13 | return &segments[0], nil |
| 14 | } |
| 15 | |
| 16 | // GetBlobEndpoint returns the endpoint for Blob API Operations on this storage account |
| 17 | func GetBlobEndpointscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/endpoints`/GetBlobEndpoint().(baseUri string, accountName string) string { |
| 18 | return fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().("https://%s.blob.%s", accountName, baseUri) |
| 19 | } |
| 20 | |
| 21 | // GetDataLakeStoreEndpoint returns the endpoint for Data Lake Store API Operations on this storage account |
| 22 | func GetDataLakeStoreEndpointscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/endpoints`/GetDataLakeStoreEndpoint().(baseUri string, accountName string) string { |
| 23 | return fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().("https://%s.dfs.%s", accountName, baseUri) |
| 24 | } |
| 25 | |
| 26 | // GetFileEndpoint returns the endpoint for File Share API Operations on this storage account |
| 27 | func GetFileEndpointscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/endpoints`/GetFileEndpoint().(baseUri string, accountName string) string { |
| 28 | return fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().("https://%s.file.%s", accountName, baseUri) |
| 29 | } |
| 30 | |
| 31 | // GetQueueEndpoint returns the endpoint for Queue API Operations on this storage account |
| 32 | func GetQueueEndpointscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/endpoints`/GetQueueEndpoint().(baseUri string, accountName string) string { |
| 33 | return fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().("https://%s.queue.%s", accountName, baseUri) |
| 34 | } |
| 35 | |
| 36 | // GetTableEndpoint returns the endpoint for Table API Operations on this storage account |
| 37 | func GetTableEndpointscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/endpoints`/GetTableEndpoint().(baseUri string, accountName string) string { |
| 38 | return fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().("https://%s.table.%s", accountName, baseUri) |
| 39 | } |