Documentation
¶
Index ¶
- func AccountRole(account string) (string, bool)
- func ClearAccountRole(account string)
- func CopyBlobServerSide(ctx context.Context, src AzurePath, dst AzurePath, concurrency int, ...) error
- func Delete(ctx context.Context, ap AzurePath) error
- func DeletePrefix(ctx context.Context, ap AzurePath) error
- func Download(ctx context.Context, ap AzurePath) ([]byte, error)
- func DownloadStream(ctx context.Context, ap AzurePath) (io.ReadCloser, error)
- func HeadBlob(ctx context.Context, ap AzurePath) (int64, error)
- func IsBlobURL(raw string) bool
- func ListRecursiveStream(ctx context.Context, ap AzurePath, scanConcurrency int, ...) error
- func ListStream(ctx context.Context, ap AzurePath, cb func(BlobMeta) error) error
- func MkContainer(ctx context.Context, account, container string) error
- func PreAuthenticate(ctx context.Context, accounts ...string) error
- func RegisterAccountRole(account, role string)
- func Touch(ctx context.Context, ap AzurePath) error
- func Upload(ctx context.Context, ap AzurePath, data []byte) error
- func UploadStream(ctx context.Context, ap AzurePath, reader io.Reader, concurrency int) error
- type AzurePath
- type BlobMeta
- type CopyProgress
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccountRole ¶ added in v0.1.19
AccountRole returns the role ("SRC" or "DST") registered for the given account, and a boolean indicating whether a role was registered.
func ClearAccountRole ¶ added in v0.1.19
func ClearAccountRole(account string)
ClearAccountRole removes the role registration for the given account. This is used in tests to reset state between subtests.
func CopyBlobServerSide ¶ added in v0.1.12
func DeletePrefix ¶
DeletePrefix deletes all blobs under directory-like path
func DownloadStream ¶ added in v0.1.8
func IsBlobURL ¶ added in v0.1.5
IsBlobURL performs a lightweight check whether the provided string is a blob endpoint URL.
func ListRecursiveStream ¶ added in v0.1.18
func ListStream ¶ added in v0.1.16
ListStream streams immediate children (non-recursive). If dir-like path provided, lists under it.
func MkContainer ¶
MkContainer creates a new Azure Blob container
func PreAuthenticate ¶ added in v0.1.19
PreAuthenticate eagerly authenticates to the given storage accounts sequentially. This ensures any interactive login popups happen one at a time before parallel workers start. It also pre-warms the blob client and UDC (User Delegation Credential) caches so that no credential acquisition happens during copy.
func RegisterAccountRole ¶ added in v0.1.19
func RegisterAccountRole(account, role string)
RegisterAccountRole tags the given storage account with a role ("SRC" or "DST"). When role-prefixed Azure identity environment variables are set (e.g. SRC_AZURE_TENANT_ID, DST_AZURE_CLIENT_ID, etc.), accounts tagged with the matching role will use those credentials instead of AzureCLI or interactive browser login. This makes authentication machine-friendly for CI/CD and multi-tenant environments.
func Touch ¶ added in v0.1.4
Touch ensures the blob exists by creating an empty object when missing.
Types ¶
type AzurePath ¶
type AzurePath struct {
Account string
Container string
Blob string // may be empty or end with '/' for virtual directory
}
AzurePath represents an az:// path (account/container/blob)
func Parse ¶
Parse parses az://account/container[/blob] or https://account.blob.* URLs.
type BlobMeta ¶
BlobMeta minimal metadata for listing
func List ¶
List lists immediate children (non-recursive). If dir-like path provided, lists under it.
func ListContainers ¶
ListContainers lists all containers in the account
type CopyProgress ¶ added in v0.1.17
type CopyProgress func(copied, total int64)
CopyProgress is called during server-side copy with the number of bytes copied so far and the total size in bytes.