nodejitsu/pkgcloud — pull request #154 by kenperkins (2013-05-31 21:47:50+00:00)
Title: [Rackspace] Support Metadata on Storage Container and File

This PR introduces proper metadata handling for `Container` and `File` in the rackspace storage provider.

### Creating Metadata

Create a container with metadata:

```Javascript
client.createContainer({
name: 'metadata-test',
metadata: {
car: true,
cost: 100,
name: 'my-metadata-field'
}
}, function (err, result) {

});
```
Also works for files:

```Javascript
client.upload({
container: 'metadata-test',
remote: '/path/my-file.json',
local: filename,
metadata: {
foo: 'baz',
bar: new Date(),
awesome: true,
sauce: 100
}
}, function (err, result) {

});
```
### Updating Metadata

Updating the metadata on a container:

```Javascript
container.metadata.foo = 'baz';

client.updateContainerMetadata(container, function(err, container) { ... });
```

And on a file:

```Javascript
file.metadata.foo = 'baz';

file.updateMetadata(function(err, container) { ... });
```

### Removing Metadata

Removing on a container is explicit:

```Javascript
client.removeContainerMetadata(container,
{ 'name-of-metadata-field': false }, function(err, c) {

});
```

Removing on a file is implicit, as each time you call updateMetadata on the file, you replace the old metadata with the new.