Skip to content

Add google storage#8

Open
feulf wants to merge 3 commits intomasterfrom
add-google-storage
Open

Add google storage#8
feulf wants to merge 3 commits intomasterfrom
add-google-storage

Conversation

@feulf
Copy link
Contributor

@feulf feulf commented Feb 3, 2018

No description provided.

Copy link
Member

@sagivo sagivo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most are minor changes but the biggest change needed is streaming the upload/download of a file as we can't load all to memory

projectId: 'blokk-12345'
};

module.exports = googleConf; No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new line

const blockTx = await ethereumeStore.set(namespace, req.body.key, ipfsHash);

// Google Storage
const {projectId} = require('./configs/googleConf');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move all this google init block to the google storage file?


const put = async (googleStorage, namespace, key, value) => {
const filePath = getFilePath(namespace, key);
const tmp = require('tmp');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

require should be on the top of a file

const file = myBucket.file(filePath);
file.download(function (err, contents) {
if (err) reject(err);
resolve(contents);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want to work with streams as if it's a large file you don't want to download it all to memory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants