azure

package
v0.13.16 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChunkSize          = 4000000 // 4Mb
	SnapshotTimeFormat = "2006-01-02T15:04:05.0000000Z"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureClient

type AzureClient interface {
	ListBlobs(params storage.ListBlobsParameters) (storage.BlobListResponse, error)
	GetBlobSizeInBytes(blobName string, snapshot time.Time) (int64, error)
	Get(blobName string, snapshot time.Time) ([]byte, error)
	DownloadBlobToFile(blobName string, file *os.File, snapshop *time.Time, blockSize int64, retryTryTimeout time.Duration) error
	UploadFromStream(blobName string, stream io.Reader, blockSize int, retryTryTimeout time.Duration) error
	CreateSnapshot(blobName string) (time.Time, error)
	GetBlobURL(blobName string) (string, error)
}

type Client

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

func NewClient

func NewClient(baseURL, storageAccountName, storageAccountKey, container string) Client

func (Client) CreateSnapshot

func (c Client) CreateSnapshot(blobName string) (time.Time, error)

func (Client) DownloadBlobToFile

func (c Client) DownloadBlobToFile(blobName string, file *os.File, snapshot *time.Time, blockSize int64, retryTryTimeout time.Duration) error

DownloadBlobToFile download specified blobName to specified file

func (Client) Get

func (c Client) Get(blobName string, snapshot time.Time) ([]byte, error)

func (Client) GetBlobSizeInBytes

func (c Client) GetBlobSizeInBytes(blobName string, snapshot time.Time) (int64, error)

func (Client) GetBlobURL

func (c Client) GetBlobURL(blobName string) (string, error)

func (Client) ListBlobs

func (Client) UploadFromStream

func (c Client) UploadFromStream(blobName string, stream io.Reader, blockSize int, retryTryTimeout time.Duration) error

UploadFromStream adapted from https://godoc.org/github.com/Azure/azure-storage-blob-go/azblob#example-UploadStreamToBlockBlob

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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