mirror of
https://github.com/gomods/athens
synced 2026-02-03 07:30:32 +00:00
Fix function signatures using sensible defaults
This commit is contained in:
@@ -129,7 +129,7 @@ func (s *azblobLock) acquireLease(ctx context.Context, blobURL azblob.BlockBlobU
|
||||
defer cancel()
|
||||
|
||||
// first we need to create a blob which can be then leased
|
||||
_, err := blobURL.Upload(tctx, bytes.NewReader([]byte{1}), azblob.BlobHTTPHeaders{}, nil, azblob.BlobAccessConditions{})
|
||||
_, err := blobURL.Upload(tctx, bytes.NewReader([]byte{1}), azblob.BlobHTTPHeaders{}, nil, azblob.BlobAccessConditions{}, azblob.DefaultAccessTier, nil, azblob.ClientProvidedKeyOptions{}, azblob.ImmutabilityPolicyOptions{})
|
||||
if err != nil {
|
||||
// if the blob is already leased we will get http.StatusPreconditionFailed while writing to that blob
|
||||
var stgErr azblob.StorageError
|
||||
|
||||
@@ -62,7 +62,7 @@ func (c *azureBlobStoreClient) BlobExists(ctx context.Context, path string) (boo
|
||||
const op errors.Op = "azureblob.BlobExists"
|
||||
// TODO: Any better way of doing this ?
|
||||
blobURL := c.containerURL.NewBlockBlobURL(path)
|
||||
_, err := blobURL.GetProperties(ctx, azblob.BlobAccessConditions{})
|
||||
_, err := blobURL.GetProperties(ctx, azblob.BlobAccessConditions{}, azblob.ClientProvidedKeyOptions{})
|
||||
if err != nil {
|
||||
var serr azblob.StorageError
|
||||
if !errors.AsErr(err, &serr) {
|
||||
@@ -81,7 +81,7 @@ func (c *azureBlobStoreClient) BlobExists(ctx context.Context, path string) (boo
|
||||
func (c *azureBlobStoreClient) ReadBlob(ctx context.Context, path string) (storage.SizeReadCloser, error) {
|
||||
const op errors.Op = "azureblob.ReadBlob"
|
||||
blobURL := c.containerURL.NewBlockBlobURL(path)
|
||||
downloadResponse, err := blobURL.Download(ctx, 0, 0, azblob.BlobAccessConditions{}, false)
|
||||
downloadResponse, err := blobURL.Download(ctx, 0, 0, azblob.BlobAccessConditions{}, false, azblob.ClientProvidedKeyOptions{})
|
||||
if err != nil {
|
||||
return nil, errors.E(op, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user