Documentation ¶
Index ¶
- Variables
- type BlobService
- func (b *BlobService) DeleteByUrl(ctx context.Context, fullUrl string) error
- func (b *BlobService) EnsureContainer(ctx context.Context, container string) (*azblob.ContainerURL, error)
- func (b *BlobService) GetNewServiceURL() azblob.ServiceURL
- func (b *BlobService) IsFileExists(fullUrl string) (bool, error)
- func (b *BlobService) UploadInContainer(ctx context.Context, container, filename, contentType string, ...) (*url.URL, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidContainerName = errors.New("invalid container name")
)
Functions ¶
This section is empty.
Types ¶
type BlobService ¶
type BlobService struct {
// contains filtered or unexported fields
}
func NewBlobService ¶
func NewBlobService(accountName, accountKey string) (*BlobService, error)
func (*BlobService) DeleteByUrl ¶
func (b *BlobService) DeleteByUrl(ctx context.Context, fullUrl string) error
func (*BlobService) EnsureContainer ¶
func (b *BlobService) EnsureContainer(ctx context.Context, container string) (*azblob.ContainerURL, error)
EnsureContainer always attempts to create the container and will not return any error if it already exists. Otherwise it will create the container and cache it. Either way, it will be cached because it is a time-wise expensive op.
If you only want to upload a file to a container, see UploadInContainer() below.
func (*BlobService) GetNewServiceURL ¶
func (b *BlobService) GetNewServiceURL() azblob.ServiceURL
func (*BlobService) IsFileExists ¶
func (b *BlobService) IsFileExists(fullUrl string) (bool, error)
func (*BlobService) UploadInContainer ¶
func (b *BlobService) UploadInContainer(ctx context.Context, container, filename, contentType string, data io.ReadSeeker) (*url.URL, error)
Click to show internal directories.
Click to hide internal directories.