Documentation ¶
Overview ¶
Package storage provides clients for Microsoft Azure Storage Services.
Index ¶
- Constants
- type AzureStorageServiceError
- type Blob
- type BlobListResponse
- type BlobProperties
- type BlobStorageClient
- func (b BlobStorageClient) BlobExists(container, name string) (bool, error)
- func (b BlobStorageClient) ContainerExists(name string) (bool, error)
- func (b BlobStorageClient) CopyBlob(container, name, sourceBlob string) error
- func (b BlobStorageClient) CreateBlockBlob(container, name string) error
- func (b BlobStorageClient) CreateBlockBlobFromReader(container, name string, size uint64, blob io.Reader) error
- func (b BlobStorageClient) CreateContainer(name string, access ContainerAccessType) error
- func (b BlobStorageClient) CreateContainerIfNotExists(name string, access ContainerAccessType) (bool, error)
- func (b BlobStorageClient) DeleteBlob(container, name string) error
- func (b BlobStorageClient) DeleteBlobIfExists(container, name string) (bool, error)
- func (b BlobStorageClient) DeleteContainer(name string) error
- func (b BlobStorageClient) DeleteContainerIfExists(name string) (bool, error)
- func (b BlobStorageClient) GetBlob(container, name string) (io.ReadCloser, error)
- func (b BlobStorageClient) GetBlobMetadata(container, name string) (map[string]string, error)
- func (b BlobStorageClient) GetBlobProperties(container, name string) (*BlobProperties, error)
- func (b BlobStorageClient) GetBlobRange(container, name, bytesRange string) (io.ReadCloser, error)
- func (b BlobStorageClient) GetBlobSASURI(container, name string, expiry time.Time, permissions string) (string, error)
- func (b BlobStorageClient) GetBlobURL(container, name string) string
- func (b BlobStorageClient) GetBlockList(container, name string, blockType BlockListType) (BlockListResponse, error)
- func (b BlobStorageClient) GetPageRanges(container, name string) (GetPageRangesResponse, error)
- func (b BlobStorageClient) ListBlobs(container string, params ListBlobsParameters) (BlobListResponse, error)
- func (b BlobStorageClient) ListContainers(params ListContainersParameters) (ContainerListResponse, error)
- func (b BlobStorageClient) PutBlock(container, name, blockID string, chunk []byte) error
- func (b BlobStorageClient) PutBlockList(container, name string, blocks []Block) error
- func (b BlobStorageClient) PutBlockWithLength(container, name, blockID string, size uint64, blob io.Reader) error
- func (b BlobStorageClient) PutPage(container, name string, startByte, endByte int64, writeType PageWriteType, ...) error
- func (b BlobStorageClient) PutPageBlob(container, name string, size int64) error
- func (b BlobStorageClient) SetBlobMetadata(container, name string, metadata map[string]string) error
- type BlobType
- type Block
- type BlockListResponse
- type BlockListType
- type BlockResponse
- type BlockStatus
- type Client
- type Container
- type ContainerAccessType
- type ContainerListResponse
- type ContainerProperties
- type FileServiceClient
- type GetMessageResponse
- type GetMessagesParameters
- type GetMessagesResponse
- type GetPageRangesResponse
- type ListBlobsParameters
- type ListContainersParameters
- type PageRange
- type PageWriteType
- type PeekMessageResponse
- type PeekMessagesParameters
- type PeekMessagesResponse
- type PutMessageParameters
- type QueueMetadataResponse
- type QueueServiceClient
- func (c QueueServiceClient) ClearMessages(queue string) error
- func (c QueueServiceClient) CreateQueue(name string) error
- func (c QueueServiceClient) DeleteMessage(queue, messageID, popReceipt string) error
- func (c QueueServiceClient) DeleteQueue(name string) error
- func (c QueueServiceClient) GetMessages(queue string, params GetMessagesParameters) (GetMessagesResponse, error)
- func (c QueueServiceClient) GetMetadata(name string) (QueueMetadataResponse, error)
- func (c QueueServiceClient) PeekMessages(queue string, params PeekMessagesParameters) (PeekMessagesResponse, error)
- func (c QueueServiceClient) PutMessage(queue string, message string, params PutMessageParameters) error
- func (c QueueServiceClient) QueueExists(name string) (bool, error)
- func (c QueueServiceClient) SetMetadata(name string, metadata map[string]string) error
- type UnexpectedStatusCodeError
Constants ¶
const ( MaxBlobBlockSize = 4 * 1024 * 1024 MaxBlobPageSize = 4 * 1024 * 1024 )
Maximum sizes (per REST API) for various concepts
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 = "2014-02-14" )
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 Blob ¶
type Blob struct { Name string `xml:"Name"` Properties BlobProperties `xml:"Properties"` }
A Blob is an entry in BlobListResponse.
type BlobListResponse ¶
type BlobListResponse struct { XMLName xml.Name `xml:"EnumerationResults"` Xmlns string `xml:"xmlns,attr"` Prefix string `xml:"Prefix"` Marker string `xml:"Marker"` NextMarker string `xml:"NextMarker"` MaxResults int64 `xml:"MaxResults"` Blobs []Blob `xml:"Blobs>Blob"` }
BlobListResponse contains the response fields from ListBlobs call.
See https://msdn.microsoft.com/en-us/library/azure/dd135734.aspx
type BlobProperties ¶
type BlobProperties struct { LastModified string `xml:"Last-Modified"` Etag string `xml:"Etag"` ContentMD5 string `xml:"Content-MD5"` ContentLength int64 `xml:"Content-Length"` ContentType string `xml:"Content-Type"` ContentEncoding string `xml:"Content-Encoding"` BlobType BlobType `xml:"x-ms-blob-blob-type"` SequenceNumber int64 `xml:"x-ms-blob-sequence-number"` CopyID string `xml:"CopyId"` CopyStatus string `xml:"CopyStatus"` CopySource string `xml:"CopySource"` CopyProgress string `xml:"CopyProgress"` CopyCompletionTime string `xml:"CopyCompletionTime"` CopyStatusDescription string `xml:"CopyStatusDescription"` }
BlobProperties contains various properties of a blob returned in various endpoints like ListBlobs or GetBlobProperties.
type BlobStorageClient ¶
type BlobStorageClient struct {
// contains filtered or unexported fields
}
BlobStorageClient contains operations for Microsoft Azure Blob Storage Service.
func (BlobStorageClient) BlobExists ¶
func (b BlobStorageClient) BlobExists(container, name string) (bool, error)
BlobExists returns true if a blob with given name exists on the specified container of the storage account.
func (BlobStorageClient) ContainerExists ¶
func (b BlobStorageClient) ContainerExists(name string) (bool, error)
ContainerExists returns true if a container with given name exists on the storage account, otherwise returns false.
func (BlobStorageClient) CopyBlob ¶
func (b BlobStorageClient) CopyBlob(container, name, sourceBlob string) error
CopyBlob starts a blob copy operation and waits for the operation to complete. sourceBlob parameter must be a canonical URL to the blob (can be obtained using GetBlobURL method.) There is no SLA on blob copy and therefore this helper method works faster on smaller files.
See https://msdn.microsoft.com/en-us/library/azure/dd894037.aspx
func (BlobStorageClient) CreateBlockBlob ¶
func (b BlobStorageClient) CreateBlockBlob(container, name string) error
CreateBlockBlob initializes an empty block blob with no blocks.
See https://msdn.microsoft.com/en-us/library/azure/dd179451.aspx
func (BlobStorageClient) CreateBlockBlobFromReader ¶
func (b BlobStorageClient) CreateBlockBlobFromReader(container, name string, size uint64, blob io.Reader) error
CreateBlockBlobFromReader initializes a block blob using data from reader. Size must be the number of bytes read from reader. To create an empty blob, use size==0 and reader==nil.
The API rejects requests with size > 64 MiB (but this limit is not checked by the SDK). To write a larger blob, use CreateBlockBlob, PutBlock, and PutBlockList.
See https://msdn.microsoft.com/en-us/library/azure/dd179451.aspx
func (BlobStorageClient) CreateContainer ¶
func (b BlobStorageClient) CreateContainer(name string, access ContainerAccessType) error
CreateContainer creates a blob container within the storage account with given name and access level. Returns error if container already exists.
See https://msdn.microsoft.com/en-us/library/azure/dd179468.aspx
func (BlobStorageClient) CreateContainerIfNotExists ¶
func (b BlobStorageClient) CreateContainerIfNotExists(name string, access ContainerAccessType) (bool, error)
CreateContainerIfNotExists creates a blob container if it does not exist. Returns true if container is newly created or false if container already exists.
func (BlobStorageClient) DeleteBlob ¶
func (b BlobStorageClient) DeleteBlob(container, name string) error
DeleteBlob deletes the given blob from the specified container. If the blob does not exists at the time of the Delete Blob operation, it returns error. See https://msdn.microsoft.com/en-us/library/azure/dd179413.aspx
func (BlobStorageClient) DeleteBlobIfExists ¶
func (b BlobStorageClient) DeleteBlobIfExists(container, name string) (bool, error)
DeleteBlobIfExists deletes the given blob from the specified container If the blob is deleted with this call, returns true. Otherwise returns false.
See https://msdn.microsoft.com/en-us/library/azure/dd179413.aspx
func (BlobStorageClient) DeleteContainer ¶
func (b BlobStorageClient) DeleteContainer(name string) error
DeleteContainer deletes the container with given name on the storage account. If the container does not exist returns error.
See https://msdn.microsoft.com/en-us/library/azure/dd179408.aspx
func (BlobStorageClient) DeleteContainerIfExists ¶
func (b BlobStorageClient) DeleteContainerIfExists(name string) (bool, error)
DeleteContainerIfExists deletes the container with given name on the storage account if it exists. Returns true if container is deleted with this call, or false if the container did not exist at the time of the Delete Container operation.
See https://msdn.microsoft.com/en-us/library/azure/dd179408.aspx
func (BlobStorageClient) GetBlob ¶
func (b BlobStorageClient) GetBlob(container, name string) (io.ReadCloser, error)
GetBlob returns a stream to read the blob. Caller must call Close() the reader to close on the underlying connection.
See https://msdn.microsoft.com/en-us/library/azure/dd179440.aspx
func (BlobStorageClient) GetBlobMetadata ¶
func (b BlobStorageClient) GetBlobMetadata(container, name string) (map[string]string, error)
GetBlobMetadata returns all user-defined metadata for the specified blob.
All metadata keys will be returned in lower case. (HTTP header names are case-insensitive.)
See https://msdn.microsoft.com/en-us/library/azure/dd179414.aspx
func (BlobStorageClient) GetBlobProperties ¶
func (b BlobStorageClient) GetBlobProperties(container, name string) (*BlobProperties, error)
GetBlobProperties provides various information about the specified blob. See https://msdn.microsoft.com/en-us/library/azure/dd179394.aspx
func (BlobStorageClient) GetBlobRange ¶
func (b BlobStorageClient) GetBlobRange(container, name, bytesRange string) (io.ReadCloser, error)
GetBlobRange reads the specified range of a blob to a stream. The bytesRange string must be in a format like "0-", "10-100" as defined in HTTP 1.1 spec.
See https://msdn.microsoft.com/en-us/library/azure/dd179440.aspx
func (BlobStorageClient) GetBlobSASURI ¶
func (b BlobStorageClient) GetBlobSASURI(container, name string, expiry time.Time, permissions string) (string, error)
GetBlobSASURI creates an URL to the specified blob which contains the Shared Access Signature with specified permissions and expiration time.
See https://msdn.microsoft.com/en-us/library/azure/ee395415.aspx
func (BlobStorageClient) GetBlobURL ¶
func (b BlobStorageClient) GetBlobURL(container, name string) string
GetBlobURL gets the canonical URL to the blob with the specified name in the specified container. This method does not create a publicly accessible URL if the blob or container is private and this method does not check if the blob exists.
func (BlobStorageClient) GetBlockList ¶
func (b BlobStorageClient) GetBlockList(container, name string, blockType BlockListType) (BlockListResponse, error)
GetBlockList retrieves list of blocks in the specified block blob.
See https://msdn.microsoft.com/en-us/library/azure/dd179400.aspx
func (BlobStorageClient) GetPageRanges ¶
func (b BlobStorageClient) GetPageRanges(container, name string) (GetPageRangesResponse, error)
GetPageRanges returns the list of valid page ranges for a page blob.
See https://msdn.microsoft.com/en-us/library/azure/ee691973.aspx
func (BlobStorageClient) ListBlobs ¶
func (b BlobStorageClient) ListBlobs(container string, params ListBlobsParameters) (BlobListResponse, error)
ListBlobs returns an object that contains list of blobs in the container, pagination token and other information in the response of List Blobs call.
See https://msdn.microsoft.com/en-us/library/azure/dd135734.aspx
func (BlobStorageClient) ListContainers ¶
func (b BlobStorageClient) ListContainers(params ListContainersParameters) (ContainerListResponse, error)
ListContainers returns the list of containers in a storage account along with pagination token and other response details.
See https://msdn.microsoft.com/en-us/library/azure/dd179352.aspx
func (BlobStorageClient) PutBlock ¶
func (b BlobStorageClient) PutBlock(container, name, blockID string, chunk []byte) error
PutBlock saves the given data chunk to the specified block blob with given ID.
The API rejects chunks larger than 4 MiB (but this limit is not checked by the SDK).
See https://msdn.microsoft.com/en-us/library/azure/dd135726.aspx
func (BlobStorageClient) PutBlockList ¶
func (b BlobStorageClient) PutBlockList(container, name string, blocks []Block) error
PutBlockList saves list of blocks to the specified block blob.
See https://msdn.microsoft.com/en-us/library/azure/dd179467.aspx
func (BlobStorageClient) PutBlockWithLength ¶
func (b BlobStorageClient) PutBlockWithLength(container, name, blockID string, size uint64, blob io.Reader) error
PutBlockWithLength saves the given data stream of exactly specified size to the block blob with given ID. It is an alternative to PutBlocks where data comes as stream but the length is known in advance.
The API rejects requests with size > 4 MiB (but this limit is not checked by the SDK).
See https://msdn.microsoft.com/en-us/library/azure/dd135726.aspx
func (BlobStorageClient) PutPage ¶
func (b BlobStorageClient) PutPage(container, name string, startByte, endByte int64, writeType PageWriteType, chunk []byte) error
PutPage writes a range of pages to a page blob or clears the given range. In case of 'clear' writes, given chunk is discarded. Ranges must be aligned with 512-byte boundaries and chunk must be of size multiplies by 512.
func (BlobStorageClient) PutPageBlob ¶
func (b BlobStorageClient) PutPageBlob(container, name string, size int64) error
PutPageBlob initializes an empty page blob with specified name and maximum size in bytes (size must be aligned to a 512-byte boundary). A page blob must be created using this method before writing pages.
See https://msdn.microsoft.com/en-us/library/azure/dd179451.aspx
func (BlobStorageClient) SetBlobMetadata ¶
func (b BlobStorageClient) SetBlobMetadata(container, name string, metadata map[string]string) error
SetBlobMetadata replaces the metadata for the specified blob.
Some keys may be converted to Camel-Case before sending. All keys are returned in lower case by GetBlobMetadata. HTTP header names are case-insensitive so case munging should not matter to other applications either.
See https://msdn.microsoft.com/en-us/library/azure/dd179414.aspx
type Block ¶
type Block struct { ID string Status BlockStatus }
Block is used to create Block entities for Put Block List call.
type BlockListResponse ¶
type BlockListResponse struct { XMLName xml.Name `xml:"BlockList"` CommittedBlocks []BlockResponse `xml:"CommittedBlocks>Block"` UncommittedBlocks []BlockResponse `xml:"UncommittedBlocks>Block"` }
BlockListResponse contains the response fields from Get Block List call.
See https://msdn.microsoft.com/en-us/library/azure/dd179400.aspx
type BlockListType ¶
type BlockListType string
BlockListType is used to filter out types of blocks in a Get Blocks List call for a block blob.
See https://msdn.microsoft.com/en-us/library/azure/dd179400.aspx for all block types.
const ( BlockListTypeAll BlockListType = "all" BlockListTypeCommitted BlockListType = "committed" BlockListTypeUncommitted BlockListType = "uncommitted" )
Filters for listing blocks in block blobs
type BlockResponse ¶
BlockResponse contains the block information returned in the GetBlockListCall.
type BlockStatus ¶
type BlockStatus string
BlockStatus defines states a block for a block blob can be in.
const ( BlockStatusUncommitted BlockStatus = "Uncommitted" BlockStatusCommitted BlockStatus = "Committed" BlockStatusLatest BlockStatus = "Latest" )
List of statuses that can be used to refer to a block in a block list
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the object that needs to be constructed to perform operations on the storage account.
func NewBasicClient ¶
NewBasicClient constructs a Client with given storage service name and key.
func NewClient ¶
func NewClient(accountName, accountKey, blobServiceBaseURL, apiVersion string, useHTTPS bool) (Client, error)
NewClient constructs a Client. This should be used if the caller wants to specify whether to use HTTPS, a specific REST API version or a custom storage endpoint than Azure Public Cloud.
func (Client) GetBlobService ¶
func (c Client) GetBlobService() BlobStorageClient
GetBlobService returns a BlobStorageClient which can operate on the blob service of the storage account.
func (Client) GetFileService ¶
func (c Client) GetFileService() FileServiceClient
GetFileService returns a FileServiceClient which can operate on the file service of the storage account.
func (Client) GetQueueService ¶
func (c Client) GetQueueService() QueueServiceClient
GetQueueService returns a QueueServiceClient which can operate on the queue service of the storage account.
type Container ¶
type Container struct { Name string `xml:"Name"` Properties ContainerProperties `xml:"Properties"` }
A Container is an entry in ContainerListResponse.
type ContainerAccessType ¶
type ContainerAccessType string
ContainerAccessType defines the access level to the container from a public request.
See https://msdn.microsoft.com/en-us/library/azure/dd179468.aspx and "x-ms- blob-public-access" header.
const ( ContainerAccessTypePrivate ContainerAccessType = "" ContainerAccessTypeBlob ContainerAccessType = "blob" ContainerAccessTypeContainer ContainerAccessType = "container" )
Access options for containers
type ContainerListResponse ¶
type ContainerListResponse struct { XMLName xml.Name `xml:"EnumerationResults"` Xmlns string `xml:"xmlns,attr"` Prefix string `xml:"Prefix"` Marker string `xml:"Marker"` NextMarker string `xml:"NextMarker"` MaxResults int64 `xml:"MaxResults"` Containers []Container `xml:"Containers>Container"` }
ContainerListResponse contains the response fields from ListContainers call.
See https://msdn.microsoft.com/en-us/library/azure/dd179352.aspx
type ContainerProperties ¶
type ContainerProperties struct { LastModified string `xml:"Last-Modified"` Etag string `xml:"Etag"` LeaseStatus string `xml:"LeaseStatus"` LeaseState string `xml:"LeaseState"` LeaseDuration string `xml:"LeaseDuration"` }
ContainerProperties contains various properties of a container returned from various endpoints like ListContainers.
type FileServiceClient ¶
type FileServiceClient struct {
// contains filtered or unexported fields
}
FileServiceClient contains operations for Microsoft Azure File Service.
func (FileServiceClient) CreateShare ¶
func (f FileServiceClient) CreateShare(name string) error
CreateShare operation creates a new share under the specified account. If the share with the same name already exists, the operation fails.
See https://msdn.microsoft.com/en-us/library/azure/dn167008.aspx
func (FileServiceClient) CreateShareIfNotExists ¶
func (f FileServiceClient) CreateShareIfNotExists(name string) (bool, error)
CreateShareIfNotExists creates a new share under the specified account if it does not exist. Returns true if container is newly created or false if container already exists.
See https://msdn.microsoft.com/en-us/library/azure/dn167008.aspx
func (FileServiceClient) DeleteShare ¶
func (f FileServiceClient) DeleteShare(name string) error
DeleteShare operation marks the specified share for deletion. The share and any files contained within it are later deleted during garbage collection.
See https://msdn.microsoft.com/en-us/library/azure/dn689090.aspx
func (FileServiceClient) DeleteShareIfExists ¶
func (f FileServiceClient) DeleteShareIfExists(name string) (bool, error)
DeleteShareIfExists operation marks the specified share for deletion if it exists. The share and any files contained within it are later deleted during garbage collection. Returns true if share existed and deleted with this call, false otherwise.
See https://msdn.microsoft.com/en-us/library/azure/dn689090.aspx
type GetMessageResponse ¶
type GetMessageResponse struct { MessageID string `xml:"MessageId"` InsertionTime string `xml:"InsertionTime"` ExpirationTime string `xml:"ExpirationTime"` PopReceipt string `xml:"PopReceipt"` TimeNextVisible string `xml:"TimeNextVisible"` DequeueCount int `xml:"DequeueCount"` MessageText string `xml:"MessageText"` }
GetMessageResponse represents a QueueMessage object returned from Get Messages operation response.
type GetMessagesParameters ¶
GetMessagesParameters is the set of options can be specified for Get Messsages operation. A zero struct does not use any preferences for the request.
type GetMessagesResponse ¶
type GetMessagesResponse struct { XMLName xml.Name `xml:"QueueMessagesList"` QueueMessagesList []GetMessageResponse `xml:"QueueMessage"` }
GetMessagesResponse represents a response returned from Get Messages operation.
type GetPageRangesResponse ¶
type GetPageRangesResponse struct { XMLName xml.Name `xml:"PageList"` PageList []PageRange `xml:"PageRange"` }
GetPageRangesResponse contains the reponse fields from Get Page Ranges call.
See https://msdn.microsoft.com/en-us/library/azure/ee691973.aspx
type ListBlobsParameters ¶
type ListBlobsParameters struct { Prefix string Delimiter string Marker string Include string MaxResults uint Timeout uint }
ListBlobsParameters defines the set of customizable parameters to make a List Blobs call.
See https://msdn.microsoft.com/en-us/library/azure/dd135734.aspx
type ListContainersParameters ¶
type ListContainersParameters struct { Prefix string Marker string Include string MaxResults uint Timeout uint }
ListContainersParameters defines the set of customizable parameters to make a List Containers call.
See https://msdn.microsoft.com/en-us/library/azure/dd179352.aspx
type PageRange ¶
PageRange contains information about a page of a page blob from Get Pages Range call.
See https://msdn.microsoft.com/en-us/library/azure/ee691973.aspx
type PageWriteType ¶
type PageWriteType string
PageWriteType defines the type updates that are going to be done on the page blob.
const ( PageWriteTypeUpdate PageWriteType = "update" PageWriteTypeClear PageWriteType = "clear" )
Types of operations on page blobs
type PeekMessageResponse ¶
type PeekMessageResponse struct { MessageID string `xml:"MessageId"` InsertionTime string `xml:"InsertionTime"` ExpirationTime string `xml:"ExpirationTime"` DequeueCount int `xml:"DequeueCount"` MessageText string `xml:"MessageText"` }
PeekMessageResponse represents a QueueMessage object returned from Peek Messages operation response.
type PeekMessagesParameters ¶
type PeekMessagesParameters struct {
NumOfMessages int
}
PeekMessagesParameters is the set of options can be specified for Peek Messsage operation. A zero struct does not use any preferences for the request.
type PeekMessagesResponse ¶
type PeekMessagesResponse struct { XMLName xml.Name `xml:"QueueMessagesList"` QueueMessagesList []PeekMessageResponse `xml:"QueueMessage"` }
PeekMessagesResponse represents a response returned from Get Messages operation.
type PutMessageParameters ¶
PutMessageParameters is the set of options can be specified for Put Messsage operation. A zero struct does not use any preferences for the request.
type QueueMetadataResponse ¶
type QueueMetadataResponse struct { ApproximateMessageCount int UserDefinedMetadata map[string]string }
QueueMetadataResponse represents user defined metadata and queue properties on a specific queue.
See https://msdn.microsoft.com/en-us/library/azure/dd179384.aspx
type QueueServiceClient ¶
type QueueServiceClient struct {
// contains filtered or unexported fields
}
QueueServiceClient contains operations for Microsoft Azure Queue Storage Service.
func (QueueServiceClient) ClearMessages ¶
func (c QueueServiceClient) ClearMessages(queue string) error
ClearMessages operation deletes all messages from the specified queue.
See https://msdn.microsoft.com/en-us/library/azure/dd179454.aspx
func (QueueServiceClient) CreateQueue ¶
func (c QueueServiceClient) CreateQueue(name string) error
CreateQueue operation creates a queue under the given account.
See https://msdn.microsoft.com/en-us/library/azure/dd179342.aspx
func (QueueServiceClient) DeleteMessage ¶
func (c QueueServiceClient) DeleteMessage(queue, messageID, popReceipt string) error
DeleteMessage operation deletes the specified message.
See https://msdn.microsoft.com/en-us/library/azure/dd179347.aspx
func (QueueServiceClient) DeleteQueue ¶
func (c QueueServiceClient) DeleteQueue(name string) error
DeleteQueue operation permanently deletes the specified queue.
See https://msdn.microsoft.com/en-us/library/azure/dd179436.aspx
func (QueueServiceClient) GetMessages ¶
func (c QueueServiceClient) GetMessages(queue string, params GetMessagesParameters) (GetMessagesResponse, error)
GetMessages operation retrieves one or more messages from the front of the queue.
See https://msdn.microsoft.com/en-us/library/azure/dd179474.aspx
func (QueueServiceClient) GetMetadata ¶
func (c QueueServiceClient) GetMetadata(name string) (QueueMetadataResponse, error)
GetMetadata operation retrieves user-defined metadata and queue properties on the specified queue. Metadata is associated with the queue as name-values pairs.
See https://msdn.microsoft.com/en-us/library/azure/dd179384.aspx
Because the way Golang's http client (and http.Header in particular) canonicalize header names, the returned metadata names would always be all lower case.
func (QueueServiceClient) PeekMessages ¶
func (c QueueServiceClient) PeekMessages(queue string, params PeekMessagesParameters) (PeekMessagesResponse, error)
PeekMessages retrieves one or more messages from the front of the queue, but does not alter the visibility of the message.
See https://msdn.microsoft.com/en-us/library/azure/dd179472.aspx
func (QueueServiceClient) PutMessage ¶
func (c QueueServiceClient) PutMessage(queue string, message string, params PutMessageParameters) error
PutMessage operation adds a new message to the back of the message queue.
See https://msdn.microsoft.com/en-us/library/azure/dd179346.aspx
func (QueueServiceClient) QueueExists ¶
func (c QueueServiceClient) QueueExists(name string) (bool, error)
QueueExists returns true if a queue with given name exists.
func (QueueServiceClient) SetMetadata ¶
func (c QueueServiceClient) SetMetadata(name string, metadata map[string]string) error
SetMetadata operation sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs.
See https://msdn.microsoft.com/en-us/library/azure/dd179348.aspx
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 ¶
func (e UnexpectedStatusCodeError) Error() string
func (UnexpectedStatusCodeError) Got ¶
func (e UnexpectedStatusCodeError) Got() int
Got is the actual status code returned by Azure.