make object and container types generic
diff --git a/openstack/storage/v1/containers/containers.go b/openstack/storage/v1/containers/containers.go
index b3fb921..79c3d64 100644
--- a/openstack/storage/v1/containers/containers.go
+++ b/openstack/storage/v1/containers/containers.go
@@ -5,11 +5,7 @@
"strings"
)
-type Container struct {
- Bytes int
- Count int
- Name string
-}
+type Container map[string]interface{}
type ListOpts struct {
Full bool
diff --git a/openstack/storage/v1/containers/requests.go b/openstack/storage/v1/containers/requests.go
index 4257e50..a1a87a1 100644
--- a/openstack/storage/v1/containers/requests.go
+++ b/openstack/storage/v1/containers/requests.go
@@ -37,12 +37,12 @@
}
// Create is a function that creates a new container.
-func Create(c *storage.Client, opts CreateOpts) (*Container, error) {
- var ci *Container
+func Create(c *storage.Client, opts CreateOpts) (Container, error) {
+ var ci Container
h, err := c.GetHeaders()
if err != nil {
- return new(Container), err
+ return Container{}, err
}
for k, v := range opts.Headers {
@@ -59,8 +59,8 @@
OkCodes: []int{201, 204},
})
if err == nil {
- ci = &Container{
- Name: opts.Name,
+ ci = Container{
+ "name": opts.Name,
}
}
return ci, err
diff --git a/openstack/storage/v1/objects/objects.go b/openstack/storage/v1/objects/objects.go
index 20228e5..33bad29 100644
--- a/openstack/storage/v1/objects/objects.go
+++ b/openstack/storage/v1/objects/objects.go
@@ -6,13 +6,7 @@
"strings"
)
-type Object struct {
- Name string
- Hash string
- Bytes int
- Content_type string
- Last_modified string
-}
+type Object map[string]interface{}
type ListOpts struct {
Container string