refactor 'ExtractHeader' to 'gophercloud' proper
diff --git a/openstack/objectstorage/v1/accounts/results.go b/openstack/objectstorage/v1/accounts/results.go
index b254db9..abae026 100644
--- a/openstack/objectstorage/v1/accounts/results.go
+++ b/openstack/objectstorage/v1/accounts/results.go
@@ -1,23 +1,14 @@
package accounts
import (
- "net/http"
"strings"
"github.com/rackspace/gophercloud"
)
-type headerResult struct {
- gophercloud.Result
-}
-
-func (hr headerResult) ExtractHeader() (http.Header, error) {
- return hr.Header, hr.Err
-}
-
// GetResult is returned from a call to the Get function.
type GetResult struct {
- headerResult
+ gophercloud.HeaderResult
}
// ExtractMetadata is a function that takes a GetResult (of type *http.Response)
@@ -39,5 +30,5 @@
// UpdateResult is returned from a call to the Update function.
type UpdateResult struct {
- headerResult
+ gophercloud.HeaderResult
}
diff --git a/openstack/objectstorage/v1/containers/results.go b/openstack/objectstorage/v1/containers/results.go
index e3cddc4..74f3286 100644
--- a/openstack/objectstorage/v1/containers/results.go
+++ b/openstack/objectstorage/v1/containers/results.go
@@ -2,7 +2,6 @@
import (
"fmt"
- "net/http"
"strings"
"github.com/rackspace/gophercloud"
@@ -97,17 +96,9 @@
}
}
-type headerResult struct {
- gophercloud.Result
-}
-
-func (hr headerResult) ExtractHeader() (http.Header, error) {
- return hr.Header, hr.Err
-}
-
// GetResult represents the result of a get operation.
type GetResult struct {
- headerResult
+ gophercloud.HeaderResult
}
// ExtractMetadata is a function that takes a GetResult (of type *http.Response)
@@ -130,19 +121,19 @@
// the headers from the HTTP response, you can invoke the 'ExtractHeader'
// method on the result struct.
type CreateResult struct {
- headerResult
+ gophercloud.HeaderResult
}
// UpdateResult represents the result of an update operation. To extract the
// the headers from the HTTP response, you can invoke the 'ExtractHeader'
// method on the result struct.
type UpdateResult struct {
- headerResult
+ gophercloud.HeaderResult
}
// DeleteResult represents the result of a delete operation. To extract the
// the headers from the HTTP response, you can invoke the 'ExtractHeader'
// method on the result struct.
type DeleteResult struct {
- headerResult
+ gophercloud.HeaderResult
}
diff --git a/openstack/objectstorage/v1/objects/results.go b/openstack/objectstorage/v1/objects/results.go
index 274d8a6..102d94c 100644
--- a/openstack/objectstorage/v1/objects/results.go
+++ b/openstack/objectstorage/v1/objects/results.go
@@ -4,7 +4,6 @@
"fmt"
"io"
"io/ioutil"
- "net/http"
"strings"
"github.com/rackspace/gophercloud"
@@ -98,17 +97,9 @@
}
}
-type headerResult struct {
- gophercloud.Result
-}
-
-func (hr headerResult) ExtractHeader() (http.Header, error) {
- return hr.Header, hr.Err
-}
-
// DownloadResult is a *http.Response that is returned from a call to the Download function.
type DownloadResult struct {
- headerResult
+ gophercloud.HeaderResult
Body io.ReadCloser
}
@@ -131,7 +122,7 @@
// GetResult is a *http.Response that is returned from a call to the Get function.
type GetResult struct {
- headerResult
+ gophercloud.HeaderResult
}
// ExtractMetadata is a function that takes a GetResult (of type *http.Response)
@@ -152,20 +143,20 @@
// CreateResult represents the result of a create operation.
type CreateResult struct {
- headerResult
+ gophercloud.HeaderResult
}
// UpdateResult represents the result of an update operation.
type UpdateResult struct {
- headerResult
+ gophercloud.HeaderResult
}
// DeleteResult represents the result of a delete operation.
type DeleteResult struct {
- headerResult
+ gophercloud.HeaderResult
}
// CopyResult represents the result of a copy operation.
type CopyResult struct {
- headerResult
+ gophercloud.HeaderResult
}