Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit c0a8099

Browse files
author
Dan Kirkwood
committed
change package and type name
1 parent 47b2706 commit c0a8099

File tree

7 files changed

+30
-30
lines changed

7 files changed

+30
-30
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// Package quotas provides information and interaction with Quotas
1+
// Package quotasets provides information and interaction with Quotaset
22
// extension for the OpenStack Compute service.
3-
package quotas
3+
package quotasets

openstack/compute/v2/extensions/quotasets/fixtures.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// +build fixtures
22

3-
package quotas
3+
package quotasets
44

55
import (
66
"fmt"
@@ -31,8 +31,8 @@ const GetOutput = `
3131

3232
const FirstTenantID = "555544443333222211110000ffffeeee"
3333

34-
// FirstQuota is the first result in ListOutput.
35-
var FirstQuota = Quota{
34+
// FirstQuotaset is the first result in ListOutput.
35+
var FirstQuota = Quotaset{
3636
FixedIps: 0,
3737
FloatingIps: 0,
3838
InjectedFileContentBytes: 10240,

openstack/compute/v2/extensions/quotasets/requests.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package quotas
1+
package quotasets
22

33
import (
44
"github.com/rackspace/gophercloud"
55
)
66

7-
// Get returns public data about a previously created Quota.
7+
// Get returns public data about a previously created Quotaset.
88
func Get(client *gophercloud.ServiceClient, tenantID string) GetResult {
99
var res GetResult
1010
_, res.Err = client.Get(getURL(client, tenantID), &res.Body, nil)

openstack/compute/v2/extensions/quotasets/requests_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package quotas
1+
package quotasets
22

33
import (
44
th "github.com/rackspace/gophercloud/testhelper"
@@ -12,5 +12,5 @@ func TestGet(t *testing.T) {
1212
HandleGetSuccessfully(t)
1313
actual, err := Get(client.ServiceClient(), FirstTenantID).Extract()
1414
th.AssertNoErr(t, err)
15-
th.CheckDeepEquals(t, &FirstQuota, actual)
15+
th.CheckDeepEquals(t, &FirstQuotaset, actual)
1616
}

openstack/compute/v2/extensions/quotasets/results.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
package quotas
1+
package quotasets
22

33
import (
44
"github.com/mitchellh/mapstructure"
55
"github.com/rackspace/gophercloud"
66
"github.com/rackspace/gophercloud/pagination"
77
)
88

9-
// Quota is a set of operational limits that allow for control of compute usage.
9+
// Quotaset is a set of operational limits that allow for control of compute usage.
1010
const sample = `
1111
{
1212
"quota_set" : {
@@ -26,7 +26,7 @@ const sample = `
2626
}
2727
`
2828

29-
type Quota struct {
29+
type Quotaset struct {
3030
//ID is tenant associated with this quota_set
3131
ID string `mapstructure:"id"`
3232
//FixedIps is number of fixed ips alloted this quota_set
@@ -55,26 +55,26 @@ type Quota struct {
5555
Instances int `mapstructure:"instances"`
5656
}
5757

58-
// QuotaPage stores a single, only page of Quota results from a List call.
59-
type QuotaPage struct {
58+
// QuotasetPage stores a single, only page of Quotaset results from a List call.
59+
type QuotasetPage struct {
6060
pagination.SinglePageBase
6161
}
6262

63-
// IsEmpty determines whether or not a QuotaPage is empty.
64-
func (page QuotaPage) IsEmpty() (bool, error) {
65-
ks, err := ExtractQuotas(page)
63+
// IsEmpty determines whether or not a QuotasetsetPage is empty.
64+
func (page QuotasetPage) IsEmpty() (bool, error) {
65+
ks, err := ExtractQuotasets(page)
6666
return len(ks) == 0, err
6767
}
6868

69-
// ExtractQuotas interprets a page of results as a slice of Quotas.
70-
func ExtractQuotas(page pagination.Page) ([]Quota, error) {
69+
// ExtractQuotasets interprets a page of results as a slice of Quotasets.
70+
func ExtractQuotasets(page pagination.Page) ([]Quotaset, error) {
7171
var resp struct {
72-
Quotas []Quota `mapstructure:"quotas"`
72+
Quotasets []Quotaset `mapstructure:"quotas"`
7373
}
7474

75-
err := mapstructure.Decode(page.(QuotaPage).Body, &resp)
76-
results := make([]Quota, len(resp.Quotas))
77-
for i, q := range resp.Quotas {
75+
err := mapstructure.Decode(page.(QuotasetPage).Body, &resp)
76+
results := make([]Quotaset, len(resp.Quotasets))
77+
for i, q := range resp.Quotasets {
7878
results[i] = q
7979
}
8080
return results, err
@@ -84,22 +84,22 @@ type quotaResult struct {
8484
gophercloud.Result
8585
}
8686

87-
// Extract is a method that attempts to interpret any Quota resource response as a Quota struct.
88-
func (r quotaResult) Extract() (*Quota, error) {
87+
// Extract is a method that attempts to interpret any Quotaset resource response as a Quotaset struct.
88+
func (r quotaResult) Extract() (*Quotaset, error) {
8989
if r.Err != nil {
9090
return nil, r.Err
9191
}
9292

9393
var res struct {
94-
Quota *Quota `json:"quota_set" mapstructure:"quota_set"`
94+
Quotaset *Quotaset `json:"quota_set" mapstructure:"quota_set"`
9595
}
9696

9797
err := mapstructure.Decode(r.Body, &res)
98-
return res.Quota, err
98+
return res.Quotaset, err
9999
}
100100

101101
// GetResult is the response from a Get operation. Call its Extract method to interpret it
102-
// as a Quota.
102+
// as a Quotaset.
103103
type GetResult struct {
104104
quotaResult
105105
}

openstack/compute/v2/extensions/quotasets/urls.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package quotas
1+
package quotasets
22

33
import "github.com/rackspace/gophercloud"
44

openstack/compute/v2/extensions/quotasets/urls_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package quotas
1+
package quotasets
22

33
import (
44
"testing"

0 commit comments

Comments
 (0)