gohaveazurestorage

package module
v0.0.0-...-da4f7c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

README

GoHaveAzureStorage

GoHaveAzureStorage is a Azure Storage Library for Go. As The project is brand new, it is currently in a an alpha state, where only Azure Table Storage is supported. Take a look at the road map, for the planned development on the library.

Installation

go get github.com/ChristianHenrikReich/gohaveazurestorage

Get Started

More detailed information about usage is being written in the Wiki. Tablestorageproxy_test.go is also a good source for information.


package main

import (
	"fmt"
	"gohaveazurestorage"
)

//Either the primary or the secondary key found on Azure Portal
var key = "PrimaryOrSecondaryKey"

//Storage account name
var account = "Account"

func main() {
	// Create an instance of the lib
	goHaveAzureStorage := gohaveazurestorage.New(account, key)
  
  // Example with debug, if last parameter is true then request/response sessions dumps is written to console
  //goHaveAzureStorage := gohaveazurestorage.NewWithDebug(account, key, true)

	// From the lib instace, we can create multiple client instances
	tableStorage := goHaveAzureStorage.TableStorage()

	//Creating a table
	httpStatusCode := tableStorage.CreateTable("Table")
	if httpStatusCode != 201 {
		fmt.Println("Create table error")
	}
}

Note on running the test

The tests works, but they sometimes falls depending on the connection to Azure.

Road map

  • Table Storage
    • Implement preflight command
    • Implement support for shared keys
    • Implement support for CORS
  • Get started on Blob Storage
  • Get started on Queue Storage
  • Get started on File Storage

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoHaveAzureStorage

type GoHaveAzureStorage struct {
	// contains filtered or unexported fields
}

func New

func New(account string, key string) (azureStorage *GoHaveAzureStorage)

func NewWithDebug

func NewWithDebug(account string, key string, dumpSessions bool) (azureStorage *GoHaveAzureStorage)

func (*GoHaveAzureStorage) TableStorage

func (goHaveAzureStorage *GoHaveAzureStorage) TableStorage() (tableStorage *tablestorage.TableStorage)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL