go fmt
diff --git a/openstack/compute/flavors/client.go b/openstack/compute/flavors/client.go
index 5ad97af..60c7cd1 100644
--- a/openstack/compute/flavors/client.go
+++ b/openstack/compute/flavors/client.go
@@ -5,16 +5,16 @@
)
type Client struct {
- endpoint string
+ endpoint string
authority identity.AuthResults
- options identity.AuthOptions
+ options identity.AuthOptions
}
func NewClient(e string, a identity.AuthResults, ao identity.AuthOptions) *Client {
return &Client{
- endpoint: e,
+ endpoint: e,
authority: a,
- options: ao,
+ options: ao,
}
}
@@ -32,4 +32,3 @@
"X-Auth-Token": t.Id,
}, nil
}
-
diff --git a/openstack/compute/flavors/flavors.go b/openstack/compute/flavors/flavors.go
index b66115f..81996a5 100644
--- a/openstack/compute/flavors/flavors.go
+++ b/openstack/compute/flavors/flavors.go
@@ -5,7 +5,6 @@
"reflect"
)
-
// Flavor records represent (virtual) hardware configurations for server resources in a region.
//
// The Id field contains the flavor's unique identifier.
@@ -20,13 +19,13 @@
//
// VCpus indicates how many (virtual) CPUs are available for this flavor.
type Flavor struct {
- Disk int
- Id string
- Name string
- Ram int
- RxTxFactor float64 `mapstructure:"rxtx_factor"`
- Swap int
- VCpus int
+ Disk int
+ Id string
+ Name string
+ Ram int
+ RxTxFactor float64 `mapstructure:"rxtx_factor"`
+ Swap int
+ VCpus int
}
func defaulter(from, to reflect.Kind, v interface{}) (interface{}, error) {
@@ -48,7 +47,7 @@
flavorObj := fm.(map[string]interface{})
cfg := &mapstructure.DecoderConfig{
DecodeHook: defaulter,
- Result: &flavors[i],
+ Result: &flavors[i],
}
decoder, err := mapstructure.NewDecoder(cfg)
if err != nil {
@@ -61,4 +60,3 @@
}
return flavors, nil
}
-
diff --git a/openstack/compute/flavors/requests.go b/openstack/compute/flavors/requests.go
index c76e5af..f4dd072 100644
--- a/openstack/compute/flavors/requests.go
+++ b/openstack/compute/flavors/requests.go
@@ -5,7 +5,6 @@
"github.com/racker/perigee"
)
-
var ErrNotImplemented = fmt.Errorf("Flavors functionality not implemented.")
type ListResults map[string]interface{}
@@ -19,9 +18,8 @@
}
err = perigee.Get(c.getListUrl(), perigee.Options{
- Results: &lr,
+ Results: &lr,
MoreHeaders: h,
})
return lr, err
}
-
diff --git a/openstack/compute/images/client.go b/openstack/compute/images/client.go
index a7466bb..c5f1897 100644
--- a/openstack/compute/images/client.go
+++ b/openstack/compute/images/client.go
@@ -5,16 +5,16 @@
)
type Client struct {
- endpoint string
+ endpoint string
authority identity.AuthResults
- options identity.AuthOptions
+ options identity.AuthOptions
}
func NewClient(e string, a identity.AuthResults, ao identity.AuthOptions) *Client {
return &Client{
- endpoint: e,
+ endpoint: e,
authority: a,
- options: ao,
+ options: ao,
}
}
@@ -32,4 +32,3 @@
"X-Auth-Token": t.Id,
}, nil
}
-
diff --git a/openstack/compute/images/images.go b/openstack/compute/images/images.go
index d53edce..cc08589 100644
--- a/openstack/compute/images/images.go
+++ b/openstack/compute/images/images.go
@@ -17,14 +17,14 @@
//
// The Updated field indicates the last time this image was changed.
type Image struct {
- Created string
- Id string
- MinDisk int
- MinRam int
- Name string
- Progress int
- Status string
- Updated string
+ Created string
+ Id string
+ MinDisk int
+ MinRam int
+ Name string
+ Progress int
+ Status string
+ Updated string
}
func GetImages(lr ListResults) ([]Image, error) {
@@ -44,4 +44,3 @@
}
return images, nil
}
-
diff --git a/openstack/compute/images/requests.go b/openstack/compute/images/requests.go
index 2aa4723..ff875c9 100644
--- a/openstack/compute/images/requests.go
+++ b/openstack/compute/images/requests.go
@@ -5,7 +5,6 @@
"github.com/racker/perigee"
)
-
var ErrNotImplemented = fmt.Errorf("Images functionality not implemented.")
type ListResults map[string]interface{}
@@ -19,9 +18,8 @@
}
err = perigee.Get(c.getListUrl(), perigee.Options{
- Results: &lr,
+ Results: &lr,
MoreHeaders: h,
})
return lr, err
}
-
diff --git a/openstack/compute/servers/client.go b/openstack/compute/servers/client.go
index 03c5c15..3d51dd8 100644
--- a/openstack/compute/servers/client.go
+++ b/openstack/compute/servers/client.go
@@ -7,18 +7,18 @@
// Client abstracts the connection information needed to make API requests for OpenStack compute endpoints.
type Client struct {
- endpoint string
- authority identity.AuthResults
- options identity.AuthOptions
- token *identity.Token
+ endpoint string
+ authority identity.AuthResults
+ options identity.AuthOptions
+ token *identity.Token
}
// NewClient creates a new Client structure to use when issuing requests to the server.
func NewClient(e string, a identity.AuthResults, o identity.AuthOptions) *Client {
return &Client{
- endpoint: e,
- authority: a,
- options: o,
+ endpoint: e,
+ authority: a,
+ options: o,
}
}
@@ -81,4 +81,3 @@
return c.token.Id, err
}
-
diff --git a/openstack/compute/servers/doc.go b/openstack/compute/servers/doc.go
index c5c6777..77a7514 100644
--- a/openstack/compute/servers/doc.go
+++ b/openstack/compute/servers/doc.go
@@ -1,3 +1,2 @@
// The servers package provides convenient access to standard, OpenStack-defined compute services.
package servers
-
diff --git a/openstack/compute/servers/requests.go b/openstack/compute/servers/requests.go
index 385e3c2..28abd1c 100644
--- a/openstack/compute/servers/requests.go
+++ b/openstack/compute/servers/requests.go
@@ -7,7 +7,7 @@
// ListResult abstracts the raw results of making a List() request against the
// API. As OpenStack extensions may freely alter the response bodies of
// structures returned to the client, you may only safely access the data
-// provided through separate, type-safe accessors or methods.
+// provided through separate, type-safe accessors or methods.
type ListResult map[string]interface{}
type ServerResult map[string]interface{}
@@ -22,7 +22,7 @@
}
err = perigee.Get(c.getListUrl(), perigee.Options{
- Results: &lr,
+ Results: &lr,
MoreHeaders: h,
})
return lr, err
@@ -39,11 +39,11 @@
err = perigee.Post(c.getCreateUrl(), perigee.Options{
Results: &sr,
- ReqBody: map[string]interface{} {
+ ReqBody: map[string]interface{}{
"server": opts,
},
MoreHeaders: h,
- OkCodes: []int{202},
+ OkCodes: []int{202},
})
return sr, err
}
@@ -57,7 +57,7 @@
err = perigee.Delete(c.getDeleteUrl(id), perigee.Options{
MoreHeaders: h,
- OkCodes: []int{204},
+ OkCodes: []int{204},
})
return err
}
@@ -72,7 +72,7 @@
}
err = perigee.Get(c.getDetailUrl(id), perigee.Options{
- Results: &sr,
+ Results: &sr,
MoreHeaders: h,
})
return sr, err
@@ -96,4 +96,3 @@
})
return sr, err
}
-
diff --git a/openstack/compute/servers/servers.go b/openstack/compute/servers/servers.go
index c02cf9f..e3bdbe3 100644
--- a/openstack/compute/servers/servers.go
+++ b/openstack/compute/servers/servers.go
@@ -1,8 +1,8 @@
package servers
import (
- "github.com/mitchellh/mapstructure"
"fmt"
+ "github.com/mitchellh/mapstructure"
)
// ErrNotImplemented indicates a failure to discover a feature of the response from the API.
@@ -37,22 +37,22 @@
//
// Links includes HTTP references to the itself, useful for passing along to other APIs that might want a server reference.
type Server struct {
- Id string
- TenantId string `mapstructure:tenant_id`
- UserId string `mapstructure:user_id`
- Name string
- Updated string
- Created string
- HostId string
- Status string
- Progress int
+ Id string
+ TenantId string `mapstructure:tenant_id`
+ UserId string `mapstructure:user_id`
+ Name string
+ Updated string
+ Created string
+ HostId string
+ Status string
+ Progress int
AccessIPv4 string
AccessIPv6 string
- Image map[string]interface{}
- Flavor map[string]interface{}
- Addresses map[string]interface{}
- Metadata map[string]interface{}
- Links []interface{}
+ Image map[string]interface{}
+ Flavor map[string]interface{}
+ Addresses map[string]interface{}
+ Metadata map[string]interface{}
+ Links []interface{}
}
// GetServers interprets the result of a List() call, producing a slice of Server entities.
@@ -86,4 +86,3 @@
err := mapstructure.Decode(serverObj, s)
return s, err
}
-
diff --git a/openstack/compute/servers/servers_test.go b/openstack/compute/servers/servers_test.go
index 8a58a46..b4a094c 100644
--- a/openstack/compute/servers/servers_test.go
+++ b/openstack/compute/servers/servers_test.go
@@ -1,8 +1,8 @@
package servers
import (
- "testing"
"encoding/json"
+ "testing"
)
// Taken from: http://docs.openstack.org/api/openstack-compute/2/content/List_Servers-d1e2078.html
@@ -186,4 +186,3 @@
return
}
}
-