2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-30 00:33:57 +00:00
restic/vendor/github.com/Azure/azure-sdk-for-go/storage
Alexander Neumann 61cb1cc6f8 Update vendored dependencies
This includes github.com/kurin/blazer 0.2.0, which resolves #1291
2017-10-01 10:13:39 +02:00
..
recordings Update vendored dependencies 2017-10-01 10:13:39 +02:00
appendblob_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
appendblob.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
authorization_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
authorization.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
blob_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
blob.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
blobsasuri_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
blobsasuri.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
blobserviceclient.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
blockblob_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
blockblob.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
client_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
client.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
commonsasuri.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
container_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
container.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
copyblob_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
copyblob.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
directory_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
directory.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
entity_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
entity.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
file_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
file.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
fileserviceclient.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
leaseblob_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
leaseblob.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
message_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
message.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
odata.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
pageblob_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
pageblob.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
queue_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
queue.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
queuesasuri_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
queuesasuri.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
queueserviceclient.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
README.md Update vendored dependencies 2017-10-01 10:13:39 +02:00
share_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
share.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
storagepolicy.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
storageservice_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
storageservice.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
table_batch_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
table_batch.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
table_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
table.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
tableserviceclient.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
util_1.7.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
util_1.8.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
util_test.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
util.go Update vendored dependencies 2017-10-01 10:13:39 +02:00
version.go Update vendored dependencies 2017-10-01 10:13:39 +02:00

Azure Storage SDK for Go

The github.com/Azure/azure-sdk-for-go/storage package is used to perform REST operations against the Azure Storage Service. To manage your storage accounts (Azure Resource Manager / ARM), use the github.com/Azure/azure-sdk-for-go/arm/storage package. For your classic storage accounts (Azure Service Management / ASM), use github.com/Azure/azure-sdk-for-go/management/storageservice package.

This package includes support for Azure Storage Emulator.

Getting Started

  1. Go get the SDK go get -u github.com/Azure/azure-sdk-for=go/storage
  2. If you don't already have one, create a Storage Account.
    • Take note of your Azure Storage Account Name and Azure Storage Account Key. They'll both be necessary for using this library.
    • This option is production ready, but can also be used for development.
  3. (Optional, Windows only) Download and start the Azure Storage Emulator.
  4. Checkout our existing samples.

Contributing

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

When contributing, please conform to the following practices:

  • Run gofmt to use standard go formatting.
  • Run golint to conform to standard naming conventions.
  • Run go vet to catch common Go mistakes.
  • Use GoASTScanner/gas to ensure there are no common security violations in your contribution.
  • Run go test to catch possible bugs in the code: go test ./storage/....
    • This project uses HTTP recordings for testing.
    • The recorder should be attached to the client before calling the functions to test and later stopped.
    • If you updated an existing test, its recording might need to be updated. Run go test ./storage/... -ow -check.f TestName to rerecord the test.
    • Important note: all HTTP requests in the recording must be unique: different bodies, headers (User-Agent, Authorization and Date or x-ms-date headers are ignored), URLs and methods. As opposed to the example above, the following test is not suitable for recording:
func (s *StorageQueueSuite) TestQueueExists(c *chk.C) {
cli := getQueueClient(c)
rec := cli.client.appendRecorder(c)
defer rec.Stop()

queue := cli.GetQueueReference(queueName(c))
ok, err := queue.Exists()
c.Assert(err, chk.IsNil)
c.Assert(ok, chk.Equals, false)

c.Assert(queue.Create(nil), chk.IsNil)
defer queue.Delete(nil)

ok, err = queue.Exists() // This is the very same request as the one 5 lines above
// The test replayer gets confused and the test fails in the last line
c.Assert(err, chk.IsNil)
c.Assert(ok, chk.Equals, true)
}
  • On the other side, this test does not repeat requests: the URLs are different.
func (s *StorageQueueSuite) TestQueueExists(c *chk.C) {
cli := getQueueClient(c)
rec := cli.client.appendRecorder(c)
defer rec.Stop()

queue1 := cli.GetQueueReference(queueName(c, "nonexistent"))
ok, err := queue1.Exists()
c.Assert(err, chk.IsNil)
c.Assert(ok, chk.Equals, false)

queue2 := cli.GetQueueReference(queueName(c, "exisiting"))
c.Assert(queue2.Create(nil), chk.IsNil)
defer queue2.Delete(nil)

ok, err = queue2.Exists()
c.Assert(err, chk.IsNil)
c.Assert(ok, chk.Equals, true)
}