Merge pull request #294 from fkautz/pr_out_updating_msopentech_azure_sdk_for_go_to_latest_master
Updating MSOpenTech/azure-sdk-for-go to latest master
This commit is contained in:
commit
02b8c7b8cf
8
Godeps/Godeps.json
generated
8
Godeps/Godeps.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"ImportPath": "github.com/docker/distribution",
|
"ImportPath": "github.com/docker/distribution",
|
||||||
"GoVersion": "go1.4.1",
|
"GoVersion": "go1.4.2",
|
||||||
"Packages": [
|
"Packages": [
|
||||||
"./..."
|
"./..."
|
||||||
],
|
],
|
||||||
@ -23,9 +23,9 @@
|
|||||||
"Rev": "d3664b76d90508cdda5a6c92042f26eab5db3103"
|
"Rev": "d3664b76d90508cdda5a6c92042f26eab5db3103"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/MSOpenTech/azure-sdk-for-go",
|
"ImportPath": "github.com/MSOpenTech/azure-sdk-for-go/storage",
|
||||||
"Comment": "v1.2",
|
"Comment": "v1.2-43-gd90753b",
|
||||||
"Rev": "0fbd37144de3adc2aef74db867c0e15e41c7f74a"
|
"Rev": "d90753bcad2ed782fcead7392d1e831df29aa2bb"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/Sirupsen/logrus",
|
"ImportPath": "github.com/Sirupsen/logrus",
|
||||||
|
@ -56,33 +56,35 @@ type StorageServiceError struct {
|
|||||||
|
|
||||||
// NewBasicClient constructs a StorageClient with given storage service name
|
// NewBasicClient constructs a StorageClient with given storage service name
|
||||||
// and key.
|
// and key.
|
||||||
func NewBasicClient(accountName, accountKey string) (*StorageClient, error) {
|
func NewBasicClient(accountName, accountKey string) (StorageClient, error) {
|
||||||
return NewClient(accountName, accountKey, DefaultBaseUrl, DefaultApiVersion, defaultUseHttps)
|
return NewClient(accountName, accountKey, DefaultBaseUrl, DefaultApiVersion, defaultUseHttps)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewClient constructs a StorageClient. This should be used if the caller
|
// NewClient constructs a StorageClient. This should be used if the caller
|
||||||
// wants to specify whether to use HTTPS, a specific REST API version or a
|
// wants to specify whether to use HTTPS, a specific REST API version or a
|
||||||
// custom storage endpoint than Azure Public Cloud.
|
// custom storage endpoint than Azure Public Cloud.
|
||||||
func NewClient(accountName, accountKey, blobServiceBaseUrl, apiVersion string, useHttps bool) (*StorageClient, error) {
|
func NewClient(accountName, accountKey, blobServiceBaseUrl, apiVersion string, useHttps bool) (StorageClient, error) {
|
||||||
|
var c StorageClient
|
||||||
if accountName == "" {
|
if accountName == "" {
|
||||||
return nil, fmt.Errorf("azure: account name required")
|
return c, fmt.Errorf("azure: account name required")
|
||||||
} else if accountKey == "" {
|
} else if accountKey == "" {
|
||||||
return nil, fmt.Errorf("azure: account key required")
|
return c, fmt.Errorf("azure: account key required")
|
||||||
} else if blobServiceBaseUrl == "" {
|
} else if blobServiceBaseUrl == "" {
|
||||||
return nil, fmt.Errorf("azure: base storage service url required")
|
return c, fmt.Errorf("azure: base storage service url required")
|
||||||
}
|
}
|
||||||
|
|
||||||
key, err := base64.StdEncoding.DecodeString(accountKey)
|
key, err := base64.StdEncoding.DecodeString(accountKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return c, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &StorageClient{
|
return StorageClient{
|
||||||
accountName: accountName,
|
accountName: accountName,
|
||||||
accountKey: key,
|
accountKey: key,
|
||||||
useHttps: useHttps,
|
useHttps: useHttps,
|
||||||
baseUrl: blobServiceBaseUrl,
|
baseUrl: blobServiceBaseUrl,
|
||||||
apiVersion: apiVersion}, nil
|
apiVersion: apiVersion,
|
||||||
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c StorageClient) getBaseUrl(service string) string {
|
func (c StorageClient) getBaseUrl(service string) string {
|
@ -15,7 +15,7 @@ import (
|
|||||||
"github.com/docker/distribution/registry/storage/driver/base"
|
"github.com/docker/distribution/registry/storage/driver/base"
|
||||||
"github.com/docker/distribution/registry/storage/driver/factory"
|
"github.com/docker/distribution/registry/storage/driver/factory"
|
||||||
|
|
||||||
azure "github.com/MSOpenTech/azure-sdk-for-go/clients/storage"
|
azure "github.com/MSOpenTech/azure-sdk-for-go/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
const driverName = "azure"
|
const driverName = "azure"
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
azure "github.com/MSOpenTech/azure-sdk-for-go/clients/storage"
|
azure "github.com/MSOpenTech/azure-sdk-for-go/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
// azureBlockStorage is adaptor between azure.BlobStorageClient and
|
// azureBlockStorage is adaptor between azure.BlobStorageClient and
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
|
||||||
azure "github.com/MSOpenTech/azure-sdk-for-go/clients/storage"
|
azure "github.com/MSOpenTech/azure-sdk-for-go/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StorageSimulator struct {
|
type StorageSimulator struct {
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
azure "github.com/MSOpenTech/azure-sdk-for-go/clients/storage"
|
azure "github.com/MSOpenTech/azure-sdk-for-go/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
type blockIDGenerator struct {
|
type blockIDGenerator struct {
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"math"
|
"math"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
azure "github.com/MSOpenTech/azure-sdk-for-go/clients/storage"
|
azure "github.com/MSOpenTech/azure-sdk-for-go/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_blockIdGenerator(t *testing.T) {
|
func Test_blockIdGenerator(t *testing.T) {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
|
||||||
azure "github.com/MSOpenTech/azure-sdk-for-go/clients/storage"
|
azure "github.com/MSOpenTech/azure-sdk-for-go/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
// blockStorage is the interface required from a block storage service
|
// blockStorage is the interface required from a block storage service
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
azure "github.com/MSOpenTech/azure-sdk-for-go/clients/storage"
|
azure "github.com/MSOpenTech/azure-sdk-for-go/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRandomWriter_writeChunkToBlocks(t *testing.T) {
|
func TestRandomWriter_writeChunkToBlocks(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user