Merge lp:~jtv/gwacl/pass-marker into lp:gwacl
Proposed by
Jeroen T. Vermeulen
Status: | Merged |
---|---|
Approved by: | Jeroen T. Vermeulen |
Approved revision: | 101 |
Merged at revision: | 98 |
Proposed branch: | lp:~jtv/gwacl/pass-marker |
Merge into: | lp:gwacl |
Diff against target: |
143 lines (+96/-5) 3 files modified
storage_base.go (+14/-2) storage_base_test.go (+75/-0) utils.go (+7/-3) |
To merge this branch: | bzr merge lp:~jtv/gwacl/pass-marker |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella | Approve | ||
Review via email: mp+160939@code.launchpad.net |
Commit message
Pass marker URI parameter to List Containers.
Description of the change
This is a crucial, but hard to test, part that I forgot in my original implementation.
Please excuse the crude URL composition. I don't think we currently have the flexibility to do it more nicely.
Jeroen
To post a comment you must log in.
Looks good.
[1]
uri := interpolateURL( ___.blob. core.windows. net/?comp= list", context.Account) "marker= ___", marker)
"http://
+ if marker != "" {
+ uri += "&" + interpolateURL(
+ }
The choice of ___ was not arbitrary here. It let's us do:
u, err := url.Parse("http:// ___.blob. core.windows. net/?comp= list") u.String( ), context.Account)
if err != nil { ... tiresome crap ... }
q := u.Query()
q.Set("marker", marker)
u.RawQuery = q.Encode()
uri := interpolateURL(
Or you could do it this way:
uri := interpolateURL( ___.blob. core.windows. net/?comp= list", context.Account)
"http://
u, err := url.Parse(uri)
if err != nil { ... tiresome crap ... }
q := u.Query()
q.Set("marker", marker)
u.RawQuery = q.Encode()
uri = u.String()
net.url.URL can be a PITA, but it can sometimes be coerced into doing
the right thing.
[2]
+ query := transport. Exchanges[ 0].Request. URL.RawQuery query)
+ values, err := url.ParseQuery(
This is funny, because you could also do:
query := transport. Exchanges[ 0].Request. URL.Query( )
There's no error returned from Query(), unlike ParseQuery(). I wonder
where that error went? I mean, it's not possible that the error is
thrown away, is it? Not in Go I say with gusto, because developers are
constantly reminded of the need to deal correctly with errors. It's
not like the standard library could contain the following exact
implementation of Query() is it?
// Query parses RawQuery and returns the corresponding values. u.RawQuery)
func (u *URL) Query() Values {
v, _ := ParseQuery(
return v
}
I must be dreaming.