Created
April 17, 2015 21:09
-
-
Save sedouard/808288c0c0d82276814e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nodeServices.set('azureStorage', { | |
createBlobService: function () { | |
return { | |
listContainersSegmented: function (shouldBeNull, callback){ | |
assert.ok(shouldBeNull === null, 'expeceted arg shouldBeNull to be null'); | |
assert.ok(callback !== null, 'expeceted arg callback to be non-null'); | |
return callback(null, { | |
entries: [{ | |
name: 'testcontainer', | |
properties: { | |
'last-modified': new Date(Date.now()) | |
} | |
}, { | |
name: 'testcontainer2', | |
properties: { | |
'last-modified': new Date(Date.now()) | |
} | |
}] | |
}); | |
}, | |
/.../ | |
createContainerIfNotExists: function (containerName, callback) { | |
assert.ok(containerName !== null, 'expeceted arg containerName to be non-null'); | |
assert.ok(callback !== null, 'expeceted arg callback to be non-null'); | |
return callback(null); | |
}, | |
listBlobsSegmented: function (containerName, shouldBeNull, callback) { | |
assert.ok(containerName !== null, 'expeceted arg containerName to be non-null'); | |
assert.ok(shouldBeNull === null, 'expeceted arg shouldBeNull to be null'); | |
assert.ok(callback !== null, 'expeceted arg callback to be non-null'); | |
return callback(null, { | |
entries: [{ | |
name: 'test-blob-1.mp4', | |
properties: { | |
'content-type': 'video/mpeg4', | |
'content-length': 12313435, | |
'last-modified': new Date(Date.now()) | |
} | |
}, | |
/.../ | |
{ | |
name: 'test-blob-4.mp3', | |
properties: { | |
'content-type': 'audio/mp3', | |
'content-length': 12313435, | |
'last-modified': new Date(Date.now()) | |
} | |
}] | |
}); | |
}, | |
generateSharedAccessSignature: function () { | |
assert.ok(true); | |
// litterally just mashed my keyboard here :-) | |
return '32523fdsgjsdkh5r43r89hvsghsdhafkjwerhs'; | |
}, | |
getUrl: function () { | |
assert.ok(true); | |
return 'https://testaccount.storage.windows.net/somecontainer/test-blob?expiry=2000'; | |
}, | |
BlobUtilities: { | |
SharedAccessPermissions: { | |
READ: 'READ' | |
} | |
} | |
}; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment