Documentation ¶
Index ¶
- type AccessLevel
- type AcquireLeaseInput
- type AcquireLeaseModel
- type AcquireLeaseResponse
- type BlobDetails
- type BlobPrefix
- type BlobProperties
- type Blobs
- type BreakLeaseInput
- type BreakLeaseModel
- type BreakLeaseResponse
- type ChangeLeaseInput
- type ChangeLeaseModel
- type ChangeLeaseResponse
- type Client
- func (c Client) AcquireLease(ctx context.Context, containerName string, input AcquireLeaseInput) (resp AcquireLeaseResponse, err error)
- func (c Client) BreakLease(ctx context.Context, containerName string, input BreakLeaseInput) (resp BreakLeaseResponse, err error)
- func (c Client) ChangeLease(ctx context.Context, containerName string, input ChangeLeaseInput) (resp ChangeLeaseResponse, err error)
- func (c Client) Create(ctx context.Context, containerName string, input CreateInput) (resp CreateResponse, err error)
- func (c Client) Delete(ctx context.Context, containerName string) (resp DeleteResponse, err error)
- func (c Client) GetProperties(ctx context.Context, containerName string, input GetPropertiesInput) (resp GetPropertiesResponse, err error)
- func (c Client) GetResourceManagerResourceID(subscriptionID, resourceGroup, accountName, containerName string) string
- func (c Client) ListBlobs(ctx context.Context, containerName string, input ListBlobsInput) (resp ListBlobsResponse, err error)
- func (c Client) ReleaseLease(ctx context.Context, containerName string, input ReleaseLeaseInput) (resp ReleaseLeaseResponse, err error)
- func (c Client) RenewLease(ctx context.Context, containerName string, input RenewLeaseInput) (resp RenewLeaseResponse, err error)
- func (c Client) SetAccessControl(ctx context.Context, containerName string, input SetAccessControlInput) (resp SetAccessControlResponse, err error)
- func (c Client) SetMetaData(ctx context.Context, containerName string, input SetMetaDataInput) (resp SetMetaDataResponse, err error)
- type ContainerId
- type ContainerProperties
- type CreateInput
- type CreateResponse
- type Dataset
- type DeleteResponse
- type ErrorResponse
- type GetPropertiesInput
- type GetPropertiesResponse
- type LeaseDuration
- type LeaseState
- type LeaseStatus
- type ListBlobsInput
- type ListBlobsResponse
- type ListBlobsResult
- type ReleaseLeaseInput
- type ReleaseLeaseResponse
- type RenewLeaseInput
- type RenewLeaseResponse
- type SetAccessControlInput
- type SetAccessControlResponse
- type SetMetaDataInput
- type SetMetaDataResponse
- type StorageContainer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessLevel ¶
type AccessLevel string
var ( // Blob specifies public read access for blobs. // Blob data within this container can be read via anonymous request, // but container data is not available. // Clients cannot enumerate blobs within the container via anonymous request. Blob AccessLevel = "blob" // Container specifies full public read access for container and blob data. // Clients can enumerate blobs within the container via anonymous request, // but cannot enumerate containers within the storage account. Container AccessLevel = "container" // Private specifies that container data is private to the account owner Private AccessLevel = "" )
type AcquireLeaseInput ¶
type AcquireLeaseModel ¶ added in v0.21.0
type AcquireLeaseModel struct {
LeaseID string
}
type AcquireLeaseResponse ¶
type AcquireLeaseResponse struct { HttpResponse *client.Response Model *AcquireLeaseModel }
type BlobDetails ¶
type BlobDetails struct { Name string `xml:"Name"` Deleted bool `xml:"Deleted,omitempty"` MetaData map[string]interface{} `map:"Metadata,omitempty"` Properties *BlobProperties `xml:"Properties,omitempty"` Snapshot *string `xml:"Snapshot,omitempty"` }
type BlobPrefix ¶
type BlobPrefix struct {
Name string `xml:"Name"`
}
type BlobProperties ¶
type BlobProperties struct { AccessTier *string `xml:"AccessTier,omitempty"` AccessTierInferred *bool `xml:"AccessTierInferred,omitempty"` AccessTierChangeTime *string `xml:"AccessTierChangeTime,omitempty"` BlobType *string `xml:"BlobType,omitempty"` BlobSequenceNumber *string `xml:"x-ms-blob-sequence-number,omitempty"` CacheControl *string `xml:"Cache-Control,omitempty"` ContentEncoding *string `xml:"ContentEncoding,omitempty"` ContentLanguage *string `xml:"Content-Language,omitempty"` ContentLength *int64 `xml:"Content-Length,omitempty"` ContentMD5 *string `xml:"Content-MD5,omitempty"` ContentType *string `xml:"Content-Type,omitempty"` CopyCompletionTime *string `xml:"CopyCompletionTime,omitempty"` CopyId *string `xml:"CopyId,omitempty"` CopyStatus *string `xml:"CopyStatus,omitempty"` CopySource *string `xml:"CopySource,omitempty"` CopyProgress *string `xml:"CopyProgress,omitempty"` CopyStatusDescription *string `xml:"CopyStatusDescription,omitempty"` CreationTime *string `xml:"CreationTime,omitempty"` ETag *string `xml:"Etag,omitempty"` DeletedTime *string `xml:"DeletedTime,omitempty"` IncrementalCopy *bool `xml:"IncrementalCopy,omitempty"` LastModified *string `xml:"Last-Modified,omitempty"` LeaseDuration *string `xml:"LeaseDuration,omitempty"` LeaseState *string `xml:"LeaseState,omitempty"` LeaseStatus *string `xml:"LeaseStatus,omitempty"` RemainingRetentionDays *string `xml:"RemainingRetentionDays,omitempty"` ServerEncrypted *bool `xml:"ServerEncrypted,omitempty"` }
type Blobs ¶
type Blobs struct { Blobs []BlobDetails `xml:"Blob"` BlobPrefix *BlobPrefix `xml:"BlobPrefix"` }
type BreakLeaseInput ¶
type BreakLeaseInput struct { // For a break operation, proposed duration the lease should continue // before it is broken, in seconds, between 0 and 60. // This break period is only used if it is shorter than the time remaining on the lease. // If longer, the time remaining on the lease is used. // A new lease will not be available before the break period has expired, // but the lease may be held for longer than the break period. // If this header does not appear with a break operation, a fixed-duration lease breaks // after the remaining lease period elapses, and an infinite lease breaks immediately. BreakPeriod *int LeaseID string }
type BreakLeaseModel ¶ added in v0.21.0
type BreakLeaseModel struct { // Approximate time remaining in the lease period, in seconds. // If the break is immediate, 0 is returned. LeaseTime int }
type BreakLeaseResponse ¶
type BreakLeaseResponse struct { HttpResponse *client.Response Model *BreakLeaseModel }
type ChangeLeaseInput ¶
type ChangeLeaseModel ¶ added in v0.21.0
type ChangeLeaseModel struct {
LeaseID string
}
type ChangeLeaseResponse ¶
type ChangeLeaseResponse struct { HttpResponse *client.Response Model *ChangeLeaseModel }
type Client ¶
Client is the base client for Blob Storage Containers.
func NewWithBaseUri ¶ added in v0.21.0
func (Client) AcquireLease ¶
func (c Client) AcquireLease(ctx context.Context, containerName string, input AcquireLeaseInput) (resp AcquireLeaseResponse, err error)
AcquireLease establishes and manages a lock on a container for delete operations.
func (Client) BreakLease ¶
func (c Client) BreakLease(ctx context.Context, containerName string, input BreakLeaseInput) (resp BreakLeaseResponse, err error)
BreakLease breaks a lock based on it's Lease ID
func (Client) ChangeLease ¶
func (c Client) ChangeLease(ctx context.Context, containerName string, input ChangeLeaseInput) (resp ChangeLeaseResponse, err error)
ChangeLease changes the lock from one Lease ID to another Lease ID
func (Client) Create ¶
func (c Client) Create(ctx context.Context, containerName string, input CreateInput) (resp CreateResponse, err error)
Create creates a new container under the specified account. If the container with the same name already exists, the operation fails.
func (Client) Delete ¶
Delete marks the specified container for deletion. The container and any blobs contained within it are later deleted during garbage collection.
func (Client) GetProperties ¶
func (c Client) GetProperties(ctx context.Context, containerName string, input GetPropertiesInput) (resp GetPropertiesResponse, err error)
GetProperties returns the properties for this Container without a Lease
func (Client) GetResourceManagerResourceID ¶
func (c Client) GetResourceManagerResourceID(subscriptionID, resourceGroup, accountName, containerName string) string
GetResourceManagerResourceID returns the Resource Manager specific ResourceID for a specific Storage Container
func (Client) ListBlobs ¶
func (c Client) ListBlobs(ctx context.Context, containerName string, input ListBlobsInput) (resp ListBlobsResponse, err error)
ListBlobs lists the blobs matching the specified query within the specified Container
func (Client) ReleaseLease ¶
func (c Client) ReleaseLease(ctx context.Context, containerName string, input ReleaseLeaseInput) (resp ReleaseLeaseResponse, err error)
ReleaseLease releases the lock based on the Lease ID
func (Client) RenewLease ¶
func (c Client) RenewLease(ctx context.Context, containerName string, input RenewLeaseInput) (resp RenewLeaseResponse, err error)
RenewLease renews the lock based on the Lease ID
func (Client) SetAccessControl ¶
func (c Client) SetAccessControl(ctx context.Context, containerName string, input SetAccessControlInput) (resp SetAccessControlResponse, err error)
SetAccessControl sets the Access Control for a Container without a Lease ID NOTE: The SetAccessControl operation only supports Shared Key authorization.
func (Client) SetMetaData ¶
func (c Client) SetMetaData(ctx context.Context, containerName string, input SetMetaDataInput) (resp SetMetaDataResponse, err error)
SetMetaData sets the specified MetaData on the Container without a Lease ID
type ContainerId ¶ added in v0.22.0
type ContainerId struct { // AccountId specifies the ID of the Storage Account where this Container exists. AccountId accounts.AccountId // ContainerName specifies the name of this Container. ContainerName string }
func NewContainerID ¶ added in v0.22.0
func NewContainerID(accountId accounts.AccountId, containerName string) ContainerId
func ParseContainerID ¶ added in v0.22.0
func ParseContainerID(input, domainSuffix string) (*ContainerId, error)
ParseContainerID parses `input` into a Container ID using a known `domainSuffix`
func (ContainerId) ID ¶ added in v0.22.0
func (b ContainerId) ID() string
func (ContainerId) String ¶ added in v0.22.0
func (b ContainerId) String() string
type ContainerProperties ¶
type ContainerProperties struct { AccessLevel AccessLevel LeaseStatus LeaseStatus LeaseState LeaseState LeaseDuration *LeaseDuration MetaData map[string]string HasImmutabilityPolicy bool HasLegalHold bool }
type CreateInput ¶
type CreateInput struct { // Specifies whether data in the container may be accessed publicly and the level of access AccessLevel AccessLevel // A name-value pair to associate with the container as metadata. MetaData map[string]string }
type CreateResponse ¶
type CreateResponse struct { HttpResponse *client.Response Error *ErrorResponse `xml:"Error"` }
type DeleteResponse ¶ added in v0.21.0
type ErrorResponse ¶
type GetPropertiesInput ¶ added in v0.21.0
type GetPropertiesInput struct {
LeaseId string
}
type GetPropertiesResponse ¶ added in v0.21.0
type GetPropertiesResponse struct { HttpResponse *client.Response Model *ContainerProperties }
type LeaseDuration ¶
type LeaseDuration string
var ( // If this lease is for a Fixed Duration Fixed LeaseDuration = "fixed" // If this lease is for an Indefinite Duration Infinite LeaseDuration = "infinite" )
type LeaseState ¶
type LeaseState string
var ( Available LeaseState = "available" Breaking LeaseState = "breaking" Broken LeaseState = "broken" Expired LeaseState = "expired" Leased LeaseState = "leased" )
type LeaseStatus ¶
type LeaseStatus string
var ( Locked LeaseStatus = "locked" Unlocked LeaseStatus = "unlocked" )
type ListBlobsInput ¶
type ListBlobsResponse ¶ added in v0.21.0
type ListBlobsResponse struct { HttpResponse *client.Response Model *ListBlobsResult }
type ListBlobsResult ¶
type ReleaseLeaseInput ¶ added in v0.21.0
type ReleaseLeaseInput struct {
LeaseId string
}
type ReleaseLeaseResponse ¶ added in v0.21.0
type RenewLeaseInput ¶ added in v0.21.0
type RenewLeaseInput struct {
LeaseId string
}
type RenewLeaseResponse ¶ added in v0.21.0
type SetAccessControlInput ¶ added in v0.21.0
type SetAccessControlInput struct { AccessLevel AccessLevel LeaseId string }
type SetAccessControlResponse ¶ added in v0.21.0
type SetMetaDataInput ¶ added in v0.21.0
type SetMetaDataResponse ¶ added in v0.21.0
type StorageContainer ¶
type StorageContainer interface { Create(ctx context.Context, containerName string, input CreateInput) (CreateResponse, error) Delete(ctx context.Context, containerName string) (DeleteResponse, error) GetProperties(ctx context.Context, containerName string, input GetPropertiesInput) (GetPropertiesResponse, error) AcquireLease(ctx context.Context, containerName string, input AcquireLeaseInput) (AcquireLeaseResponse, error) BreakLease(ctx context.Context, containerName string, input BreakLeaseInput) (BreakLeaseResponse, error) ChangeLease(ctx context.Context, containerName string, input ChangeLeaseInput) (ChangeLeaseResponse, error) ReleaseLease(ctx context.Context, containerName string, input ReleaseLeaseInput) (ReleaseLeaseResponse, error) RenewLease(ctx context.Context, containerName string, input RenewLeaseInput) (RenewLeaseResponse, error) ListBlobs(ctx context.Context, containerName string, input ListBlobsInput) (ListBlobsResponse, error) GetResourceManagerResourceID(subscriptionID, resourceGroup, accountName, containerName string) string SetAccessControl(ctx context.Context, containerName string, input SetAccessControlInput) (SetAccessControlResponse, error) SetMetaData(ctx context.Context, containerName string, metaData SetMetaDataInput) (SetMetaDataResponse, error) }