diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2018-03-11 19:38:27 +0100 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2018-03-11 19:41:33 +0100 |
| commit | d23b4052c0866698b14ac13ac98581d9f5440a9b (patch) | |
| tree | 51c93559594f8fd5136fd51b7397a30415ea93aa /field_uint64.go | |
| parent | aaf61ac55e18a04fd68b9b6ee4fd4fce49659eeb (diff) | |
| download | go-schwift-d23b4052c0866698b14ac13ac98581d9f5440a9b.tar.gz | |
revamp the Headers API
1. Move common methods of AccountHeaders, ContainerHeaders,
ObjectHeaders into a base type Headers.
2. Fold Headers into RequestOptions to remove one of the two optional
arguments on request methods. The new Headers.ToOpts() method
offers a nice experience for users passing Headers to request
methods.
The Update() methods keep the explicit Headers argument since the
Headers argument is not optional there.
The only downside is that we lose a bit of type-safety because
RequestOptions takes any Headers instance, so e.g. ContainerHeaders
could be passed to Object.Upload(). I believe the benefits outweigh
this problem.
Diffstat (limited to 'field_uint64.go')
| -rw-r--r-- | field_uint64.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/field_uint64.go b/field_uint64.go index a14f558..2a542ae 100644 --- a/field_uint64.go +++ b/field_uint64.go @@ -26,12 +26,12 @@ import ( //whose value is an unsigned integer. It cannot be directly constructed, but //methods on the Headers types return this type. For example: // -// hdr := make(AccountHeaders) -// //the following two statements are equivalent: -// hdr["X-Account-Meta-Quota-Bytes"] = "1048576" -// hdr.QuotaBytes().Set(1 << 20) +// hdr := NewAccountHeaders() +// //the following two statements are equivalent: +// hdr["X-Account-Meta-Quota-Bytes"] = "1048576" +// hdr.BytesUsedQuota().Set(1 << 20) type FieldUint64 struct { - h headerInterface + h Headers k string } @@ -85,7 +85,7 @@ func (f FieldUint64) validate() error { //FieldUint64Readonly is a readonly variant of FieldUint64. It is used for //fields that cannot be set by the client. type FieldUint64Readonly struct { - h headerInterface + h Headers k string } |
