Documentation ¶
Index ¶
- Variables
- func ParseAzureError(err error) error
- type AccountConfig
- type AccountConn
- func (a *AccountConn) AcquireLease(ctx context.Context, container string, blobName string) (string, error)
- func (a *AccountConn) AppendBlob(ctx context.Context, container string, reader io.Reader, blobName string, ...) error
- func (a *AccountConn) BlobBytes(ctx context.Context, container string, blob string) ([]byte, error)
- func (a *AccountConn) BlobReader(ctx context.Context, container string, blob string) (io.ReadCloser, error)
- func (a *AccountConn) GetBlobSASURI(ctx context.Context, container string, blobName string, opts SASOptions) (string, error)
- func (a *AccountConn) GetContainerSASURI(ctx context.Context, container string, opts SASOptions) (string, error)
- func (a *AccountConn) ListBlobs(ctx context.Context, container string, prefix string) ([]string, error)
- func (a *AccountConn) ListBlobsByPattern(ctx context.Context, container string, pattern string) ([]string, error)
- func (a *AccountConn) NewContainer(containerName string) (*ContainerConn, error)
- func (a *AccountConn) ReleaseLease(ctx context.Context, container string, blobName string, leaseId string) error
- func (a *AccountConn) TruncateBlob(ctx context.Context, container string, blobName string, leaseId string) error
- type BlobStorage
- func (bs *BlobStorage) AcquireLease(ctx context.Context, account string, container string, blobName string) (string, error)
- func (bs *BlobStorage) AppendBlob(ctx context.Context, account string, container string, reader io.Reader, ...) error
- func (bs *BlobStorage) BlobBytes(ctx context.Context, account string, container string, blob string) ([]byte, error)
- func (bs *BlobStorage) BlobReader(ctx context.Context, account string, container string, blob string) (io.ReadCloser, error)
- func (bs *BlobStorage) GetBlobSASURI(ctx context.Context, account string, container string, blobName string, ...) (string, error)
- func (bs *BlobStorage) GetContainerSASURI(ctx context.Context, account string, container string, opts SASOptions) (string, error)
- func (bs *BlobStorage) ListBlobs(ctx context.Context, account string, container string, prefix string) ([]string, error)
- func (bs *BlobStorage) ListBlobsByPattern(ctx context.Context, account string, container string, pattern string) ([]string, error)
- func (bs *BlobStorage) ReleaseLease(ctx context.Context, account string, container string, blobName string, ...) error
- func (bs *BlobStorage) TruncateBlob(ctx context.Context, account string, container string, blobName string, ...) error
- type ContainerConfig
- type ContainerConn
- func (c *ContainerConn) AcquireLease(ctx context.Context, blobName string) (string, error)
- func (c *ContainerConn) AppendBlob(ctx context.Context, reader io.Reader, blobName string, leaseId string) error
- func (c *ContainerConn) BlobBytes(ctx context.Context, blob string) ([]byte, error)
- func (c *ContainerConn) BlobReader(ctx context.Context, blobName string) (io.ReadCloser, error)
- func (c *ContainerConn) GetBlobSASURI(ctx context.Context, blobName string, opts SASOptions) (string, error)
- func (c *ContainerConn) GetContainerSASURI(ctx context.Context, opts SASOptions) (string, error)
- func (c *ContainerConn) ListBlobs(ctx context.Context, prefix string) ([]string, error)
- func (c *ContainerConn) ListBlobsByPattern(ctx context.Context, pattern string) ([]string, error)
- func (c *ContainerConn) ReleaseLease(ctx context.Context, blobName string, leaseId string) error
- func (c *ContainerConn) TruncateBlob(ctx context.Context, blobName string, leaseId string) error
- type SASOptions
Constants ¶
This section is empty.
Variables ¶
var ( ErrBlobNotFound = errors.New("no blob with that name found") ErrBlobBusy = errors.New("blob is busy, can't perform this action") ErrUnknownStorageAccount = errors.New("unknown storage account") ErrBlockCountLimitReached = errors.New("block count limit reached for blob") ErrUploadFailed = errors.New("blob upload failed") LockfileAlreadyExist = errors.New("lockfile already exist") ErrMsgSizeTooBig = errors.New("message exceeded 4 MB which is the limit") )
Functions ¶
Types ¶
type AccountConfig ¶
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) AcquireLease ¶ added in v0.1.9
func (a *AccountConn) AcquireLease(ctx context.Context, container string, blobName string) (string, error)
returns the leaseId for the file, and error if one occurred
func (*AccountConn) AppendBlob ¶ added in v0.1.8
func (a *AccountConn) AppendBlob(ctx context.Context, container string, reader io.Reader, blobName string, leaseId string) error
this method will handle acquire and release of the lease of the file if you already have the lease - then send in the leaseID
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) ListBlobsByPattern ¶ added in v0.1.8
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) ReleaseLease ¶ added in v0.1.9
func (*AccountConn) TruncateBlob ¶ added in v0.1.8
func (a *AccountConn) TruncateBlob(ctx context.Context, container string, blobName string, leaseId string) error
delete the blob if it exist and create an empty blob with the same name if you have the lease - send it in
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) AcquireLease ¶ added in v0.1.9
func (bs *BlobStorage) AcquireLease(ctx context.Context, account string, container string, blobName string) (string, error)
returns the leaseId for the file, and error if one occurred
func (*BlobStorage) AppendBlob ¶ added in v0.1.8
func (bs *BlobStorage) AppendBlob(ctx context.Context, account string, container string, reader io.Reader, blobName string, leaseId string) error
this method will handle acquire and release of the lease of the file if you already have the lease - then send in the leaseID
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) ListBlobsByPattern ¶ added in v0.1.8
func (*BlobStorage) ReleaseLease ¶ added in v0.1.9
func (*BlobStorage) TruncateBlob ¶ added in v0.1.8
func (bs *BlobStorage) TruncateBlob(ctx context.Context, account string, container string, blobName string, leaseId string) error
delete the blob if it exist and create an empty blob with the same name if you have the lease - send it in
type ContainerConfig ¶ added in v0.1.8
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) AcquireLease ¶ added in v0.1.9
returns the leaseId for the file, and error if one occurred
func (*ContainerConn) AppendBlob ¶ added in v0.1.8
func (c *ContainerConn) AppendBlob(ctx context.Context, reader io.Reader, blobName string, leaseId string) error
this method will handle acquire and release of the lease of the file if you already have the lease - send in the current leaseID
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) ListBlobsByPattern ¶ added in v0.1.8
func (*ContainerConn) ReleaseLease ¶ added in v0.1.9
func (*ContainerConn) TruncateBlob ¶ added in v0.1.8
delete the blob if it exist and create an empty blob with the same name if you have the lease - send it in