storage

package
v0.0.0-...-2f4e5d5 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package storage provides clients for Microsoft Azure Storage Services.

Index

Constants

View Source
const (
	// DefaultBaseURL is the domain name used for storage requests when a
	// default client is created.
	DefaultBaseURL = "core.windows.net"

	// DefaultAPIVersion is the  Azure Storage API version string used when a
	// basic client is created.
	DefaultAPIVersion = "2015-02-21"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureStorageServiceError

type AzureStorageServiceError struct {
	Code                      string `xml:"Code"`
	Message                   string `xml:"Message"`
	AuthenticationErrorDetail string `xml:"AuthenticationErrorDetail"`
	QueryParameterName        string `xml:"QueryParameterName"`
	QueryParameterValue       string `xml:"QueryParameterValue"`
	Reason                    string `xml:"Reason"`
	StatusCode                int
	RequestID                 string
}

AzureStorageServiceError contains fields of the error response from Azure Storage Service REST API. See https://msdn.microsoft.com/en-us/library/azure/dd179382.aspx Some fields might be specific to certain calls.

func (AzureStorageServiceError) Error

func (e AzureStorageServiceError) Error() string

type AzureTable

type AzureTable string

AzureTable is the typedef of the Azure Table name

type Client

type Client struct {
	// HTTPClient is the http.Client used to initiate API
	// requests.  If it is nil, http.DefaultClient is used.
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

Client is the object that needs to be constructed to perform operations on the storage account.

func NewBasicClient

func NewBasicClient(accountName, accountKey string) (Client, error)

NewBasicClient constructs a Client with given storage service name and key.

func (Client) GetTableService

func (c Client) GetTableService() TableServiceClient

GetTableService returns a TableServiceClient which can operate on the table service of the storage account.

type TableEntity

type TableEntity struct {
	PartitionKey string
	RowKey       string
	Fields       map[string]interface{}
}

TableEntity struct specifies entity to be saved to Azure Tables

type TableServiceClient

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

TableServiceClient contains operations for Microsoft Azure Table Storage Service.

func (*TableServiceClient) BatchInsert

func (c *TableServiceClient) BatchInsert(table AzureTable, entities []*TableEntity) error

BatchInsert inserts set of entities in the specified table. Function assumes that batch is formed properly

func (*TableServiceClient) CreateTable

func (c *TableServiceClient) CreateTable(table AzureTable) error

CreateTable creates the table given the specific name. This function fails if the name is not compliant with the specification.

func (*TableServiceClient) DeleteTable

func (c *TableServiceClient) DeleteTable(table AzureTable) error

DeleteTable deletes the table given the specific name. This function fails if the table is not present. Be advised: DeleteTable deletes all the entries that may be present.

func (*TableServiceClient) InsertEntity

func (c *TableServiceClient) InsertEntity(table AzureTable, entity TableEntity) error

InsertEntity inserts an entity in the specified table. The function fails if there is an entity with the same PartitionKey and RowKey in the table.

type UnexpectedStatusCodeError

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

UnexpectedStatusCodeError is returned when a storage service responds with neither an error nor with an HTTP status code indicating success.

func (UnexpectedStatusCodeError) Error

Jump to

Keyboard shortcuts

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