aboutsummaryrefslogtreecommitdiff
path: root/container.go
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2018-02-05 22:06:18 +0100
committerStefan Majewsky <majewsky@gmx.net>2018-02-05 22:06:18 +0100
commit735c7c4465a77d2953e9cb1328284e754f797db7 (patch)
tree0df31162a4b0b769f2ffe641bd7ae4072b7224cf /container.go
parent3a24741929cd12ffee5e54d0e9a9afb83c5069b3 (diff)
downloadgo-schwift-735c7c4465a77d2953e9cb1328284e754f797db7.tar.gz
apparently having a private member is not enough
Diffstat (limited to 'container.go')
-rw-r--r--container.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/container.go b/container.go
index e3b95d8..cfc0eab 100644
--- a/container.go
+++ b/container.go
@@ -96,6 +96,7 @@ func (c *Container) Headers() (ContainerHeaders, error) {
//
//A successful POST request implies Invalidate() since it may change metadata.
func (c *Container) Update(headers ContainerHeaders, opts *RequestOptions) error {
+ ensureInitializedByReflection(headers)
_, err := Request{
Method: "POST",
ContainerName: c.name,
@@ -116,6 +117,7 @@ func (c *Container) Update(headers ContainerHeaders, opts *RequestOptions) error
//
//A successful PUT request implies Invalidate() since it may change metadata.
func (c *Container) Create(headers ContainerHeaders, opts *RequestOptions) error {
+ ensureInitializedByReflection(headers)
_, err := Request{
Method: "PUT",
ContainerName: c.name,
@@ -137,7 +139,14 @@ func (c *Container) Create(headers ContainerHeaders, opts *RequestOptions) error
//This operation fails with http.StatusNotFound if the container does not exist.
//
//A successful DELETE request implies Invalidate().
-func (c *Container) Delete(headers ContainerHeaders, opts *RequestOptions) error {
+func (c *Container) Delete(headers *ContainerHeaders, opts *RequestOptions) error {
+ if headers == nil {
+ h := NewContainerHeaders()
+ headers = &h
+ } else {
+ ensureInitializedByReflection(*headers)
+ }
+
_, err := Request{
Method: "DELETE",
ContainerName: c.name,