blobx

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownStorageAccount = errors.New("unknown storage account")
	ErrUploadFailed          = errors.New("blob upload failed")
)

Functions

This section is empty.

Types

type AccountConfig

type AccountConfig struct {
	Name string `validate:"required,min=2"`
	Key  string `validate:"required,min=2"`
}

type AccountConn added in v0.1.8

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

func NewAccount

func NewAccount(config *AccountConfig) (*AccountConn, error)

NewAccount returns an Azure implementation of a Storage account

func (*AccountConn) AppendBlob added in v0.1.8

func (a *AccountConn) AppendBlob(ctx context.Context, container string, reader io.Reader, blobName string) error

func (*AccountConn) BlobBytes added in v0.1.8

func (a *AccountConn) BlobBytes(ctx context.Context, container string, blob string) ([]byte, error)

func (*AccountConn) BlobReader added in v0.1.8

func (a *AccountConn) BlobReader(ctx context.Context, container string, blob string) (io.ReadCloser, error)

func (*AccountConn) GetBlobSASURI added in v0.1.8

func (a *AccountConn) GetBlobSASURI(ctx context.Context, container string, blobName string, opts SASOptions) (string, error)

func (*AccountConn) GetContainerSASURI added in v0.1.8

func (a *AccountConn) GetContainerSASURI(ctx context.Context, container string, opts SASOptions) (string, error)

func (*AccountConn) ListBlobs added in v0.1.8

func (a *AccountConn) ListBlobs(ctx context.Context, container string, prefix string) ([]string, error)

func (*AccountConn) ListBlobsByPattern added in v0.1.8

func (a *AccountConn) ListBlobsByPattern(ctx context.Context, container string, pattern string) ([]string, error)

func (*AccountConn) NewContainer added in v0.1.8

func (a *AccountConn) NewContainer(containerName string) (*ContainerConn, error)

Get the connection to a container in the storage account.

func (*AccountConn) TruncateBlob added in v0.1.8

func (a *AccountConn) TruncateBlob(ctx context.Context, container string, reader io.Reader, blobName string) error

type BlobStorage added in v0.1.8

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

func New

func New(confs []*AccountConfig) (*BlobStorage, error)

A collection of storage accounts Send in confs for all blob storage accounts you want to connect to

func (*BlobStorage) AppendBlob added in v0.1.8

func (bs *BlobStorage) AppendBlob(ctx context.Context, account string, container string, reader io.Reader, blobName string) error

func (*BlobStorage) BlobBytes added in v0.1.8

func (bs *BlobStorage) BlobBytes(ctx context.Context, account string, container string, blob string) ([]byte, error)

func (*BlobStorage) BlobReader added in v0.1.8

func (bs *BlobStorage) BlobReader(ctx context.Context, account string, container string, blob string) (io.ReadCloser, error)

func (*BlobStorage) GetBlobSASURI added in v0.1.8

func (bs *BlobStorage) GetBlobSASURI(ctx context.Context, account string, container string, blobName string, opts SASOptions) (string, error)

func (*BlobStorage) GetContainerSASURI added in v0.1.8

func (bs *BlobStorage) GetContainerSASURI(ctx context.Context, account string, container string, opts SASOptions) (string, error)

func (*BlobStorage) ListBlobs added in v0.1.8

func (bs *BlobStorage) ListBlobs(ctx context.Context, account string, container string, prefix string) ([]string, error)

func (*BlobStorage) ListBlobsByPattern added in v0.1.8

func (bs *BlobStorage) ListBlobsByPattern(ctx context.Context, account string, container string, pattern string) ([]string, error)

func (*BlobStorage) TruncateBlob added in v0.1.8

func (bs *BlobStorage) TruncateBlob(ctx context.Context, account string, container string, reader io.Reader, blobName string) error

type ContainerConfig added in v0.1.8

type ContainerConfig struct {
	AccountName   string `validate:"required,min=2"`
	AccountKey    string `validate:"required,min=2"`
	ContainerName string `validate:"required,min=2"`
}

type ContainerConn added in v0.1.8

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

func NewAccountContainerConn added in v0.1.8

func NewAccountContainerConn(conf ContainerConfig) (*ContainerConn, error)

Get a connection to a container in an azure storage account. Use this func if you don't have a connection to an Azure account already.

func NewContainerConn added in v0.1.8

func NewContainerConn(storage storage.BlobStorageClient, containerName string) (*ContainerConn, error)

Get a connection to a container in an azure storage account. Use this func if you already have a connection to an Azure storage account.

func (*ContainerConn) AppendBlob added in v0.1.8

func (c *ContainerConn) AppendBlob(ctx context.Context, reader io.Reader, blobName string) error

func (*ContainerConn) BlobBytes added in v0.1.8

func (c *ContainerConn) BlobBytes(ctx context.Context, blob string) ([]byte, error)

func (*ContainerConn) BlobReader added in v0.1.8

func (c *ContainerConn) BlobReader(ctx context.Context, blobName string) (io.ReadCloser, error)

func (*ContainerConn) GetBlobSASURI added in v0.1.8

func (c *ContainerConn) GetBlobSASURI(ctx context.Context, blobName string, opts SASOptions) (string, error)

func (*ContainerConn) GetContainerSASURI added in v0.1.8

func (c *ContainerConn) GetContainerSASURI(ctx context.Context, opts SASOptions) (string, error)

func (*ContainerConn) ListBlobs added in v0.1.8

func (c *ContainerConn) ListBlobs(ctx context.Context, prefix string) ([]string, error)

func (*ContainerConn) ListBlobsByPattern added in v0.1.8

func (c *ContainerConn) ListBlobsByPattern(ctx context.Context, pattern string) ([]string, error)

func (*ContainerConn) TruncateBlob added in v0.1.8

func (c *ContainerConn) TruncateBlob(ctx context.Context, reader io.Reader, blobName string) error

type SASOptions added in v0.1.8

type SASOptions struct {
	ValidFrom    time.Time
	ValidTo      time.Time
	ReadAccess   bool
	AddAccess    bool
	CreateAccess bool
	WriteAccess  bool
	DeleteAccess bool
	ListAccess   bool
}

Jump to

Keyboard shortcuts

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