Code Monkey home page Code Monkey logo

azure-storage-go's Introduction

Azure Storage SDK for Go

NOTE: This repository is deprecated and will be removed in the future. Its original contents are now part of the Azure SDK for Goand a new package for Blobs is available from github.com/Azure/azure-storage-blob-go. For more information, see Azure/azure-sdk-for-go#597.

GoDoc Build Status Go Report Card

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 -u github.com/Azure/azure-storage-go
  2. Add the following import statement into any Go source file that will reference Azure Storage: import storage github.com/Azure/azure-storage-go
  3. 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.
  4. (Optional, Windows only) Download and start the Azure Storage Emulator.
  5. 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 [email protected] with any additional questions or comments.

When contributing, please conform to the following practices:

  • Target the 'dev' branch. This practice ensures that go get retreives more stable bits.
  • 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.
    • This project uses HTTP recordings for testing.
    • The recorder should be attached to the client before calling the functions to test and later stopped.
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)
}
  • 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 line 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)
}

azure-storage-go's People

Contributors

ahmetb avatar alukyan avatar alvadb avatar anuchandy avatar bcc avatar boonep avatar brianbland avatar colemickens avatar dovreshef avatar enieuw avatar helloitszak avatar jen20 avatar jhendrixmsft avatar joshgav avatar kenegozi avatar kpfaulkner avatar lirao avatar marstr avatar mcardosos avatar microsoftopensource avatar mindflavor avatar mschreibjambit avatar msftgits avatar paulmey avatar ppanyukov avatar qt-luigi avatar rchippada avatar sangeethkumarp avatar stascode avatar tomclegg avatar

Watchers

 avatar  avatar

Forkers

yuriykishchenko

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.