Merge lp://staging/~julian-edwards/gwacl/get-container-properties into lp://staging/gwacl

Proposed by Julian Edwards
Status: Merged
Approved by: Julian Edwards
Approved revision: 210
Merged at revision: 206
Proposed branch: lp://staging/~julian-edwards/gwacl/get-container-properties
Merge into: lp://staging/gwacl
Diff against target: 284 lines (+116/-22)
2 files modified
storage_base.go (+51/-22)
storage_base_test.go (+65/-0)
To merge this branch: bzr merge lp://staging/~julian-edwards/gwacl/get-container-properties
Reviewer Review Type Date Requested Status
Jeroen T. Vermeulen (community) Approve
Review via email: mp+177736@code.staging.launchpad.net

Commit message

Implement GetContainerProperties.

Description of the change

Implement GetContainerProperties - it's useful to use as a "tell me if this container exists or not" thing.

To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote :

The response from this call is strangely all in response headers instead of XML in the body like most other calls, so I had to re-jig performRequest a bit so the headers are returned if you provide an non-nil http.Header in the request parameters.

It's annoying to have to copy the headers like it does, and could be avoided if we choose to turn the request parameter struct into a pointer so that arbitrary contained pointers could be returned.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

On 31/07/13 14:03, Julian Edwards wrote:
> The response from this call is strangely all in response headers instead of XML in the body like most other calls, so I had to re-jig performRequest a bit so the headers are returned if you provide an non-nil http.Header in the request parameters.
>
> It's annoying to have to copy the headers like it does, and could be avoided if we choose to turn the request parameter struct into a pointer so that arbitrary contained pointers could be returned.
>

I caved and updated all the call sites to take an additional headers
returned.

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Something weird in the diff... I see the number of return values changing for performRequest, but only one of the "return" statements changes. Do you perchance have some more diff sitting on your machine?

Revision history for this message
Julian Edwards (julian-edwards) wrote :

On 31/07/13 16:06, Jeroen T. Vermeulen wrote:
> Something weird in the diff... I see the number of return values changing for performRequest, but only one of the "return" statements changes. Do you perchance have some more diff sitting on your machine?
>

No that's it, it all works!

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Ah, of course it just returned the result from a send() call. Basically the language supports tuples, it's just that it won't let us use them.

Anyway, good branch. The documentation comment for GetContainerProperties is in the imperative — python-style. In Go it should be in the third person, and start with the name of the function.

TestServerError could do with one small change: the c.Check(ok, Equals, true) should be an Assert, because the next check becomes meaningless if you continue — and you'll get a panic drowning out the root cause in the output.

review: Approve
Revision history for this message
Julian Edwards (julian-edwards) wrote :

On 31/07/13 16:18, Jeroen T. Vermeulen wrote:
> Review: Approve
>
> Ah, of course it just returned the result from a send() call. Basically the language supports tuples, it's just that it won't let us use them.
>
> Anyway, good branch. The documentation comment for GetContainerProperties is in the imperative — python-style. In Go it should be in the third person, and start with the name of the function.

It's the same for all the functions like that, I kept it consistent. If
we're going to change it, we should do them all at once.

> TestServerError could do with one small change: the c.Check(ok, Equals, true) should be an Assert, because the next check becomes meaningless if you continue — and you'll get a panic drowning out the root cause in the output.

Right, thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: