Skip to content
Snippets Groups Projects
Commit 0d60943d authored by Xavier Perret's avatar Xavier Perret
Browse files

rectified blob datastructure

parent ecaaa793
No related branches found
No related tags found
1 merge request!2added file to separate client function from the server
...@@ -176,7 +176,7 @@ func InitializeBlobFromObjectStorageCreds(blobName string, azureCreds AzureCrede ...@@ -176,7 +176,7 @@ func InitializeBlobFromObjectStorageCreds(blobName string, azureCreds AzureCrede
ctx := context.Background() ctx := context.Background()
// Create the container // Create the container
containerName := fmt.Sprintf("blockchain-storage-%s", randomString()) containerName := fmt.Sprintf("bc-container-%s", randomString())
fmt.Printf("Creating a container named %s\n", containerName) fmt.Printf("Creating a container named %s\n", containerName)
containerClient := azureCreds.ServiceClient.NewContainerClient(containerName) containerClient := azureCreds.ServiceClient.NewContainerClient(containerName)
_, err := containerClient.Create(ctx, nil) _, err := containerClient.Create(ctx, nil)
...@@ -189,7 +189,8 @@ func InitializeBlobFromObjectStorageCreds(blobName string, azureCreds AzureCrede ...@@ -189,7 +189,8 @@ func InitializeBlobFromObjectStorageCreds(blobName string, azureCreds AzureCrede
log.Fatal(err) log.Fatal(err)
} }
return Blob{ return Blob{
ContainerName: blobName, BlobName: blobName,
ContainerName: containerName,
ContainerClient: containerClient, ContainerClient: containerClient,
BlockBlobClient: blobClient, BlockBlobClient: blobClient,
} }
...@@ -272,7 +273,7 @@ func TestObjectStorage() { ...@@ -272,7 +273,7 @@ func TestObjectStorage() {
} }
// Delete the container // Delete the container
fmt.Println("Deleting the blob " + objectStorage.ContainerName) fmt.Println("Deleting the blob " + objectStorage.BlobName)
_, err = objectStorage.ContainerClient.Delete(ctx, nil) _, err = objectStorage.ContainerClient.Delete(ctx, nil)
if err != nil { if err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment