bfsaz

package module
v0.11.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package bfsaz abstracts Azure Blob Storage.

When imported, it registers a global `az://` scheme resolver and can be used like:

import (
  "github.com/bsm/bfs"

  _ "github.com/bsm/bfs/bfsaz"
)

func main() {
  ctx := context.Background()
  b, _ := bfs.Connect(ctx, "az://account.blob.core.windows.net/container?access_key=" + os.Getenv("AZURE_STORAGE_ACCESS_KEY"))
  f, _ := b.Open(ctx, "b/c.txt") // opens a blob for reading
  ...
}

bfs.Connect supports the following query parameters:

access_key - the Azure storage access key

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(containerURL string, cfg *Config) (bfs.Bucket, error)

New initiates an bfs.Bucket backed by Azure.

Types

type Config

type Config struct {
	// An optional path prefix
	Prefix string

	// Custom credentials. By default it will look for
	// AZURE_STORAGE_ACCESS_KEY env variable and fallback on anonymous access
	// if not found.
	Credential azblob.Credential
}

Config is passed to New to configure the S3 connection.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL