2011-07-28 17:26:39 +00:00
|
|
|
Implements the Storage interface for Google Storage.
|
|
|
|
A GoogleStorage instance stores blobs in a single Google Storage bucket, with
|
|
|
|
each blob keyed by its blobref.
|
|
|
|
|
2013-07-06 20:29:17 +00:00
|
|
|
Server configuration
|
|
|
|
=====================
|
2011-07-28 17:26:39 +00:00
|
|
|
|
2013-07-06 20:29:17 +00:00
|
|
|
High-level server config is formatted like:
|
|
|
|
|
2013-08-11 15:07:18 +00:00
|
|
|
"googlecloudstorage": "clientId:clientSecret:refreshToken:bucketName"
|
2013-07-06 20:29:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
Testing
|
|
|
|
========
|
|
|
|
|
|
|
|
googlestorage_test.go contains integration tests which run against Google Storage.
|
2011-07-28 17:26:39 +00:00
|
|
|
In order to run these tests properly, you will need to:
|
|
|
|
|
|
|
|
1. Set up google storage. See:
|
|
|
|
http://code.google.com/apis/storage/docs/signup.html
|
|
|
|
|
|
|
|
2. Upload the contents of the testdata dir to a google storage bucket. Note
|
|
|
|
that all these files begin with 'test-': such files will be ignored when
|
|
|
|
the bucket is used as blobserver storage.
|
|
|
|
|
2013-07-06 20:29:17 +00:00
|
|
|
3. Create the config file '~/.config/camlistore/gstestconfig.json'. The
|
|
|
|
file should look something like this:
|
2011-07-28 17:26:39 +00:00
|
|
|
|
|
|
|
{
|
2013-07-06 20:29:17 +00:00
|
|
|
"gsconf": {
|
2011-07-28 17:26:39 +00:00
|
|
|
"auth": {
|
|
|
|
"client_id": "your client id",
|
|
|
|
"client_secret": "your client secret",
|
|
|
|
"refresh_token": "a refresh token"
|
|
|
|
},
|
2013-07-06 20:29:17 +00:00
|
|
|
"bucket": "bucketName"
|
|
|
|
}
|
2011-07-28 17:26:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-07-06 20:29:17 +00:00
|
|
|
You can use 'camtool gsinit' to help obtain the auth config object.
|