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

rectified blob datastructure

parent ecaaa793
Branches
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
ctx := context.Background()
// 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)
containerClient := azureCreds.ServiceClient.NewContainerClient(containerName)
_, err := containerClient.Create(ctx, nil)
......@@ -189,7 +189,8 @@ func InitializeBlobFromObjectStorageCreds(blobName string, azureCreds AzureCrede
log.Fatal(err)
}
return Blob{
ContainerName: blobName,
BlobName: blobName,
ContainerName: containerName,
ContainerClient: containerClient,
BlockBlobClient: blobClient,
}
......@@ -272,7 +273,7 @@ func TestObjectStorage() {
}
// Delete the container
fmt.Println("Deleting the blob " + objectStorage.ContainerName)
fmt.Println("Deleting the blob " + objectStorage.BlobName)
_, err = objectStorage.ContainerClient.Delete(ctx, 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