or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
golangpkg:golang/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob@v1.6.4

docs

appendblob.mdblob.mdblockblob.mdclient.mdcontainer.mderrors.mdindex.mdlease.mdpageblob.mdsas.mdservice.md
tile.json

tessl/golang-github-com--azure--azure-sdk-for-go--sdk--storage--azblob

tessl install tessl/golang-github-com--azure--azure-sdk-for-go--sdk--storage--azblob@1.6.0

Azure Blob Storage SDK for Go providing comprehensive blob storage operations including uploads, downloads, container management, and advanced features like leases and SAS generation

pageblob.mddocs/

Page Blob Client (pageblob.Client)

The page blob client provides operations specific to page blobs, which support random read/write access in 512-byte pages. Page blobs are used for VHD files and other scenarios requiring random access.

Package Import

import "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/pageblob"

Client Type

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

Constructors

func NewClient(blobURL string, cred azcore.TokenCredential, options *ClientOptions) (*Client, error)
func NewClientWithSharedKeyCredential(blobURL string, cred *blob.SharedKeyCredential, options *ClientOptions) (*Client, error)
func NewClientFromConnectionString(connectionString, containerName, blobName string, options *ClientOptions) (*Client, error)
func NewClientWithNoCredential(blobURL string, options *ClientOptions) (*Client, error)

Client Access

func (c *Client) BlobClient() *blob.Client
func (c *Client) URL() string
func (c *Client) WithSnapshot(snapshot string) (*Client, error)
func (c *Client) WithVersionID(versionID string) (*Client, error)

Page Blob Operations

Create

Creates a new page blob with a specified size.

func (c *Client) Create(ctx context.Context, size int64, o *CreateOptions) (CreateResponse, error)

Options:

type CreateOptions struct {
    HTTPHeaders                    *blob.HTTPHeaders
    Metadata                       map[string]*string
    Tags                           map[string]string
    SequenceNumber                 *int64
    AccessConditions               *blob.AccessConditions
    AccessTier                     *PremiumPageBlobAccessTier
    CPKInfo                        *blob.CPKInfo
    CPKScopeInfo                   *blob.CPKScopeInfo
}

UploadPages

Uploads one or more pages to a page blob.

func (c *Client) UploadPages(ctx context.Context, body io.ReadSeekCloser, contentRange blob.HTTPRange, options *UploadPagesOptions) (UploadPagesResponse, error)

Options:

type UploadPagesOptions struct {
    CPKInfo                        *blob.CPKInfo
    CPKScopeInfo                   *blob.CPKScopeInfo
    LeaseAccessConditions          *blob.LeaseAccessConditions
    ModifiedAccessConditions       *blob.ModifiedAccessConditions
    SequenceNumberAccessConditions *SequenceNumberAccessConditions
    TransferValidation             blob.TransferValidationType
}

type SequenceNumberAccessConditions struct {
    IfSequenceNumberLessThan          *int64
    IfSequenceNumberLessThanOrEqualTo *int64
    IfSequenceNumberEqualTo           *int64
}

Example:

// Create page blob (size must be multiple of 512)
size := int64(512 * 100) // 100 pages
_, err := pageBlobClient.Create(ctx, size, nil)

// Upload pages
data := make([]byte, 512)
contentRange := blob.HTTPRange{Offset: 0, Count: 512}
_, err = pageBlobClient.UploadPages(ctx, streaming.NopCloser(bytes.NewReader(data)), contentRange, nil)

UploadPagesFromURL

Uploads pages from a URL source.

func (c *Client) UploadPagesFromURL(ctx context.Context, source string, sourceOffset, destOffset, count int64, o *UploadPagesFromURLOptions) (UploadPagesFromURLResponse, error)

ClearPages

Clears one or more pages from a page blob.

func (c *Client) ClearPages(ctx context.Context, rnge blob.HTTPRange, options *ClearPagesOptions) (ClearPagesResponse, error)

Resize

Resizes a page blob.

func (c *Client) Resize(ctx context.Context, size int64, options *ResizeOptions) (ResizeResponse, error)

UpdateSequenceNumber

Updates the sequence number of a page blob.

func (c *Client) UpdateSequenceNumber(ctx context.Context, options *UpdateSequenceNumberOptions) (UpdateSequenceNumberResponse, error)

Options:

type UpdateSequenceNumberOptions struct {
    ActionType               *SequenceNumberActionType
    SequenceNumber           *int64
    LeaseAccessConditions    *blob.LeaseAccessConditions
    ModifiedAccessConditions *blob.ModifiedAccessConditions
}

type SequenceNumberActionType string

const (
    SequenceNumberActionTypeMax       SequenceNumberActionType = "max"
    SequenceNumberActionTypeUpdate    SequenceNumberActionType = "update"
    SequenceNumberActionTypeIncrement SequenceNumberActionType = "increment"
)

func PossibleSequenceNumberActionTypeValues() []SequenceNumberActionType

GetPageRanges

Gets the list of valid page ranges.

func (c *Client) NewGetPageRangesPager(o *GetPageRangesOptions) *runtime.Pager[GetPageRangesResponse]

GetPageRangesDiff

Gets the difference in page ranges between a snapshot and the current blob.

func (c *Client) NewGetPageRangesDiffPager(o *GetPageRangesDiffOptions) *runtime.Pager[GetPageRangesDiffResponse]

GetPageRanges

Gets the list of valid page ranges.

func (c *Client) NewGetPageRangesPager(o *GetPageRangesOptions) *runtime.Pager[GetPageRangesResponse]

Returns a pager for iterating through valid page ranges in the page blob.

Options:

type GetPageRangesOptions struct {
    Marker          *string
    MaxResults      *int32
    PrevSnapshotURL *string
    PrevSnapshot    *string
    Range           blob.HTTPRange
    Snapshot        *string
    AccessConditions *blob.AccessConditions
}

GetPageRangesDiff

Gets the difference in page ranges between a snapshot and the current blob.

func (c *Client) NewGetPageRangesDiffPager(o *GetPageRangesDiffOptions) *runtime.Pager[GetPageRangesDiffResponse]

Returns a pager for iterating through page ranges that differ between a snapshot and the current blob.

Options:

type GetPageRangesDiffOptions struct {
    Marker          *string
    MaxResults      *int32
    PrevSnapshotURL *string
    PrevSnapshot    *string
    Range           blob.HTTPRange
    Snapshot        *string
    AccessConditions *blob.AccessConditions
}

StartCopyIncremental

Starts an incremental copy of a snapshot to this page blob.

func (c *Client) StartCopyIncremental(ctx context.Context, copySource string, prevSnapshot string, options *CopyIncrementalOptions) (CopyIncrementalResponse, error)

Options:

type CopyIncrementalOptions struct {
    ModifiedAccessConditions *blob.ModifiedAccessConditions
}

Constants

const PageBytes int64 = 512

Enums

Premium Page Blob Access Tier

type PremiumPageBlobAccessTier string

const (
    PremiumPageBlobAccessTierP4  PremiumPageBlobAccessTier = "P4"
    PremiumPageBlobAccessTierP6  PremiumPageBlobAccessTier = "P6"
    PremiumPageBlobAccessTierP10 PremiumPageBlobAccessTier = "P10"
    PremiumPageBlobAccessTierP15 PremiumPageBlobAccessTier = "P15"
    PremiumPageBlobAccessTierP20 PremiumPageBlobAccessTier = "P20"
    PremiumPageBlobAccessTierP30 PremiumPageBlobAccessTier = "P30"
    PremiumPageBlobAccessTierP40 PremiumPageBlobAccessTier = "P40"
    PremiumPageBlobAccessTierP50 PremiumPageBlobAccessTier = "P50"
    PremiumPageBlobAccessTierP60 PremiumPageBlobAccessTier = "P60"
    PremiumPageBlobAccessTierP70 PremiumPageBlobAccessTier = "P70"
    PremiumPageBlobAccessTierP80 PremiumPageBlobAccessTier = "P80"
)

func PossiblePremiumPageBlobAccessTierValues() []PremiumPageBlobAccessTier

Copy Status

type CopyStatusType string

const (
    CopyStatusTypePending CopyStatusType = "pending"
    CopyStatusTypeSuccess CopyStatusType = "success"
    CopyStatusTypeAborted CopyStatusType = "aborted"
    CopyStatusTypeFailed  CopyStatusType = "failed"
)

func PossibleCopyStatusTypeValues() []CopyStatusType

Types

Page Range

type PageRange struct {
    Start *int64
    End   *int64
}

Clear Range

type ClearRange struct {
    Start *int64
    End   *int64
}

Page List

type PageList struct {
    ClearRange []*ClearRange
    NextMarker *string
    PageRange  []*PageRange
}

Client Options

type ClientOptions struct {
    Telemetry                       policy.TelemetryOptions
    Transport                       policy.Transporter
    Retry                           policy.RetryOptions
    PerCallPolicies                 []policy.Policy
    PerRetryPolicies                []policy.Policy
    InsecureAllowCredentialWithHTTP bool
    DisableRPRegistration           bool
}