65b0d73cb7
This change is slightly more complex than previous package maves in that the package name changed. To address this, we simply always reference the package driver as storagedriver to avoid compatbility issues with existing code. While unfortunate, this can be cleaned up over time. Signed-off-by: Stephen J Day <stephen.day@docker.com>
25 lines
617 B
Go
25 lines
617 B
Go
package azure
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
|
|
azure "github.com/MSOpenTech/azure-sdk-for-go/clients/storage"
|
|
)
|
|
|
|
// azureBlockStorage is adaptor between azure.BlobStorageClient and
|
|
// blockStorage interface.
|
|
type azureBlockStorage struct {
|
|
azure.BlobStorageClient
|
|
}
|
|
|
|
func (b *azureBlockStorage) GetSectionReader(container, blob string, start, length int64) (io.ReadCloser, error) {
|
|
return b.BlobStorageClient.GetBlobRange(container, blob, fmt.Sprintf("%v-%v", start, start+length-1))
|
|
}
|
|
|
|
func newAzureBlockStorage(b azure.BlobStorageClient) azureBlockStorage {
|
|
a := azureBlockStorage{}
|
|
a.BlobStorageClient = b
|
|
return a
|
|
}
|