blobstorage

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_BS_URL_EXPIRY_TIME = 15 // 15 minutes

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobInfo

type BlobInfo struct {
	Name         string
	FileURL      string
	LastModified time.Time
}

type BlobInterface

type BlobInterface interface {
	GetBlobClient() *azblob.Client
	ListBlobs(ctx context.Context, containerName string) ([]*BlobInfo, error)
	UploadBlobBuffer(ctx context.Context, blobName, containerName string, data []byte) error
	UploadBlobStream(ctx context.Context, blobName, containerName string, data io.Reader) error
	UploadFile(ctx context.Context, blobName, containerName string, blobSize int) error
	DownloadBlob(ctx context.Context, blobInfo BlobInfo, containerName string) (*azblob.DownloadStreamResponse, error)
	DownloadFile(ctx context.Context, blobInfo BlobInfo, containerName string) error
	WriteToFile(blobName string, response azblob.DownloadStreamResponse) error
	GetSasUrl(blobName, containerName string) (string, error)
	CreateBlockBlobClient(fileName, containerName string) (*blockblob.Client, error)
	PutBlock(ctx context.Context, blockBlockClient *blockblob.Client, blockID uint16, data *[]byte) (string, error)
	MountFile(ctx context.Context, blockBlobClient *blockblob.Client, blockIDs *[]string) error
}

func New

func New(conf *config.Config) BlobInterface

Jump to

Keyboard shortcuts

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