...

Package storage

import "github.com/Azure/azure-sdk-for-go/storage"
Overview
Index

Overview ▾

Package storage provides clients for Microsoft Azure Storage Services.

Package storage provides clients for Microsoft Azure Storage Services.

Index ▾

Constants
func IsValidCosmosAccount(account string) bool
func IsValidStorageAccount(account string) bool
type AbortCopyOptions
type AccessPolicy
type AccessPolicyDetailsXML
type AccountSASTokenOptions
type AppendBlockOptions
type AzureStorageServiceError
    func (e AzureStorageServiceError) Error() string
type AzureTablesServiceError
    func (e AzureTablesServiceError) Error() string
type BatchEntity
type Blob
    func (b *Blob) AbortCopy(copyID string, options *AbortCopyOptions) error
    func (b *Blob) AcquireLease(leaseTimeInSeconds int, proposedLeaseID string, options *LeaseOptions) (returnedLeaseID string, err error)
    func (b *Blob) AppendBlock(chunk []byte, options *AppendBlockOptions) error
    func (b *Blob) BreakLease(options *LeaseOptions) (breakTimeout int, err error)
    func (b *Blob) BreakLeaseWithBreakPeriod(breakPeriodInSeconds int, options *LeaseOptions) (breakTimeout int, err error)
    func (b *Blob) ChangeLease(currentLeaseID string, proposedLeaseID string, options *LeaseOptions) (newLeaseID string, err error)
    func (b *Blob) ClearRange(blobRange BlobRange, options *PutPageOptions) error
    func (b *Blob) Copy(sourceBlob string, options *CopyOptions) error
    func (b *Blob) CreateBlockBlob(options *PutBlobOptions) error
    func (b *Blob) CreateBlockBlobFromReader(blob io.Reader, options *PutBlobOptions) error
    func (b *Blob) CreateSnapshot(options *SnapshotOptions) (snapshotTimestamp *time.Time, err error)
    func (b *Blob) Delete(options *DeleteBlobOptions) error
    func (b *Blob) DeleteIfExists(options *DeleteBlobOptions) (bool, error)
    func (b *Blob) Exists() (bool, error)
    func (b *Blob) Get(options *GetBlobOptions) (io.ReadCloser, error)
    func (b *Blob) GetBlockList(blockType BlockListType, options *GetBlockListOptions) (BlockListResponse, error)
    func (b *Blob) GetMetadata(options *GetBlobMetadataOptions) error
    func (b *Blob) GetPageRanges(options *GetPageRangesOptions) (GetPageRangesResponse, error)
    func (b *Blob) GetProperties(options *GetBlobPropertiesOptions) error
    func (b *Blob) GetRange(options *GetBlobRangeOptions) (io.ReadCloser, error)
    func (b *Blob) GetSASURI(options BlobSASOptions) (string, error)
    func (b *Blob) GetURL() string
    func (b *Blob) IncrementalCopyBlob(sourceBlobURL string, snapshotTime time.Time, options *IncrementalCopyOptions) (string, error)
    func (b *Blob) PutAppendBlob(options *PutBlobOptions) error
    func (b *Blob) PutBlock(blockID string, chunk []byte, options *PutBlockOptions) error
    func (b *Blob) PutBlockFromURL(blockID string, blobURL string, offset int64, size uint64, options *PutBlockFromURLOptions) error
    func (b *Blob) PutBlockList(blocks []Block, options *PutBlockListOptions) error
    func (b *Blob) PutBlockWithLength(blockID string, size uint64, blob io.Reader, options *PutBlockOptions) error
    func (b *Blob) PutPageBlob(options *PutBlobOptions) error
    func (b *Blob) ReleaseLease(currentLeaseID string, options *LeaseOptions) error
    func (b *Blob) RenewLease(currentLeaseID string, options *LeaseOptions) error
    func (b *Blob) SetMetadata(options *SetBlobMetadataOptions) error
    func (b *Blob) SetProperties(options *SetBlobPropertiesOptions) error
    func (b *Blob) StartCopy(sourceBlob string, options *CopyOptions) (string, error)
    func (b *Blob) WaitForCopy(copyID string) error
    func (b *Blob) WriteRange(blobRange BlobRange, bytes io.Reader, options *PutPageOptions) error
type BlobListResponse
type BlobMetadata
    func (bm BlobMetadata) MarshalXML(enc *xml.Encoder, start xml.StartElement) error
    func (bm *BlobMetadata) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type BlobProperties
type BlobRange
    func (br BlobRange) String() string
type BlobSASOptions
type BlobServiceSASPermissions
type BlobStorageClient
    func (b *BlobStorageClient) GetContainerReference(name string) *Container
    func (b *BlobStorageClient) GetServiceProperties() (*ServiceProperties, error)
    func (b BlobStorageClient) ListContainers(params ListContainersParameters) (*ContainerListResponse, error)
    func (b *BlobStorageClient) SetServiceProperties(props ServiceProperties) error
type BlobType
type Block
type BlockListResponse
type BlockListType
type BlockResponse
type BlockStatus
type Client
    func NewAccountSASClient(account string, token url.Values, env azure.Environment) Client
    func NewAccountSASClientFromEndpointToken(endpoint string, sasToken string) (Client, error)
    func NewBasicClient(accountName, accountKey string) (Client, error)
    func NewBasicClientOnSovereignCloud(accountName, accountKey string, env azure.Environment) (Client, error)
    func NewClient(accountName, accountKey, serviceBaseURL, apiVersion string, useHTTPS bool) (Client, error)
    func NewClientFromConnectionString(input string) (Client, error)
    func NewCosmosClient(accountName, accountKey, serviceBaseURL, apiVersion string, useHTTPS bool) (Client, error)
    func NewEmulatorClient() (Client, error)
    func (c *Client) AddAdditionalHeaders(headers map[string]string)
    func (c *Client) AddToUserAgent(extension string) error
    func (c Client) GetAccountSASToken(options AccountSASTokenOptions) (url.Values, error)
    func (c Client) GetBlobService() BlobStorageClient
    func (c Client) GetFileService() FileServiceClient
    func (c Client) GetQueueService() QueueServiceClient
    func (c Client) GetTableService() TableServiceClient
type Container
    func GetContainerReferenceFromSASURI(sasuri url.URL) (*Container, error)
    func (c *Container) Client() *Client
    func (c *Container) Create(options *CreateContainerOptions) error
    func (c *Container) CreateIfNotExists(options *CreateContainerOptions) (bool, error)
    func (c *Container) Delete(options *DeleteContainerOptions) error
    func (c *Container) DeleteIfExists(options *DeleteContainerOptions) (bool, error)
    func (c *Container) Exists() (bool, error)
    func (c *Container) GetBlobReference(name string) *Blob
    func (c *Container) GetMetadata(options *ContainerMetadataOptions) error
    func (c *Container) GetPermissions(options *GetContainerPermissionOptions) (*ContainerPermissions, error)
    func (c *Container) GetProperties() error
    func (c *Container) GetSASURI(options ContainerSASOptions) (string, error)
    func (c *Container) GetURL() string
    func (c *Container) ListBlobs(params ListBlobsParameters) (BlobListResponse, error)
    func (c *Container) SetMetadata(options *ContainerMetadataOptions) error
    func (c *Container) SetPermissions(permissions ContainerPermissions, options *SetContainerPermissionOptions) error
type ContainerAccessPolicy
type ContainerAccessType
type ContainerListResponse
type ContainerMetadataOptions
type ContainerPermissions
type ContainerProperties
type ContainerSASOptions
type ContainerSASPermissions
type CopyOptions
type CopyOptionsConditions
type Cors
type CorsRule
type CreateContainerOptions
type DefaultSender
    func (ds *DefaultSender) Send(c *Client, req *http.Request) (resp *http.Response, err error)
type DeleteBlobOptions
type DeleteContainerOptions
type Directory
    func (d *Directory) Create(options *FileRequestOptions) error
    func (d *Directory) CreateIfNotExists(options *FileRequestOptions) (bool, error)
    func (d *Directory) Delete(options *FileRequestOptions) error
    func (d *Directory) DeleteIfExists(options *FileRequestOptions) (bool, error)
    func (d *Directory) Exists() (bool, error)
    func (d *Directory) FetchAttributes(options *FileRequestOptions) error
    func (d *Directory) GetDirectoryReference(name string) *Directory
    func (d *Directory) GetFileReference(name string) *File
    func (d *Directory) ListDirsAndFiles(params ListDirsAndFilesParameters) (*DirsAndFilesListResponse, error)
    func (d *Directory) SetMetadata(options *FileRequestOptions) error
    func (d *Directory) URL() string
type DirectoryProperties
type DirsAndFilesListResponse
type Entity
    func (e *Entity) Delete(force bool, options *EntityOptions) error
    func (e *Entity) Get(timeout uint, ml MetadataLevel, options *GetEntityOptions) error
    func (e *Entity) Insert(ml MetadataLevel, options *EntityOptions) error
    func (e *Entity) InsertOrMerge(options *EntityOptions) error
    func (e *Entity) InsertOrReplace(options *EntityOptions) error
    func (e *Entity) MarshalJSON() ([]byte, error)
    func (e *Entity) Merge(force bool, options *EntityOptions) error
    func (e *Entity) UnmarshalJSON(data []byte) error
    func (e *Entity) Update(force bool, options *EntityOptions) error
type EntityOptions
type EntityQueryResult
    func (eqr *EntityQueryResult) NextResults(options *TableOptions) (*EntityQueryResult, error)
type File
    func (f *File) ClearRange(fileRange FileRange, options *FileRequestOptions) error
    func (f *File) CopyFile(sourceURL string, options *FileRequestOptions) error
    func (f *File) Create(maxSize uint64, options *FileRequestOptions) error
    func (f *File) Delete(options *FileRequestOptions) error
    func (f *File) DeleteIfExists(options *FileRequestOptions) (bool, error)
    func (f *File) DownloadRangeToStream(fileRange FileRange, options *GetFileOptions) (fs FileStream, err error)
    func (f *File) DownloadToStream(options *FileRequestOptions) (io.ReadCloser, error)
    func (f *File) Exists() (bool, error)
    func (f *File) FetchAttributes(options *FileRequestOptions) error
    func (f *File) ListRanges(options *ListRangesOptions) (*FileRanges, error)
    func (f *File) SetMetadata(options *FileRequestOptions) error
    func (f *File) SetProperties(options *FileRequestOptions) error
    func (f *File) URL() string
    func (f *File) WriteRange(bytes io.Reader, fileRange FileRange, options *WriteRangeOptions) error
type FileCopyState
type FileProperties
type FileRange
    func (fr FileRange) String() string
type FileRanges
type FileRequestOptions
type FileServiceClient
    func (f *FileServiceClient) GetServiceProperties() (*ServiceProperties, error)
    func (f *FileServiceClient) GetShareReference(name string) *Share
    func (f FileServiceClient) ListShares(params ListSharesParameters) (*ShareListResponse, error)
    func (f *FileServiceClient) SetServiceProperties(props ServiceProperties) error
type FileStream
type GetBlobMetadataOptions
type GetBlobOptions
type GetBlobPropertiesOptions
type GetBlobRangeOptions
type GetBlockListOptions
type GetContainerPermissionOptions
type GetEntityOptions
type GetFileOptions
type GetMessagesOptions
type GetPageRangesOptions
type GetPageRangesResponse
type GetQueuePermissionOptions
type IncludeBlobDataset
type IncrementalCopyOptions
type IncrementalCopyOptionsConditions
type LeaseOptions
type ListBlobsParameters
type ListContainersParameters
type ListDirsAndFilesParameters
type ListRangesOptions
type ListSharesParameters
type Logging
type Message
    func (m *Message) Delete(options *QueueServiceOptions) error
    func (m *Message) Put(options *PutMessageOptions) error
    func (m *Message) Update(options *UpdateMessageOptions) error
type MetadataLevel
type Metrics
type Operation
type OverrideHeaders
type PageRange
type PeekMessagesOptions
type Permissions
type PutBlobOptions
type PutBlockFromURLOptions
type PutBlockListOptions
type PutBlockOptions
type PutMessageOptions
type PutPageOptions
type QueryNextLink
type QueryOptions
type QueryTablesOptions
type Queue
    func (q *Queue) ClearMessages(options *QueueServiceOptions) error
    func (q *Queue) Create(options *QueueServiceOptions) error
    func (q *Queue) Delete(options *QueueServiceOptions) error
    func (q *Queue) Exists() (bool, error)
    func (q *Queue) GetMessageReference(text string) *Message
    func (q *Queue) GetMessages(options *GetMessagesOptions) ([]Message, error)
    func (q *Queue) GetMetadata(options *QueueServiceOptions) error
    func (q *Queue) GetPermissions(options *GetQueuePermissionOptions) (*QueuePermissions, error)
    func (q *Queue) GetSASURI(options QueueSASOptions) (string, error)
    func (q *Queue) PeekMessages(options *PeekMessagesOptions) ([]Message, error)
    func (q *Queue) SetMetadata(options *QueueServiceOptions) error
    func (q *Queue) SetPermissions(permissions QueuePermissions, options *SetQueuePermissionOptions) error
type QueueAccessPolicy
type QueuePermissions
type QueueSASOptions
type QueueSASPermissions
type QueueServiceClient
    func (q *QueueServiceClient) GetQueueReference(name string) *Queue
    func (q *QueueServiceClient) GetServiceProperties() (*ServiceProperties, error)
    func (q *QueueServiceClient) SetServiceProperties(props ServiceProperties) error
type QueueServiceOptions
type ResourceTypes
type RetentionPolicy
type SASOptions
type Sender
type SequenceNumberAction
type ServiceProperties
type Services
type SetBlobMetadataOptions
type SetBlobPropertiesOptions
type SetContainerPermissionOptions
type SetQueuePermissionOptions
type Share
    func (s *Share) Create(options *FileRequestOptions) error
    func (s *Share) CreateIfNotExists(options *FileRequestOptions) (bool, error)
    func (s *Share) Delete(options *FileRequestOptions) error
    func (s *Share) DeleteIfExists(options *FileRequestOptions) (bool, error)
    func (s *Share) Exists() (bool, error)
    func (s *Share) FetchAttributes(options *FileRequestOptions) error
    func (s *Share) GetRootDirectoryReference() *Directory
    func (s *Share) ServiceClient() *FileServiceClient
    func (s *Share) SetMetadata(options *FileRequestOptions) error
    func (s *Share) SetProperties(options *FileRequestOptions) error
    func (s *Share) URL() string
type ShareListResponse
type ShareProperties
type SignedIdentifier
type SignedIdentifiers
type SnapshotOptions
type StaticWebsite
type Table
    func (t *Table) Create(timeout uint, ml MetadataLevel, options *TableOptions) error
    func (t *Table) Delete(timeout uint, options *TableOptions) error
    func (t *Table) Get(timeout uint, ml MetadataLevel) error
    func (t *Table) GetEntityReference(partitionKey, rowKey string) *Entity
    func (t *Table) GetPermissions(timeout int, options *TableOptions) ([]TableAccessPolicy, error)
    func (t *Table) NewBatch() *TableBatch
    func (t *Table) QueryEntities(timeout uint, ml MetadataLevel, options *QueryOptions) (*EntityQueryResult, error)
    func (t *Table) SetPermissions(tap []TableAccessPolicy, timeout uint, options *TableOptions) error
type TableAccessPolicy
type TableBatch
    func (t *TableBatch) DeleteEntity(entity *Entity, force bool)
    func (t *TableBatch) DeleteEntityByForce(entity *Entity, force bool)
    func (t *TableBatch) ExecuteBatch() error
    func (t *TableBatch) InsertEntity(entity *Entity)
    func (t *TableBatch) InsertOrMergeEntity(entity *Entity, force bool)
    func (t *TableBatch) InsertOrMergeEntityByForce(entity *Entity)
    func (t *TableBatch) InsertOrReplaceEntity(entity *Entity, force bool)
    func (t *TableBatch) InsertOrReplaceEntityByForce(entity *Entity)
    func (t *TableBatch) MergeEntity(entity *Entity)
    func (t *TableBatch) ReplaceEntity(entity *Entity)
type TableOptions
type TableQueryResult
    func (tqr *TableQueryResult) NextResults(options *TableOptions) (*TableQueryResult, error)
type TableServiceClient
    func (t *TableServiceClient) GetServiceProperties() (*ServiceProperties, error)
    func (t *TableServiceClient) GetTableReference(name string) *Table
    func (t *TableServiceClient) QueryTables(ml MetadataLevel, options *QueryTablesOptions) (*TableQueryResult, error)
    func (t *TableServiceClient) SetServiceProperties(props ServiceProperties) error
type TimeRFC1123
    func (t *TimeRFC1123) MarshalXML(e *xml.Encoder, start xml.StartElement) error
    func (t *TimeRFC1123) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type UnexpectedStatusCodeError
    func (e UnexpectedStatusCodeError) Error() string
    func (e UnexpectedStatusCodeError) Got() int
    func (e UnexpectedStatusCodeError) Inner() error
type UpdateMessageOptions
type WriteRangeOptions

Package files

appendblob.go authorization.go blob.go blobsasuri.go blobserviceclient.go blockblob.go client.go commonsasuri.go container.go copyblob.go directory.go entity.go file.go fileserviceclient.go leaseblob.go message.go odata.go pageblob.go queue.go queuesasuri.go queueserviceclient.go share.go storagepolicy.go storageservice.go table.go table_batch.go tableserviceclient.go util.go

Constants

Maximum sizes (per REST API) for various concepts

const (
    MaxBlobBlockSize = 100 * 1024 * 1024
    MaxBlobPageSize  = 4 * 1024 * 1024
)
const (
    // DefaultBaseURL is the domain name used for storage requests in the
    // public cloud 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 = "2018-03-28"

    // StorageEmulatorAccountName is the fixed storage account used by Azure Storage Emulator
    StorageEmulatorAccountName = "devstoreaccount1"

    // StorageEmulatorAccountKey is the the fixed storage account used by Azure Storage Emulator
    StorageEmulatorAccountKey = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
)

This consts are meant to help with Odata supported operations

const (
    OdataTypeSuffix = "@odata.type"

    OdataBinary   = "Edm.Binary"
    OdataDateTime = "Edm.DateTime"
    OdataDouble   = "Edm.Double"
    OdataGUID     = "Edm.Guid"
    OdataInt64    = "Edm.Int64"

    OdataFilter  = "$filter"
    OdataOrderBy = "$orderby"
    OdataTop     = "$top"
    OdataSkip    = "$skip"
    OdataCount   = "$count"
    OdataExpand  = "$expand"
    OdataSelect  = "$select"
    OdataSearch  = "$search"

    EmptyPayload    MetadataLevel = ""
    NoMetadata      MetadataLevel = "application/json;odata=nometadata"
    MinimalMetadata MetadataLevel = "application/json;odata=minimalmetadata"
    FullMetadata    MetadataLevel = "application/json;odata=fullmetadata"
)

consts for batch operations.

const (
    InsertOp          = Operation(1)
    DeleteOp          = Operation(2)
    ReplaceOp         = Operation(3)
    MergeOp           = Operation(4)
    InsertOrReplaceOp = Operation(5)
    InsertOrMergeOp   = Operation(6)
)

ContainerAccessHeader references header used when setting/getting container ACL

const (
    ContainerAccessHeader string = "x-ms-blob-public-access"
)

MaxFileSize defines the maximum size in bytes for a file.

const MaxFileSize = oneTB

MaxRangeSize defines the maximum size in bytes for a file range.

const MaxRangeSize = fourMB

func IsValidCosmosAccount

func IsValidCosmosAccount(account string) bool

IsValidCosmosAccount checks if the Cosmos account name is valid. See https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-manage-database-account

func IsValidStorageAccount

func IsValidStorageAccount(account string) bool

IsValidStorageAccount checks if the storage account name is valid. See https://docs.microsoft.com/en-us/azure/storage/storage-create-storage-account

type AbortCopyOptions

AbortCopyOptions includes the options for an abort blob operation

type AbortCopyOptions struct {
    Timeout   uint
    LeaseID   string `header:"x-ms-lease-id"`
    RequestID string `header:"x-ms-client-request-id"`
}

type AccessPolicy

AccessPolicy is the response type from the GetPermissions call.

type AccessPolicy struct {
    SignedIdentifiersList SignedIdentifiers `xml:"SignedIdentifiers"`
}

type AccessPolicyDetailsXML

AccessPolicyDetailsXML has specifics about an access policy annotated with XML details.

type AccessPolicyDetailsXML struct {
    StartTime  time.Time `xml:"Start"`
    ExpiryTime time.Time `xml:"Expiry"`
    Permission string    `xml:"Permission"`
}

type AccountSASTokenOptions

AccountSASTokenOptions includes options for constructing an account SAS token. https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas

type AccountSASTokenOptions struct {
    APIVersion    string
    Services      Services
    ResourceTypes ResourceTypes
    Permissions   Permissions
    Start         time.Time
    Expiry        time.Time
    IP            string
    UseHTTPS      bool
}

type AppendBlockOptions

AppendBlockOptions includes the options for an append block operation

type AppendBlockOptions struct {
    Timeout           uint
    LeaseID           string     `header:"x-ms-lease-id"`
    MaxSize           *uint      `header:"x-ms-blob-condition-maxsize"`
    AppendPosition    *uint      `header:"x-ms-blob-condition-appendpos"`
    IfModifiedSince   *time.Time `header:"If-Modified-Since"`
    IfUnmodifiedSince *time.Time `header:"If-Unmodified-Since"`
    IfMatch           string     `header:"If-Match"`
    IfNoneMatch       string     `header:"If-None-Match"`
    RequestID         string     `header:"x-ms-client-request-id"`
    ContentMD5        bool
}

type AzureStorageServiceError

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.

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"`
    Lang                      string
    StatusCode                int
    RequestID                 string
    Date                      string
    APIVersion                string
}

func (AzureStorageServiceError) Error

func (e AzureStorageServiceError) Error() string

type AzureTablesServiceError

AzureTablesServiceError contains fields of the error response from Azure Table Storage Service REST API in Atom format. See https://msdn.microsoft.com/en-us/library/azure/dd179382.aspx

type AzureTablesServiceError struct {
    Code       string `xml:"code"`
    Message    string `xml:"message"`
    StatusCode int
    RequestID  string
    Date       string
    APIVersion string
}

func (AzureTablesServiceError) Error

func (e AzureTablesServiceError) Error() string

type BatchEntity

BatchEntity used for tracking Entities to operate on and whether operations (replace/merge etc) should be forced. Wrapper for regular Entity with additional data specific for the entity.

type BatchEntity struct {
    *Entity
    Force bool
    Op    Operation
}

type Blob

A Blob is an entry in BlobListResponse.

type Blob struct {
    Container  *Container
    Name       string         `xml:"Name"`
    Snapshot   time.Time      `xml:"Snapshot"`
    Properties BlobProperties `xml:"Properties"`
    Metadata   BlobMetadata   `xml:"Metadata"`
}

func (*Blob) AbortCopy

func (b *Blob) AbortCopy(copyID string, options *AbortCopyOptions) error

AbortCopy aborts a BlobCopy which has already been triggered by the StartBlobCopy function. copyID is generated from StartBlobCopy function. currentLeaseID is required IF the destination blob has an active lease on it. See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Abort-Copy-Blob

func (*Blob) AcquireLease

func (b *Blob) AcquireLease(leaseTimeInSeconds int, proposedLeaseID string, options *LeaseOptions) (returnedLeaseID string, err error)

AcquireLease creates a lease for a blob returns leaseID acquired In API Versions starting on 2012-02-12, the minimum leaseTimeInSeconds is 15, the maximum non-infinite leaseTimeInSeconds is 60. To specify an infinite lease, provide the value -1. See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Lease-Blob

func (*Blob) AppendBlock

func (b *Blob) AppendBlock(chunk []byte, options *AppendBlockOptions) error

AppendBlock appends a block to an append blob.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Append-Block

func (*Blob) BreakLease

func (b *Blob) BreakLease(options *LeaseOptions) (breakTimeout int, err error)

BreakLease breaks the lease for a blob Returns the timeout remaining in the lease in seconds See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Lease-Blob

func (*Blob) BreakLeaseWithBreakPeriod

func (b *Blob) BreakLeaseWithBreakPeriod(breakPeriodInSeconds int, options *LeaseOptions) (breakTimeout int, err error)

BreakLeaseWithBreakPeriod breaks the lease for a blob breakPeriodInSeconds is used to determine how long until new lease can be created. Returns the timeout remaining in the lease in seconds See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Lease-Blob

func (*Blob) ChangeLease

func (b *Blob) ChangeLease(currentLeaseID string, proposedLeaseID string, options *LeaseOptions) (newLeaseID string, err error)

ChangeLease changes a lease ID for a blob Returns the new LeaseID acquired See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Lease-Blob

func (*Blob) ClearRange

func (b *Blob) ClearRange(blobRange BlobRange, options *PutPageOptions) error

ClearRange clears the given range in a page blob. Ranges must be aligned with 512-byte boundaries and chunk must be of size multiplies by 512.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Put-Page

func (*Blob) Copy

func (b *Blob) Copy(sourceBlob string, options *CopyOptions) error

Copy 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 the GetURL method.) There is no SLA on blob copy and therefore this helper method works faster on smaller files.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Copy-Blob

func (*Blob) CreateBlockBlob

func (b *Blob) CreateBlockBlob(options *PutBlobOptions) error

CreateBlockBlob initializes an empty block blob with no blocks.

See CreateBlockBlobFromReader for more info on creating blobs.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Put-Blob

func (*Blob) CreateBlockBlobFromReader

func (b *Blob) CreateBlockBlobFromReader(blob io.Reader, options *PutBlobOptions) 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.

Any headers set in blob.Properties or metadata in blob.Metadata will be set on the blob.

The API rejects requests with size > 256 MiB (but this limit is not checked by the SDK). To write a larger blob, use CreateBlockBlob, PutBlock, and PutBlockList.

To create a blob from scratch, call container.GetBlobReference() to get an empty blob, fill in blob.Properties and blob.Metadata as appropriate then call this method.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Put-Blob

func (*Blob) CreateSnapshot

func (b *Blob) CreateSnapshot(options *SnapshotOptions) (snapshotTimestamp *time.Time, err error)

CreateSnapshot creates a snapshot for a blob See https://msdn.microsoft.com/en-us/library/azure/ee691971.aspx

func (*Blob) Delete

func (b *Blob) Delete(options *DeleteBlobOptions) error

Delete deletes the given blob from the specified container. If the blob does not exist at the time of the Delete Blob operation, it returns error. See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Delete-Blob

func (*Blob) DeleteIfExists

func (b *Blob) DeleteIfExists(options *DeleteBlobOptions) (bool, error)

DeleteIfExists deletes the given blob from the specified container If the blob is deleted with this call, returns true. Otherwise returns false.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Delete-Blob

func (*Blob) Exists

func (b *Blob) Exists() (bool, error)

Exists returns true if a blob with given name exists on the specified container of the storage account.

func (*Blob) Get

func (b *Blob) Get(options *GetBlobOptions) (io.ReadCloser, error)

Get returns a stream to read the blob. Caller must call both Read and Close() to correctly close the underlying connection.

See the GetRange method for use with a Range header.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Get-Blob

func (*Blob) GetBlockList

func (b *Blob) GetBlockList(blockType BlockListType, options *GetBlockListOptions) (BlockListResponse, error)

GetBlockList retrieves list of blocks in the specified block blob.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Get-Block-List

func (*Blob) GetMetadata

func (b *Blob) GetMetadata(options *GetBlobMetadataOptions) error

GetMetadata 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 (*Blob) GetPageRanges

func (b *Blob) GetPageRanges(options *GetPageRangesOptions) (GetPageRangesResponse, error)

GetPageRanges returns the list of valid page ranges for a page blob.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Get-Page-Ranges

func (*Blob) GetProperties

func (b *Blob) GetProperties(options *GetBlobPropertiesOptions) error

GetProperties provides various information about the specified blob. See https://msdn.microsoft.com/en-us/library/azure/dd179394.aspx

func (*Blob) GetRange

func (b *Blob) GetRange(options *GetBlobRangeOptions) (io.ReadCloser, error)

GetRange 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. Caller must call both Read and Close()// to correctly close the underlying connection. See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Get-Blob

func (*Blob) GetSASURI

func (b *Blob) GetSASURI(options BlobSASOptions) (string, error)

GetSASURI creates an URL to the blob which contains the Shared Access Signature with the specified options.

See https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas

func (*Blob) GetURL

func (b *Blob) GetURL() string

GetURL 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 (*Blob) IncrementalCopyBlob

func (b *Blob) IncrementalCopyBlob(sourceBlobURL string, snapshotTime time.Time, options *IncrementalCopyOptions) (string, error)

IncrementalCopyBlob copies a snapshot of a source blob and copies to referring blob sourceBlob parameter must be a valid snapshot URL of the original blob. THe original blob mut be public, or use a Shared Access Signature.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/incremental-copy-blob .

func (*Blob) PutAppendBlob

func (b *Blob) PutAppendBlob(options *PutBlobOptions) error

PutAppendBlob initializes an empty append blob with specified name. An append blob must be created using this method before appending blocks.

See CreateBlockBlobFromReader for more info on creating blobs.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Put-Blob

func (*Blob) PutBlock

func (b *Blob) PutBlock(blockID string, chunk []byte, options *PutBlockOptions) error

PutBlock saves the given data chunk to the specified block blob with given ID.

The API rejects chunks larger than 100 MiB (but this limit is not checked by the SDK).

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Put-Block

func (*Blob) PutBlockFromURL

func (b *Blob) PutBlockFromURL(blockID string, blobURL string, offset int64, size uint64, options *PutBlockFromURLOptions) error

PutBlockFromURL copy data of exactly specified size from specified URL to the block blob with given ID. It is an alternative to PutBlocks where data comes from a remote URL and the offset and length is known in advance.

The API rejects requests with size > 100 MiB (but this limit is not checked by the SDK).

See https://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url

func (*Blob) PutBlockList

func (b *Blob) PutBlockList(blocks []Block, options *PutBlockListOptions) error

PutBlockList saves list of blocks to the specified block blob.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Put-Block-List

func (*Blob) PutBlockWithLength

func (b *Blob) PutBlockWithLength(blockID string, size uint64, blob io.Reader, options *PutBlockOptions) 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 > 100 MiB (but this limit is not checked by the SDK).

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Put-Block

func (*Blob) PutPageBlob

func (b *Blob) PutPageBlob(options *PutBlobOptions) 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 CreateBlockBlobFromReader for more info on creating blobs.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Put-Blob

func (*Blob) ReleaseLease

func (b *Blob) ReleaseLease(currentLeaseID string, options *LeaseOptions) error

ReleaseLease releases the lease for a blob See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Lease-Blob

func (*Blob) RenewLease

func (b *Blob) RenewLease(currentLeaseID string, options *LeaseOptions) error

RenewLease renews the lease for a blob as per https://msdn.microsoft.com/en-us/library/azure/ee691972.aspx

func (*Blob) SetMetadata

func (b *Blob) SetMetadata(options *SetBlobMetadataOptions) error

SetMetadata 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

func (*Blob) SetProperties

func (b *Blob) SetProperties(options *SetBlobPropertiesOptions) error

SetProperties replaces the BlobHeaders for the specified blob.

Some keys may be converted to Camel-Case before sending. All keys are returned in lower case by GetBlobProperties. HTTP header names are case-insensitive so case munging should not matter to other applications either.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Set-Blob-Properties

func (*Blob) StartCopy

func (b *Blob) StartCopy(sourceBlob string, options *CopyOptions) (string, error)

StartCopy starts a blob copy operation. sourceBlob parameter must be a canonical URL to the blob (can be obtained using the GetURL method.)

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Copy-Blob

func (*Blob) WaitForCopy

func (b *Blob) WaitForCopy(copyID string) error

WaitForCopy loops until a BlobCopy operation is completed (or fails with error)

func (*Blob) WriteRange

func (b *Blob) WriteRange(blobRange BlobRange, bytes io.Reader, options *PutPageOptions) error

WriteRange writes a range of pages to a page blob. Ranges must be aligned with 512-byte boundaries and chunk must be of size multiplies by 512.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Put-Page

type BlobListResponse

BlobListResponse contains the response fields from ListBlobs call.

See https://msdn.microsoft.com/en-us/library/azure/dd135734.aspx

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"`

    // BlobPrefix is used to traverse blobs as if it were a file system.
    // It is returned if ListBlobsParameters.Delimiter is specified.
    // The list here can be thought of as "folders" that may contain
    // other folders or blobs.
    BlobPrefixes []string `xml:"Blobs>BlobPrefix>Name"`

    // Delimiter is used to traverse blobs as if it were a file system.
    // It is returned if ListBlobsParameters.Delimiter is specified.
    Delimiter string `xml:"Delimiter"`
}

type BlobMetadata

BlobMetadata is a set of custom name/value pairs.

See https://msdn.microsoft.com/en-us/library/azure/dd179404.aspx

type BlobMetadata map[string]string

func (BlobMetadata) MarshalXML

func (bm BlobMetadata) MarshalXML(enc *xml.Encoder, start xml.StartElement) error

MarshalXML implements the xml.Marshaler interface. It encodes metadata name/value pairs as they would appear in an Azure ListBlobs response.

func (*BlobMetadata) UnmarshalXML

func (bm *BlobMetadata) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML converts the xml:Metadata into Metadata map

type BlobProperties

BlobProperties contains various properties of a blob returned in various endpoints like ListBlobs or GetBlobProperties.

type BlobProperties struct {
    LastModified          TimeRFC1123 `xml:"Last-Modified"`
    Etag                  string      `xml:"Etag"`
    ContentMD5            string      `xml:"Content-MD5" header:"x-ms-blob-content-md5"`
    ContentLength         int64       `xml:"Content-Length"`
    ContentType           string      `xml:"Content-Type" header:"x-ms-blob-content-type"`
    ContentEncoding       string      `xml:"Content-Encoding" header:"x-ms-blob-content-encoding"`
    CacheControl          string      `xml:"Cache-Control" header:"x-ms-blob-cache-control"`
    ContentLanguage       string      `xml:"Cache-Language" header:"x-ms-blob-content-language"`
    ContentDisposition    string      `xml:"Content-Disposition" header:"x-ms-blob-content-disposition"`
    BlobType              BlobType    `xml:"BlobType"`
    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    TimeRFC1123 `xml:"CopyCompletionTime"`
    CopyStatusDescription string      `xml:"CopyStatusDescription"`
    LeaseStatus           string      `xml:"LeaseStatus"`
    LeaseState            string      `xml:"LeaseState"`
    LeaseDuration         string      `xml:"LeaseDuration"`
    ServerEncrypted       bool        `xml:"ServerEncrypted"`
    IncrementalCopy       bool        `xml:"IncrementalCopy"`
}

type BlobRange

BlobRange represents the bytes range to be get

type BlobRange struct {
    Start uint64
    End   uint64
}

func (BlobRange) String

func (br BlobRange) String() string

type BlobSASOptions

BlobSASOptions are options to construct a blob SAS URI. See https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas

type BlobSASOptions struct {
    BlobServiceSASPermissions
    OverrideHeaders
    SASOptions
}

type BlobServiceSASPermissions

BlobServiceSASPermissions includes the available permissions for blob service SAS URI.

type BlobServiceSASPermissions struct {
    Read   bool
    Add    bool
    Create bool
    Write  bool
    Delete bool
}

type BlobStorageClient

BlobStorageClient contains operations for Microsoft Azure Blob Storage Service.

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

func (*BlobStorageClient) GetContainerReference

func (b *BlobStorageClient) GetContainerReference(name string) *Container

GetContainerReference returns a Container object for the specified container name.

func (*BlobStorageClient) GetServiceProperties

func (b *BlobStorageClient) GetServiceProperties() (*ServiceProperties, error)

GetServiceProperties gets the properties of your storage account's blob service. See: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/get-blob-service-properties

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) SetServiceProperties

func (b *BlobStorageClient) SetServiceProperties(props ServiceProperties) error

SetServiceProperties sets the properties of your storage account's blob service. See: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/set-blob-service-properties

type BlobType

BlobType defines the type of the Azure Blob.

type BlobType string

Types of page blobs

const (
    BlobTypeBlock  BlobType = "BlockBlob"
    BlobTypePage   BlobType = "PageBlob"
    BlobTypeAppend BlobType = "AppendBlob"
)

type Block

Block is used to create Block entities for Put Block List call.

type Block struct {
    ID     string
    Status BlockStatus
}

type BlockListResponse

BlockListResponse contains the response fields from Get Block List call.

See https://msdn.microsoft.com/en-us/library/azure/dd179400.aspx

type BlockListResponse struct {
    XMLName           xml.Name        `xml:"BlockList"`
    CommittedBlocks   []BlockResponse `xml:"CommittedBlocks>Block"`
    UncommittedBlocks []BlockResponse `xml:"UncommittedBlocks>Block"`
}

type BlockListType

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.

type BlockListType string

Filters for listing blocks in block blobs

const (
    BlockListTypeAll         BlockListType = "all"
    BlockListTypeCommitted   BlockListType = "committed"
    BlockListTypeUncommitted BlockListType = "uncommitted"
)

type BlockResponse

BlockResponse contains the block information returned in the GetBlockListCall.

type BlockResponse struct {
    Name string `xml:"Name"`
    Size int64  `xml:"Size"`
}

type BlockStatus

BlockStatus defines states a block for a block blob can be in.

type BlockStatus string

List of statuses that can be used to refer to a block in a block list

const (
    BlockStatusUncommitted BlockStatus = "Uncommitted"
    BlockStatusCommitted   BlockStatus = "Committed"
    BlockStatusLatest      BlockStatus = "Latest"
)

type Client

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

type Client struct {
    // HTTPClient is the http.Client used to initiate API
    // requests. http.DefaultClient is used when creating a
    // client.
    HTTPClient *http.Client

    // Sender is an interface that sends the request. Clients are
    // created with a DefaultSender. The DefaultSender has an
    // automatic retry strategy built in. The Sender can be customized.
    Sender Sender

    UseSharedKeyLite bool
    // contains filtered or unexported fields
}

func NewAccountSASClient

func NewAccountSASClient(account string, token url.Values, env azure.Environment) Client

NewAccountSASClient contructs a client that uses accountSAS authorization for its operations.

func NewAccountSASClientFromEndpointToken

func NewAccountSASClientFromEndpointToken(endpoint string, sasToken string) (Client, error)

NewAccountSASClientFromEndpointToken constructs a client that uses accountSAS authorization for its operations using the specified endpoint and SAS token.

func NewBasicClient

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

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

func NewBasicClientOnSovereignCloud

func NewBasicClientOnSovereignCloud(accountName, accountKey string, env azure.Environment) (Client, error)

NewBasicClientOnSovereignCloud constructs a Client with given storage service name and key in the referenced cloud.

func NewClient

func NewClient(accountName, accountKey, serviceBaseURL, 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 NewClientFromConnectionString

func NewClientFromConnectionString(input string) (Client, error)

NewClientFromConnectionString creates a Client from the connection string.

func NewCosmosClient

func NewCosmosClient(accountName, accountKey, serviceBaseURL, apiVersion string, useHTTPS bool) (Client, error)

NewCosmosClient constructs a Client for Azure CosmosDB. This should be used if the caller wants to specify whether to use HTTPS, a specific REST API version or a custom cosmos endpoint than Azure Public Cloud.

func NewEmulatorClient

func NewEmulatorClient() (Client, error)

NewEmulatorClient contructs a Client intended to only work with Azure Storage Emulator

func (*Client) AddAdditionalHeaders

func (c *Client) AddAdditionalHeaders(headers map[string]string)

AddAdditionalHeaders adds additional standard headers

func (*Client) AddToUserAgent

func (c *Client) AddToUserAgent(extension string) error

AddToUserAgent adds an extension to the current user agent

func (Client) GetAccountSASToken

func (c Client) GetAccountSASToken(options AccountSASTokenOptions) (url.Values, error)

GetAccountSASToken creates an account SAS token See https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas

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.

func (Client) GetTableService

func (c Client) GetTableService() TableServiceClient

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

type Container

Container represents an Azure container.

type Container struct {
    Name       string              `xml:"Name"`
    Properties ContainerProperties `xml:"Properties"`
    Metadata   map[string]string
    // contains filtered or unexported fields
}

func GetContainerReferenceFromSASURI

func GetContainerReferenceFromSASURI(sasuri url.URL) (*Container, error)

GetContainerReferenceFromSASURI returns a Container object for the specified container SASURI

func (*Container) Client

func (c *Container) Client() *Client

Client returns the HTTP client used by the Container reference.

func (*Container) Create

func (c *Container) Create(options *CreateContainerOptions) error

Create creates a blob container within the storage account with given name and access level. Returns error if container already exists.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Create-Container

func (*Container) CreateIfNotExists

func (c *Container) CreateIfNotExists(options *CreateContainerOptions) (bool, error)

CreateIfNotExists creates a blob container if it does not exist. Returns true if container is newly created or false if container already exists.

func (*Container) Delete

func (c *Container) Delete(options *DeleteContainerOptions) error

Delete deletes the container with given name on the storage account. If the container does not exist returns error.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/delete-container

func (*Container) DeleteIfExists

func (c *Container) DeleteIfExists(options *DeleteContainerOptions) (bool, error)

DeleteIfExists 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://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/delete-container

func (*Container) Exists

func (c *Container) Exists() (bool, error)

Exists returns true if a container with given name exists on the storage account, otherwise returns false.

func (*Container) GetBlobReference

func (c *Container) GetBlobReference(name string) *Blob

GetBlobReference returns a Blob object for the specified blob name.

func (*Container) GetMetadata

func (c *Container) GetMetadata(options *ContainerMetadataOptions) error

GetMetadata returns all user-defined metadata for the specified container.

All metadata keys will be returned in lower case. (HTTP header names are case-insensitive.)

See https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-metadata

func (*Container) GetPermissions

func (c *Container) GetPermissions(options *GetContainerPermissionOptions) (*ContainerPermissions, error)

GetPermissions gets the container permissions as per https://msdn.microsoft.com/en-us/library/azure/dd179469.aspx If timeout is 0 then it will not be passed to Azure leaseID will only be passed to Azure if populated

func (*Container) GetProperties

func (c *Container) GetProperties() error

GetProperties updated the properties of the container.

See https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties

func (*Container) GetSASURI

func (c *Container) GetSASURI(options ContainerSASOptions) (string, error)

GetSASURI creates an URL to the container which contains the Shared Access Signature with the specified options.

See https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas

func (*Container) GetURL

func (c *Container) GetURL() string

GetURL gets the canonical URL to the container. This method does not create a publicly accessible URL if the container is private and this method does not check if the blob exists.

func (*Container) ListBlobs

func (c *Container) ListBlobs(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://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/List-Blobs

func (*Container) SetMetadata

func (c *Container) SetMetadata(options *ContainerMetadataOptions) error

SetMetadata replaces the metadata for the specified container.

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://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata

func (*Container) SetPermissions

func (c *Container) SetPermissions(permissions ContainerPermissions, options *SetContainerPermissionOptions) error

SetPermissions sets up container permissions See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Set-Container-ACL

type ContainerAccessPolicy

ContainerAccessPolicy represents each access policy in the container ACL.

type ContainerAccessPolicy struct {
    ID         string
    StartTime  time.Time
    ExpiryTime time.Time
    CanRead    bool
    CanWrite   bool
    CanDelete  bool
}

type ContainerAccessType

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.

type ContainerAccessType string

Access options for containers

const (
    ContainerAccessTypePrivate   ContainerAccessType = ""
    ContainerAccessTypeBlob      ContainerAccessType = "blob"
    ContainerAccessTypeContainer ContainerAccessType = "container"
)

type ContainerListResponse

ContainerListResponse contains the response fields from ListContainers call.

See https://msdn.microsoft.com/en-us/library/azure/dd179352.aspx

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"`
}

type ContainerMetadataOptions

ContainerMetadataOptions includes options for container metadata operations

type ContainerMetadataOptions struct {
    Timeout   uint
    LeaseID   string `header:"x-ms-lease-id"`
    RequestID string `header:"x-ms-client-request-id"`
}

type ContainerPermissions

ContainerPermissions represents the container ACLs.

type ContainerPermissions struct {
    AccessType     ContainerAccessType
    AccessPolicies []ContainerAccessPolicy
}

type ContainerProperties

ContainerProperties contains various properties of a container returned from various endpoints like ListContainers.

type ContainerProperties struct {
    LastModified  string              `xml:"Last-Modified"`
    Etag          string              `xml:"Etag"`
    LeaseStatus   string              `xml:"LeaseStatus"`
    LeaseState    string              `xml:"LeaseState"`
    LeaseDuration string              `xml:"LeaseDuration"`
    PublicAccess  ContainerAccessType `xml:"PublicAccess"`
}

type ContainerSASOptions

ContainerSASOptions are options to construct a container SAS URI. See https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas

type ContainerSASOptions struct {
    ContainerSASPermissions
    OverrideHeaders
    SASOptions
}

type ContainerSASPermissions

ContainerSASPermissions includes the available permissions for a container SAS URI.

type ContainerSASPermissions struct {
    BlobServiceSASPermissions
    List bool
}

type CopyOptions

CopyOptions includes the options for a copy blob operation

type CopyOptions struct {
    Timeout   uint
    Source    CopyOptionsConditions
    Destiny   CopyOptionsConditions
    RequestID string
}

type CopyOptionsConditions

CopyOptionsConditions includes some conditional options in a copy blob operation

type CopyOptionsConditions struct {
    LeaseID           string
    IfModifiedSince   *time.Time
    IfUnmodifiedSince *time.Time
    IfMatch           string
    IfNoneMatch       string
}

type Cors

Cors includes all the CORS rules

type Cors struct {
    CorsRule []CorsRule
}

type CorsRule

CorsRule includes all settings for a Cors rule

type CorsRule struct {
    AllowedOrigins  string
    AllowedMethods  string
    MaxAgeInSeconds int
    ExposedHeaders  string
    AllowedHeaders  string
}

type CreateContainerOptions

CreateContainerOptions includes the options for a create container operation

type CreateContainerOptions struct {
    Timeout   uint
    Access    ContainerAccessType `header:"x-ms-blob-public-access"`
    RequestID string              `header:"x-ms-client-request-id"`
}

type DefaultSender

DefaultSender is the default sender for the client. It implements an automatic retry strategy.

type DefaultSender struct {
    RetryAttempts    int
    RetryDuration    time.Duration
    ValidStatusCodes []int
    // contains filtered or unexported fields
}

func (*DefaultSender) Send

func (ds *DefaultSender) Send(c *Client, req *http.Request) (resp *http.Response, err error)

Send is the default retry strategy in the client

type DeleteBlobOptions

DeleteBlobOptions includes the options for a delete blob operation

type DeleteBlobOptions struct {
    Timeout           uint
    Snapshot          *time.Time
    LeaseID           string `header:"x-ms-lease-id"`
    DeleteSnapshots   *bool
    IfModifiedSince   *time.Time `header:"If-Modified-Since"`
    IfUnmodifiedSince *time.Time `header:"If-Unmodified-Since"`
    IfMatch           string     `header:"If-Match"`
    IfNoneMatch       string     `header:"If-None-Match"`
    RequestID         string     `header:"x-ms-client-request-id"`
}

type DeleteContainerOptions

DeleteContainerOptions includes options for a delete container operation

type DeleteContainerOptions struct {
    Timeout           uint
    LeaseID           string     `header:"x-ms-lease-id"`
    IfModifiedSince   *time.Time `header:"If-Modified-Since"`
    IfUnmodifiedSince *time.Time `header:"If-Unmodified-Since"`
    RequestID         string     `header:"x-ms-client-request-id"`
}

type Directory

Directory represents a directory on a share.

type Directory struct {
    Metadata map[string]string
    Name     string `xml:"Name"`

    Properties DirectoryProperties
    // contains filtered or unexported fields
}

func (*Directory) Create

func (d *Directory) Create(options *FileRequestOptions) error

Create this directory in the associated share. If a directory with the same name already exists, the operation fails.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Create-Directory

func (*Directory) CreateIfNotExists

func (d *Directory) CreateIfNotExists(options *FileRequestOptions) (bool, error)

CreateIfNotExists creates this directory under the associated share if the directory does not exist. Returns true if the directory is newly created or false if the directory already exists.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Create-Directory

func (*Directory) Delete

func (d *Directory) Delete(options *FileRequestOptions) error

Delete removes this directory. It must be empty in order to be deleted. If the directory does not exist the operation fails.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Delete-Directory

func (*Directory) DeleteIfExists

func (d *Directory) DeleteIfExists(options *FileRequestOptions) (bool, error)

DeleteIfExists removes this directory if it exists.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Delete-Directory

func (*Directory) Exists

func (d *Directory) Exists() (bool, error)

Exists returns true if this directory exists.

func (*Directory) FetchAttributes

func (d *Directory) FetchAttributes(options *FileRequestOptions) error

FetchAttributes retrieves metadata for this directory.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/get-directory-properties

func (*Directory) GetDirectoryReference

func (d *Directory) GetDirectoryReference(name string) *Directory

GetDirectoryReference returns a child Directory object for this directory.

func (*Directory) GetFileReference

func (d *Directory) GetFileReference(name string) *File

GetFileReference returns a child File object for this directory.

func (*Directory) ListDirsAndFiles

func (d *Directory) ListDirsAndFiles(params ListDirsAndFilesParameters) (*DirsAndFilesListResponse, error)

ListDirsAndFiles returns a list of files and directories under this directory. It also contains a pagination token and other response details.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/List-Directories-and-Files

func (*Directory) SetMetadata

func (d *Directory) SetMetadata(options *FileRequestOptions) error

SetMetadata replaces the metadata for this directory.

Some keys may be converted to Camel-Case before sending. All keys are returned in lower case by GetDirectoryMetadata. HTTP header names are case-insensitive so case munging should not matter to other applications either.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Set-Directory-Metadata

func (*Directory) URL

func (d *Directory) URL() string

URL gets the canonical URL to this directory. This method does not create a publicly accessible URL if the directory is private and this method does not check if the directory exists.

type DirectoryProperties

DirectoryProperties contains various properties of a directory.

type DirectoryProperties struct {
    LastModified string `xml:"Last-Modified"`
    Etag         string `xml:"Etag"`
}

type DirsAndFilesListResponse

DirsAndFilesListResponse contains the response fields from a List Files and Directories call.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/List-Directories-and-Files

type DirsAndFilesListResponse struct {
    XMLName     xml.Name    `xml:"EnumerationResults"`
    Xmlns       string      `xml:"xmlns,attr"`
    Marker      string      `xml:"Marker"`
    MaxResults  int64       `xml:"MaxResults"`
    Directories []Directory `xml:"Entries>Directory"`
    Files       []File      `xml:"Entries>File"`
    NextMarker  string      `xml:"NextMarker"`
}

type Entity

Entity represents an entity inside an Azure table.

type Entity struct {
    Table         *Table
    PartitionKey  string
    RowKey        string
    TimeStamp     time.Time
    OdataMetadata string
    OdataType     string
    OdataID       string
    OdataEtag     string
    OdataEditLink string
    Properties    map[string]interface{}
}

func (*Entity) Delete

func (e *Entity) Delete(force bool, options *EntityOptions) error

Delete deletes the entity. The function fails if there is no entity with the same PartitionKey and RowKey in the table or if the ETag is different than the one in Azure. See: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/delete-entity1

func (*Entity) Get

func (e *Entity) Get(timeout uint, ml MetadataLevel, options *GetEntityOptions) error

Get gets the referenced entity. Which properties to get can be specified using the select option. See: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/query-entities https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/querying-tables-and-entities

func (*Entity) Insert

func (e *Entity) Insert(ml MetadataLevel, options *EntityOptions) error

Insert inserts the referenced entity in its table. The function fails if there is an entity with the same PartitionKey and RowKey in the table. ml determines the level of detail of metadata in the operation response, or no data at all. See: https://docs.microsoft.com/rest/api/storageservices/fileservices/insert-entity

func (*Entity) InsertOrMerge

func (e *Entity) InsertOrMerge(options *EntityOptions) error

InsertOrMerge inserts an entity or merges the existing one. Read more: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/insert-or-merge-entity

func (*Entity) InsertOrReplace

func (e *Entity) InsertOrReplace(options *EntityOptions) error

InsertOrReplace inserts an entity or replaces the existing one. Read more: https://docs.microsoft.com/rest/api/storageservices/fileservices/insert-or-replace-entity

func (*Entity) MarshalJSON

func (e *Entity) MarshalJSON() ([]byte, error)

MarshalJSON is a custom marshaller for entity

func (*Entity) Merge

func (e *Entity) Merge(force bool, options *EntityOptions) error

Merge merges the contents of entity specified with PartitionKey and RowKey with the content specified in Properties. The function fails if there is no entity with the same PartitionKey and RowKey in the table or if the ETag is different than the one in Azure. Read more: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/merge-entity

func (*Entity) UnmarshalJSON

func (e *Entity) UnmarshalJSON(data []byte) error

UnmarshalJSON is a custom unmarshaller for entities

func (*Entity) Update

func (e *Entity) Update(force bool, options *EntityOptions) error

Update updates the contents of an entity. The function fails if there is no entity with the same PartitionKey and RowKey in the table or if the ETag is different than the one in Azure. See: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/update-entity2

type EntityOptions

EntityOptions includes options for entity operations.

type EntityOptions struct {
    Timeout   uint
    RequestID string `header:"x-ms-client-request-id"`
}

type EntityQueryResult

EntityQueryResult contains the response from ExecuteQuery and ExecuteQueryNextResults functions.

type EntityQueryResult struct {
    OdataMetadata string    `json:"odata.metadata"`
    Entities      []*Entity `json:"value"`
    QueryNextLink
    // contains filtered or unexported fields
}

func (*EntityQueryResult) NextResults

func (eqr *EntityQueryResult) NextResults(options *TableOptions) (*EntityQueryResult, error)

NextResults returns the next page of results from a QueryEntities or NextResults operation.

See: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/query-entities See https://docs.microsoft.com/rest/api/storageservices/fileservices/query-timeout-and-pagination

type File

File represents a file on a share.

type File struct {
    Metadata map[string]string
    Name     string `xml:"Name"`

    Properties FileProperties `xml:"Properties"`

    FileCopyProperties FileCopyState
    // contains filtered or unexported fields
}

func (*File) ClearRange

func (f *File) ClearRange(fileRange FileRange, options *FileRequestOptions) error

ClearRange releases the specified range of space in a file.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Put-Range

func (*File) CopyFile

func (f *File) CopyFile(sourceURL string, options *FileRequestOptions) error

CopyFile operation copied a file/blob from the sourceURL to the path provided.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/copy-file

func (*File) Create

func (f *File) Create(maxSize uint64, options *FileRequestOptions) error

Create creates a new file or replaces an existing one.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Create-File

func (*File) Delete

func (f *File) Delete(options *FileRequestOptions) error

Delete immediately removes this file from the storage account.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Delete-File2

func (*File) DeleteIfExists

func (f *File) DeleteIfExists(options *FileRequestOptions) (bool, error)

DeleteIfExists removes this file if it exists.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Delete-File2

func (*File) DownloadRangeToStream

func (f *File) DownloadRangeToStream(fileRange FileRange, options *GetFileOptions) (fs FileStream, err error)

DownloadRangeToStream operation downloads the specified range of this file with optional MD5 hash.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/get-file

func (*File) DownloadToStream

func (f *File) DownloadToStream(options *FileRequestOptions) (io.ReadCloser, error)

DownloadToStream operation downloads the file.

See: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/get-file

func (*File) Exists

func (f *File) Exists() (bool, error)

Exists returns true if this file exists.

func (*File) FetchAttributes

func (f *File) FetchAttributes(options *FileRequestOptions) error

FetchAttributes updates metadata and properties for this file. See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/get-file-properties

func (*File) ListRanges

func (f *File) ListRanges(options *ListRangesOptions) (*FileRanges, error)

ListRanges returns the list of valid ranges for this file.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/List-Ranges

func (*File) SetMetadata

func (f *File) SetMetadata(options *FileRequestOptions) error

SetMetadata replaces the metadata for this file.

Some keys may be converted to Camel-Case before sending. All keys are returned in lower case by GetFileMetadata. HTTP header names are case-insensitive so case munging should not matter to other applications either.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Set-File-Metadata

func (*File) SetProperties

func (f *File) SetProperties(options *FileRequestOptions) error

SetProperties sets system properties on this file.

Some keys may be converted to Camel-Case before sending. All keys are returned in lower case by SetFileProperties. HTTP header names are case-insensitive so case munging should not matter to other applications either.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Set-File-Properties

func (*File) URL

func (f *File) URL() string

URL gets the canonical URL to this file. This method does not create a publicly accessible URL if the file is private and this method does not check if the file exists.

func (*File) WriteRange

func (f *File) WriteRange(bytes io.Reader, fileRange FileRange, options *WriteRangeOptions) error

WriteRange writes a range of bytes to this file with an optional MD5 hash of the content (inside options parameter). Note that the length of bytes must match (rangeEnd - rangeStart) + 1 with a maximum size of 4MB.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Put-Range

type FileCopyState

FileCopyState contains various properties of a file copy operation.

type FileCopyState struct {
    CompletionTime string
    ID             string `header:"x-ms-copy-id"`
    Progress       string
    Source         string
    Status         string `header:"x-ms-copy-status"`
    StatusDesc     string
}

type FileProperties

FileProperties contains various properties of a file.

type FileProperties struct {
    CacheControl string `header:"x-ms-cache-control"`
    Disposition  string `header:"x-ms-content-disposition"`
    Encoding     string `header:"x-ms-content-encoding"`
    Etag         string
    Language     string `header:"x-ms-content-language"`
    LastModified string
    Length       uint64 `xml:"Content-Length" header:"x-ms-content-length"`
    MD5          string `header:"x-ms-content-md5"`
    Type         string `header:"x-ms-content-type"`
}

type FileRange

FileRange contains range information for a file.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/List-Ranges

type FileRange struct {
    Start uint64 `xml:"Start"`
    End   uint64 `xml:"End"`
}

func (FileRange) String

func (fr FileRange) String() string

type FileRanges

FileRanges contains a list of file range information for a file.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/List-Ranges

type FileRanges struct {
    ContentLength uint64
    LastModified  string
    ETag          string
    FileRanges    []FileRange `xml:"Range"`
}

type FileRequestOptions

FileRequestOptions will be passed to misc file operations. Currently just Timeout (in seconds) but could expand.

type FileRequestOptions struct {
    Timeout uint // timeout duration in seconds.
}

type FileServiceClient

FileServiceClient contains operations for Microsoft Azure File Service.

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

func (*FileServiceClient) GetServiceProperties

func (f *FileServiceClient) GetServiceProperties() (*ServiceProperties, error)

GetServiceProperties gets the properties of your storage account's file service. File service does not support logging See: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/get-file-service-properties

func (*FileServiceClient) GetShareReference

func (f *FileServiceClient) GetShareReference(name string) *Share

GetShareReference returns a Share object for the specified share name.

func (FileServiceClient) ListShares

func (f FileServiceClient) ListShares(params ListSharesParameters) (*ShareListResponse, error)

ListShares returns the list of shares in a storage account along with pagination token and other response details.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/list-shares

func (*FileServiceClient) SetServiceProperties

func (f *FileServiceClient) SetServiceProperties(props ServiceProperties) error

SetServiceProperties sets the properties of your storage account's file service. File service does not support logging See: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/set-file-service-properties

type FileStream

FileStream contains file data returned from a call to GetFile.

type FileStream struct {
    Body       io.ReadCloser
    ContentMD5 string
}

type GetBlobMetadataOptions

GetBlobMetadataOptions includes the options for a get blob metadata operation

type GetBlobMetadataOptions struct {
    Timeout           uint
    Snapshot          *time.Time
    LeaseID           string     `header:"x-ms-lease-id"`
    IfModifiedSince   *time.Time `header:"If-Modified-Since"`
    IfUnmodifiedSince *time.Time `header:"If-Unmodified-Since"`
    IfMatch           string     `header:"If-Match"`
    IfNoneMatch       string     `header:"If-None-Match"`
    RequestID         string     `header:"x-ms-client-request-id"`
}

type GetBlobOptions

GetBlobOptions includes the options for a get blob operation

type GetBlobOptions struct {
    Timeout           uint
    Snapshot          *time.Time
    LeaseID           string     `header:"x-ms-lease-id"`
    Origin            string     `header:"Origin"`
    IfModifiedSince   *time.Time `header:"If-Modified-Since"`
    IfUnmodifiedSince *time.Time `header:"If-Unmodified-Since"`
    IfMatch           string     `header:"If-Match"`
    IfNoneMatch       string     `header:"If-None-Match"`
    RequestID         string     `header:"x-ms-client-request-id"`
}

type GetBlobPropertiesOptions

GetBlobPropertiesOptions includes the options for a get blob properties operation

type GetBlobPropertiesOptions struct {
    Timeout           uint
    Snapshot          *time.Time
    LeaseID           string     `header:"x-ms-lease-id"`
    IfModifiedSince   *time.Time `header:"If-Modified-Since"`
    IfUnmodifiedSince *time.Time `header:"If-Unmodified-Since"`
    IfMatch           string     `header:"If-Match"`
    IfNoneMatch       string     `header:"If-None-Match"`
    RequestID         string     `header:"x-ms-client-request-id"`
}

type GetBlobRangeOptions

GetBlobRangeOptions includes the options for a get blob range operation

type GetBlobRangeOptions struct {
    Range              *BlobRange
    GetRangeContentMD5 bool
    *GetBlobOptions
}

type GetBlockListOptions

GetBlockListOptions includes the options for a get block list operation

type GetBlockListOptions struct {
    Timeout   uint
    Snapshot  *time.Time
    LeaseID   string `header:"x-ms-lease-id"`
    RequestID string `header:"x-ms-client-request-id"`
}

type GetContainerPermissionOptions

GetContainerPermissionOptions includes options for a get container permissions operation

type GetContainerPermissionOptions struct {
    Timeout   uint
    LeaseID   string `header:"x-ms-lease-id"`
    RequestID string `header:"x-ms-client-request-id"`
}

type GetEntityOptions

GetEntityOptions includes options for a get entity operation

type GetEntityOptions struct {
    Select    []string
    RequestID string `header:"x-ms-client-request-id"`
}

type GetFileOptions

GetFileOptions includes options for a get file operation

type GetFileOptions struct {
    Timeout       uint
    GetContentMD5 bool
}

type GetMessagesOptions

GetMessagesOptions is the set of options can be specified for Get Messsages operation. A zero struct does not use any preferences for the request.

type GetMessagesOptions struct {
    Timeout           uint
    NumOfMessages     int
    VisibilityTimeout int
    RequestID         string `header:"x-ms-client-request-id"`
}

type GetPageRangesOptions

GetPageRangesOptions includes the options for a get page ranges operation

type GetPageRangesOptions struct {
    Timeout          uint
    Snapshot         *time.Time
    PreviousSnapshot *time.Time
    Range            *BlobRange
    LeaseID          string `header:"x-ms-lease-id"`
    RequestID        string `header:"x-ms-client-request-id"`
}

type GetPageRangesResponse

GetPageRangesResponse contains the response fields from Get Page Ranges call.

See https://msdn.microsoft.com/en-us/library/azure/ee691973.aspx

type GetPageRangesResponse struct {
    XMLName  xml.Name    `xml:"PageList"`
    PageList []PageRange `xml:"PageRange"`
}

type GetQueuePermissionOptions

GetQueuePermissionOptions includes options for a get queue permissions operation

type GetQueuePermissionOptions struct {
    Timeout   uint
    RequestID string `header:"x-ms-client-request-id"`
}

type IncludeBlobDataset

IncludeBlobDataset has options to include in a list blobs operation

type IncludeBlobDataset struct {
    Snapshots        bool
    Metadata         bool
    UncommittedBlobs bool
    Copy             bool
}

type IncrementalCopyOptions

IncrementalCopyOptions includes the options for an incremental copy blob operation

type IncrementalCopyOptions struct {
    Timeout     uint
    Destination IncrementalCopyOptionsConditions
    RequestID   string
}

type IncrementalCopyOptionsConditions

IncrementalCopyOptionsConditions includes some conditional options in a copy blob operation

type IncrementalCopyOptionsConditions struct {
    IfModifiedSince   *time.Time
    IfUnmodifiedSince *time.Time
    IfMatch           string
    IfNoneMatch       string
}

type LeaseOptions

LeaseOptions includes options for all operations regarding leasing blobs

type LeaseOptions struct {
    Timeout           uint
    Origin            string     `header:"Origin"`
    IfMatch           string     `header:"If-Match"`
    IfNoneMatch       string     `header:"If-None-Match"`
    IfModifiedSince   *time.Time `header:"If-Modified-Since"`
    IfUnmodifiedSince *time.Time `header:"If-Unmodified-Since"`
    RequestID         string     `header:"x-ms-client-request-id"`
}

type ListBlobsParameters

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 ListBlobsParameters struct {
    Prefix     string
    Delimiter  string
    Marker     string
    Include    *IncludeBlobDataset
    MaxResults uint
    Timeout    uint
    RequestID  string
}

type ListContainersParameters

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 ListContainersParameters struct {
    Prefix     string
    Marker     string
    Include    string
    MaxResults uint
    Timeout    uint
}

type ListDirsAndFilesParameters

ListDirsAndFilesParameters defines the set of customizable parameters to make a List Files and Directories call.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/List-Directories-and-Files

type ListDirsAndFilesParameters struct {
    Prefix     string
    Marker     string
    MaxResults uint
    Timeout    uint
}

type ListRangesOptions

ListRangesOptions includes options for a list file ranges operation

type ListRangesOptions struct {
    Timeout   uint
    ListRange *FileRange
}

type ListSharesParameters

ListSharesParameters defines the set of customizable parameters to make a List Shares call.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/List-Shares

type ListSharesParameters struct {
    Prefix     string
    Marker     string
    Include    string
    MaxResults uint
    Timeout    uint
}

type Logging

Logging represents the Azure Analytics Logging settings

type Logging struct {
    Version         string
    Delete          bool
    Read            bool
    Write           bool
    RetentionPolicy *RetentionPolicy
}

type Message

Message represents an Azure message.

type Message struct {
    Queue        *Queue
    Text         string      `xml:"MessageText"`
    ID           string      `xml:"MessageId"`
    Insertion    TimeRFC1123 `xml:"InsertionTime"`
    Expiration   TimeRFC1123 `xml:"ExpirationTime"`
    PopReceipt   string      `xml:"PopReceipt"`
    NextVisible  TimeRFC1123 `xml:"TimeNextVisible"`
    DequeueCount int         `xml:"DequeueCount"`
}

func (*Message) Delete

func (m *Message) Delete(options *QueueServiceOptions) error

Delete operation deletes the specified message.

See https://msdn.microsoft.com/en-us/library/azure/dd179347.aspx

func (*Message) Put

func (m *Message) Put(options *PutMessageOptions) error

Put operation adds a new message to the back of the message queue.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Put-Message

func (*Message) Update

func (m *Message) Update(options *UpdateMessageOptions) error

Update operation updates the specified message.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Update-Message

type MetadataLevel

MetadataLevel determines if operations should return a paylod, and it level of detail.

type MetadataLevel string

type Metrics

Metrics provide request statistics.

type Metrics struct {
    Version         string
    Enabled         bool
    IncludeAPIs     *bool
    RetentionPolicy *RetentionPolicy
}

type Operation

Operation type. Insert, Delete, Replace etc.

type Operation int

type OverrideHeaders

OverrideHeaders defines overridable response heaedrs in a request using a SAS URI. See https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas

type OverrideHeaders struct {
    CacheControl       string
    ContentDisposition string
    ContentEncoding    string
    ContentLanguage    string
    ContentType        string
}

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 PageRange struct {
    Start int64 `xml:"Start"`
    End   int64 `xml:"End"`
}

type PeekMessagesOptions

PeekMessagesOptions is the set of options can be specified for Peek Messsage operation. A zero struct does not use any preferences for the request.

type PeekMessagesOptions struct {
    Timeout       uint
    NumOfMessages int
    RequestID     string `header:"x-ms-client-request-id"`
}

type Permissions

Permissions specifies permissions for an accountSAS.

type Permissions struct {
    Read    bool
    Write   bool
    Delete  bool
    List    bool
    Add     bool
    Create  bool
    Update  bool
    Process bool
}

type PutBlobOptions

PutBlobOptions includes the options any put blob operation (page, block, append)

type PutBlobOptions struct {
    Timeout           uint
    LeaseID           string     `header:"x-ms-lease-id"`
    Origin            string     `header:"Origin"`
    IfModifiedSince   *time.Time `header:"If-Modified-Since"`
    IfUnmodifiedSince *time.Time `header:"If-Unmodified-Since"`
    IfMatch           string     `header:"If-Match"`
    IfNoneMatch       string     `header:"If-None-Match"`
    RequestID         string     `header:"x-ms-client-request-id"`
}

type PutBlockFromURLOptions

PutBlockFromURLOptions includes the options for a put block from URL operation

type PutBlockFromURLOptions struct {
    PutBlockOptions

    SourceContentMD5   string `header:"x-ms-source-content-md5"`
    SourceContentCRC64 string `header:"x-ms-source-content-crc64"`
}

type PutBlockListOptions

PutBlockListOptions includes the options for a put block list operation

type PutBlockListOptions struct {
    Timeout           uint
    LeaseID           string     `header:"x-ms-lease-id"`
    IfModifiedSince   *time.Time `header:"If-Modified-Since"`
    IfUnmodifiedSince *time.Time `header:"If-Unmodified-Since"`
    IfMatch           string     `header:"If-Match"`
    IfNoneMatch       string     `header:"If-None-Match"`
    RequestID         string     `header:"x-ms-client-request-id"`
}

type PutBlockOptions

PutBlockOptions includes the options for a put block operation

type PutBlockOptions struct {
    Timeout    uint
    LeaseID    string `header:"x-ms-lease-id"`
    ContentMD5 string `header:"Content-MD5"`
    RequestID  string `header:"x-ms-client-request-id"`
}

type PutMessageOptions

PutMessageOptions is the set of options can be specified for Put Messsage operation. A zero struct does not use any preferences for the request.

type PutMessageOptions struct {
    Timeout           uint
    VisibilityTimeout int
    MessageTTL        int
    RequestID         string `header:"x-ms-client-request-id"`
}

type PutPageOptions

PutPageOptions includes the options for a put page operation

type PutPageOptions struct {
    Timeout                           uint
    LeaseID                           string     `header:"x-ms-lease-id"`
    IfSequenceNumberLessThanOrEqualTo *int       `header:"x-ms-if-sequence-number-le"`
    IfSequenceNumberLessThan          *int       `header:"x-ms-if-sequence-number-lt"`
    IfSequenceNumberEqualTo           *int       `header:"x-ms-if-sequence-number-eq"`
    IfModifiedSince                   *time.Time `header:"If-Modified-Since"`
    IfUnmodifiedSince                 *time.Time `header:"If-Unmodified-Since"`
    IfMatch                           string     `header:"If-Match"`
    IfNoneMatch                       string     `header:"If-None-Match"`
    RequestID                         string     `header:"x-ms-client-request-id"`
}

QueryNextLink includes information for getting the next page of results in query operations

type QueryNextLink struct {
    NextLink *string
    // contains filtered or unexported fields
}

type QueryOptions

QueryOptions includes options for a query entities operation. Top, filter and select are OData query options.

type QueryOptions struct {
    Top       uint
    Filter    string
    Select    []string
    RequestID string
}

type QueryTablesOptions

QueryTablesOptions includes options for some table operations

type QueryTablesOptions struct {
    Top       uint
    Filter    string
    RequestID string
}

type Queue

Queue represents an Azure queue.

type Queue struct {
    Name              string
    Metadata          map[string]string
    AproxMessageCount uint64
    // contains filtered or unexported fields
}

func (*Queue) ClearMessages

func (q *Queue) ClearMessages(options *QueueServiceOptions) error

ClearMessages operation deletes all messages from the specified queue.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Clear-Messages

func (*Queue) Create

func (q *Queue) Create(options *QueueServiceOptions) error

Create operation creates a queue under the given account.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Create-Queue4

func (*Queue) Delete

func (q *Queue) Delete(options *QueueServiceOptions) error

Delete operation permanently deletes the specified queue.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Delete-Queue3

func (*Queue) Exists

func (q *Queue) Exists() (bool, error)

Exists returns true if a queue with given name exists.

func (*Queue) GetMessageReference

func (q *Queue) GetMessageReference(text string) *Message

GetMessageReference returns a message object with the specified text.

func (*Queue) GetMessages

func (q *Queue) GetMessages(options *GetMessagesOptions) ([]Message, error)

GetMessages operation retrieves one or more messages from the front of the queue.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Get-Messages

func (*Queue) GetMetadata

func (q *Queue) GetMetadata(options *QueueServiceOptions) 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://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Set-Queue-Metadata

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 (*Queue) GetPermissions

func (q *Queue) GetPermissions(options *GetQueuePermissionOptions) (*QueuePermissions, error)

GetPermissions gets the queue permissions as per https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/get-queue-acl If timeout is 0 then it will not be passed to Azure

func (*Queue) GetSASURI

func (q *Queue) GetSASURI(options QueueSASOptions) (string, error)

GetSASURI creates an URL to the specified queue which contains the Shared Access Signature with specified permissions and expiration time.

See https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas

func (*Queue) PeekMessages

func (q *Queue) PeekMessages(options *PeekMessagesOptions) ([]Message, error)

PeekMessages retrieves one or more messages from the front of the queue, but does not alter the visibility of the message.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Peek-Messages

func (*Queue) SetMetadata

func (q *Queue) SetMetadata(options *QueueServiceOptions) error

SetMetadata operation sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Set-Queue-Metadata

func (*Queue) SetPermissions

func (q *Queue) SetPermissions(permissions QueuePermissions, options *SetQueuePermissionOptions) error

SetPermissions sets up queue permissions See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/set-queue-acl

type QueueAccessPolicy

QueueAccessPolicy represents each access policy in the queue ACL.

type QueueAccessPolicy struct {
    ID         string
    StartTime  time.Time
    ExpiryTime time.Time
    CanRead    bool
    CanAdd     bool
    CanUpdate  bool
    CanProcess bool
}

type QueuePermissions

QueuePermissions represents the queue ACLs.

type QueuePermissions struct {
    AccessPolicies []QueueAccessPolicy
}

type QueueSASOptions

QueueSASOptions are options to construct a blob SAS URI. See https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas

type QueueSASOptions struct {
    QueueSASPermissions
    SASOptions
}

type QueueSASPermissions

QueueSASPermissions includes the available permissions for a queue SAS URI.

type QueueSASPermissions struct {
    Read    bool
    Add     bool
    Update  bool
    Process bool
}

type QueueServiceClient

QueueServiceClient contains operations for Microsoft Azure Queue Storage Service.

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

func (*QueueServiceClient) GetQueueReference

func (q *QueueServiceClient) GetQueueReference(name string) *Queue

GetQueueReference returns a Container object for the specified queue name.

func (*QueueServiceClient) GetServiceProperties

func (q *QueueServiceClient) GetServiceProperties() (*ServiceProperties, error)

GetServiceProperties gets the properties of your storage account's queue service. See: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/get-queue-service-properties

func (*QueueServiceClient) SetServiceProperties

func (q *QueueServiceClient) SetServiceProperties(props ServiceProperties) error

SetServiceProperties sets the properties of your storage account's queue service. See: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/set-queue-service-properties

type QueueServiceOptions

QueueServiceOptions includes options for some queue service operations

type QueueServiceOptions struct {
    Timeout   uint
    RequestID string `header:"x-ms-client-request-id"`
}

type ResourceTypes

ResourceTypes specify the resources accesible with an account SAS.

type ResourceTypes struct {
    Service   bool
    Container bool
    Object    bool
}

type RetentionPolicy

RetentionPolicy indicates if retention is enabled and for how many days

type RetentionPolicy struct {
    Enabled bool
    Days    *int
}

type SASOptions

SASOptions includes options used by SAS URIs for different services and resources.

type SASOptions struct {
    APIVersion string
    Start      time.Time
    Expiry     time.Time
    IP         string
    UseHTTPS   bool
    Identifier string
}

type Sender

Sender sends a request

type Sender interface {
    Send(*Client, *http.Request) (*http.Response, error)
}

type SequenceNumberAction

SequenceNumberAction defines how the blob's sequence number should be modified

type SequenceNumberAction string

Options for sequence number action

const (
    SequenceNumberActionMax       SequenceNumberAction = "max"
    SequenceNumberActionUpdate    SequenceNumberAction = "update"
    SequenceNumberActionIncrement SequenceNumberAction = "increment"
)

type ServiceProperties

ServiceProperties represents the storage account service properties

type ServiceProperties struct {
    Logging               *Logging
    HourMetrics           *Metrics
    MinuteMetrics         *Metrics
    Cors                  *Cors
    DeleteRetentionPolicy *RetentionPolicy // blob storage only
    StaticWebsite         *StaticWebsite   // blob storage only
}

type Services

Services specify services accessible with an account SAS.

type Services struct {
    Blob  bool
    Queue bool
    Table bool
    File  bool
}

type SetBlobMetadataOptions

SetBlobMetadataOptions includes the options for a set blob metadata operation

type SetBlobMetadataOptions struct {
    Timeout           uint
    LeaseID           string     `header:"x-ms-lease-id"`
    IfModifiedSince   *time.Time `header:"If-Modified-Since"`
    IfUnmodifiedSince *time.Time `header:"If-Unmodified-Since"`
    IfMatch           string     `header:"If-Match"`
    IfNoneMatch       string     `header:"If-None-Match"`
    RequestID         string     `header:"x-ms-client-request-id"`
}

type SetBlobPropertiesOptions

SetBlobPropertiesOptions contains various properties of a blob and is an entry in SetProperties

type SetBlobPropertiesOptions struct {
    Timeout              uint
    LeaseID              string     `header:"x-ms-lease-id"`
    Origin               string     `header:"Origin"`
    IfModifiedSince      *time.Time `header:"If-Modified-Since"`
    IfUnmodifiedSince    *time.Time `header:"If-Unmodified-Since"`
    IfMatch              string     `header:"If-Match"`
    IfNoneMatch          string     `header:"If-None-Match"`
    SequenceNumberAction *SequenceNumberAction
    RequestID            string `header:"x-ms-client-request-id"`
}

type SetContainerPermissionOptions

SetContainerPermissionOptions includes options for a set container permissions operation

type SetContainerPermissionOptions struct {
    Timeout           uint
    LeaseID           string     `header:"x-ms-lease-id"`
    IfModifiedSince   *time.Time `header:"If-Modified-Since"`
    IfUnmodifiedSince *time.Time `header:"If-Unmodified-Since"`
    RequestID         string     `header:"x-ms-client-request-id"`
}

type SetQueuePermissionOptions

SetQueuePermissionOptions includes options for a set queue permissions operation

type SetQueuePermissionOptions struct {
    Timeout   uint
    RequestID string `header:"x-ms-client-request-id"`
}

type Share

Share represents an Azure file share.

type Share struct {
    Name       string          `xml:"Name"`
    Properties ShareProperties `xml:"Properties"`
    Metadata   map[string]string
    // contains filtered or unexported fields
}

func (*Share) Create

func (s *Share) Create(options *FileRequestOptions) error

Create this share under the associated account. If a share with the same name already exists, the operation fails.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Create-Share

func (*Share) CreateIfNotExists

func (s *Share) CreateIfNotExists(options *FileRequestOptions) (bool, error)

CreateIfNotExists creates this share under the associated account if it does not exist. Returns true if the share is newly created or false if the share already exists.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Create-Share

func (*Share) Delete

func (s *Share) Delete(options *FileRequestOptions) error

Delete marks this share for deletion. The share along with any files and directories contained within it are later deleted during garbage collection. If the share does not exist the operation fails

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Delete-Share

func (*Share) DeleteIfExists

func (s *Share) DeleteIfExists(options *FileRequestOptions) (bool, error)

DeleteIfExists operation marks this share for deletion if it exists.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Delete-Share

func (*Share) Exists

func (s *Share) Exists() (bool, error)

Exists returns true if this share already exists on the storage account, otherwise returns false.

func (*Share) FetchAttributes

func (s *Share) FetchAttributes(options *FileRequestOptions) error

FetchAttributes retrieves metadata and properties for this share. See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/get-share-properties

func (*Share) GetRootDirectoryReference

func (s *Share) GetRootDirectoryReference() *Directory

GetRootDirectoryReference returns a Directory object at the root of this share.

func (*Share) ServiceClient

func (s *Share) ServiceClient() *FileServiceClient

ServiceClient returns the FileServiceClient associated with this share.

func (*Share) SetMetadata

func (s *Share) SetMetadata(options *FileRequestOptions) error

SetMetadata replaces the metadata for this share.

Some keys may be converted to Camel-Case before sending. All keys are returned in lower case by GetShareMetadata. HTTP header names are case-insensitive so case munging should not matter to other applications either.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/set-share-metadata

func (*Share) SetProperties

func (s *Share) SetProperties(options *FileRequestOptions) error

SetProperties sets system properties for this share.

Some keys may be converted to Camel-Case before sending. All keys are returned in lower case by SetShareProperties. HTTP header names are case-insensitive so case munging should not matter to other applications either.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Set-Share-Properties

func (*Share) URL

func (s *Share) URL() string

URL gets the canonical URL to this share. This method does not create a publicly accessible URL if the share is private and this method does not check if the share exists.

type ShareListResponse

ShareListResponse contains the response fields from ListShares call.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/List-Shares

type ShareListResponse 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"`
    Shares     []Share  `xml:"Shares>Share"`
}

type ShareProperties

ShareProperties contains various properties of a share.

type ShareProperties struct {
    LastModified string `xml:"Last-Modified"`
    Etag         string `xml:"Etag"`
    Quota        int    `xml:"Quota"`
}

type SignedIdentifier

SignedIdentifier is a wrapper for a specific policy

type SignedIdentifier struct {
    ID           string                 `xml:"Id"`
    AccessPolicy AccessPolicyDetailsXML `xml:"AccessPolicy"`
}

type SignedIdentifiers

SignedIdentifiers part of the response from GetPermissions call.

type SignedIdentifiers struct {
    SignedIdentifiers []SignedIdentifier `xml:"SignedIdentifier"`
}

type SnapshotOptions

SnapshotOptions includes the options for a snapshot blob operation

type SnapshotOptions struct {
    Timeout           uint
    LeaseID           string     `header:"x-ms-lease-id"`
    IfModifiedSince   *time.Time `header:"If-Modified-Since"`
    IfUnmodifiedSince *time.Time `header:"If-Unmodified-Since"`
    IfMatch           string     `header:"If-Match"`
    IfNoneMatch       string     `header:"If-None-Match"`
    RequestID         string     `header:"x-ms-client-request-id"`
}

type StaticWebsite

StaticWebsite - The properties that enable an account to host a static website

type StaticWebsite struct {
    // Enabled - Indicates whether this account is hosting a static website
    Enabled bool
    // IndexDocument - The default name of the index page under each directory
    IndexDocument *string
    // ErrorDocument404Path - The absolute path of the custom 404 page
    ErrorDocument404Path *string
}

type Table

Table represents an Azure table.

type Table struct {
    Name          string `json:"TableName"`
    OdataEditLink string `json:"odata.editLink"`
    OdataID       string `json:"odata.id"`
    OdataMetadata string `json:"odata.metadata"`
    OdataType     string `json:"odata.type"`
    // contains filtered or unexported fields
}

func (*Table) Create

func (t *Table) Create(timeout uint, ml MetadataLevel, options *TableOptions) error

Create creates the referenced table. This function fails if the name is not compliant with the specification or the tables already exists. ml determines the level of detail of metadata in the operation response, or no data at all. See https://docs.microsoft.com/rest/api/storageservices/fileservices/create-table

func (*Table) Delete

func (t *Table) Delete(timeout uint, options *TableOptions) error

Delete deletes the referenced table. This function fails if the table is not present. Be advised: Delete deletes all the entries that may be present. See https://docs.microsoft.com/rest/api/storageservices/fileservices/delete-table

func (*Table) Get

func (t *Table) Get(timeout uint, ml MetadataLevel) error

Get gets the referenced table. See: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/querying-tables-and-entities

func (*Table) GetEntityReference

func (t *Table) GetEntityReference(partitionKey, rowKey string) *Entity

GetEntityReference returns an Entity object with the specified partition key and row key.

func (*Table) GetPermissions

func (t *Table) GetPermissions(timeout int, options *TableOptions) ([]TableAccessPolicy, error)

GetPermissions gets the table ACL permissions See https://docs.microsoft.com/rest/api/storageservices/fileservices/get-table-acl

func (*Table) NewBatch

func (t *Table) NewBatch() *TableBatch

NewBatch return new TableBatch for populating.

func (*Table) QueryEntities

func (t *Table) QueryEntities(timeout uint, ml MetadataLevel, options *QueryOptions) (*EntityQueryResult, error)

QueryEntities returns the entities in the table. You can use query options defined by the OData Protocol specification.

See: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/query-entities

func (*Table) SetPermissions

func (t *Table) SetPermissions(tap []TableAccessPolicy, timeout uint, options *TableOptions) error

SetPermissions sets up table ACL permissions See https://docs.microsoft.com/rest/api/storageservices/fileservices/Set-Table-ACL

type TableAccessPolicy

TableAccessPolicy are used for SETTING table policies

type TableAccessPolicy struct {
    ID         string
    StartTime  time.Time
    ExpiryTime time.Time
    CanRead    bool
    CanAppend  bool
    CanUpdate  bool
    CanDelete  bool
}

type TableBatch

TableBatch stores all the entities that will be operated on during a batch process. Entities can be inserted, replaced or deleted.

type TableBatch struct {
    BatchEntitySlice []BatchEntity

    // reference to table we're operating on.
    Table *Table
}

func (*TableBatch) DeleteEntity

func (t *TableBatch) DeleteEntity(entity *Entity, force bool)

DeleteEntity adds an entity in preparation for a batch delete

func (*TableBatch) DeleteEntityByForce

func (t *TableBatch) DeleteEntityByForce(entity *Entity, force bool)

DeleteEntityByForce adds an entity in preparation for a batch delete. Forces regardless of ETag

func (*TableBatch) ExecuteBatch

func (t *TableBatch) ExecuteBatch() error

ExecuteBatch executes many table operations in one request to Azure. The operations can be combinations of Insert, Delete, Replace and Merge Creates the inner changeset body (various operations, Insert, Delete etc) then creates the outer request packet that encompasses the changesets. As per document https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/performing-entity-group-transactions

func (*TableBatch) InsertEntity

func (t *TableBatch) InsertEntity(entity *Entity)

InsertEntity adds an entity in preparation for a batch insert.

func (*TableBatch) InsertOrMergeEntity

func (t *TableBatch) InsertOrMergeEntity(entity *Entity, force bool)

InsertOrMergeEntity adds an entity in preparation for a batch insert or merge.

func (*TableBatch) InsertOrMergeEntityByForce

func (t *TableBatch) InsertOrMergeEntityByForce(entity *Entity)

InsertOrMergeEntityByForce adds an entity in preparation for a batch insert or merge. Forces regardless of ETag

func (*TableBatch) InsertOrReplaceEntity

func (t *TableBatch) InsertOrReplaceEntity(entity *Entity, force bool)

InsertOrReplaceEntity adds an entity in preparation for a batch insert or replace.

func (*TableBatch) InsertOrReplaceEntityByForce

func (t *TableBatch) InsertOrReplaceEntityByForce(entity *Entity)

InsertOrReplaceEntityByForce adds an entity in preparation for a batch insert or replace. Forces regardless of ETag

func (*TableBatch) MergeEntity

func (t *TableBatch) MergeEntity(entity *Entity)

MergeEntity adds an entity in preparation for a batch merge

func (*TableBatch) ReplaceEntity

func (t *TableBatch) ReplaceEntity(entity *Entity)

ReplaceEntity adds an entity in preparation for a batch replace.

type TableOptions

TableOptions includes options for some table operations

type TableOptions struct {
    RequestID string
}

type TableQueryResult

TableQueryResult contains the response from QueryTables and QueryTablesNextResults functions.

type TableQueryResult struct {
    OdataMetadata string  `json:"odata.metadata"`
    Tables        []Table `json:"value"`
    QueryNextLink
    // contains filtered or unexported fields
}

func (*TableQueryResult) NextResults

func (tqr *TableQueryResult) NextResults(options *TableOptions) (*TableQueryResult, error)

NextResults returns the next page of results from a QueryTables or a NextResults operation.

See https://docs.microsoft.com/rest/api/storageservices/fileservices/query-tables See https://docs.microsoft.com/rest/api/storageservices/fileservices/query-timeout-and-pagination

type TableServiceClient

TableServiceClient contains operations for Microsoft Azure Table Storage Service.

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

func (*TableServiceClient) GetServiceProperties

func (t *TableServiceClient) GetServiceProperties() (*ServiceProperties, error)

GetServiceProperties gets the properties of your storage account's table service. See: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/get-table-service-properties

func (*TableServiceClient) GetTableReference

func (t *TableServiceClient) GetTableReference(name string) *Table

GetTableReference returns a Table object for the specified table name.

func (*TableServiceClient) QueryTables

func (t *TableServiceClient) QueryTables(ml MetadataLevel, options *QueryTablesOptions) (*TableQueryResult, error)

QueryTables returns the tables in the storage account. You can use query options defined by the OData Protocol specification.

See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/query-tables

func (*TableServiceClient) SetServiceProperties

func (t *TableServiceClient) SetServiceProperties(props ServiceProperties) error

SetServiceProperties sets the properties of your storage account's table service. See: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/set-table-service-properties

type TimeRFC1123

TimeRFC1123 is an alias for time.Time needed for custom Unmarshalling

type TimeRFC1123 time.Time

func (*TimeRFC1123) MarshalXML

func (t *TimeRFC1123) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshals using time.RFC1123.

func (*TimeRFC1123) UnmarshalXML

func (t *TimeRFC1123) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML is a custom unmarshaller that overrides the default time unmarshal which uses a different time layout.

type UnexpectedStatusCodeError

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

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

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.

func (UnexpectedStatusCodeError) Inner

func (e UnexpectedStatusCodeError) Inner() error

Inner returns any inner error info.

type UpdateMessageOptions

UpdateMessageOptions is the set of options can be specified for Update Messsage operation. A zero struct does not use any preferences for the request.

type UpdateMessageOptions struct {
    Timeout           uint
    VisibilityTimeout int
    RequestID         string `header:"x-ms-client-request-id"`
}

type WriteRangeOptions

WriteRangeOptions includes options for a write file range operation

type WriteRangeOptions struct {
    Timeout    uint
    ContentMD5 string
}