6
6
"github.com/rackspace/gophercloud/pagination"
7
7
)
8
8
9
- // Quotaset 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.
10
10
const sample = `
11
11
{
12
12
"quota_set" : {
@@ -26,7 +26,7 @@ const sample = `
26
26
}
27
27
`
28
28
29
- type Quotaset struct {
29
+ type QuotaSet struct {
30
30
//ID is tenant associated with this quota_set
31
31
ID string `mapstructure:"id"`
32
32
//FixedIps is number of fixed ips alloted this quota_set
@@ -55,26 +55,26 @@ type Quotaset struct {
55
55
Instances int `mapstructure:"instances"`
56
56
}
57
57
58
- // QuotasetPage stores a single, only page of Quotaset results from a List call.
59
- type QuotasetPage struct {
58
+ // QuotaSetPage stores a single, only page of QuotaSet results from a List call.
59
+ type QuotaSetPage struct {
60
60
pagination.SinglePageBase
61
61
}
62
62
63
- // IsEmpty determines whether or not a QuotasetsetPage is empty.
64
- func (page QuotasetPage ) IsEmpty () (bool , error ) {
65
- ks , err := ExtractQuotasets (page )
63
+ // IsEmpty determines whether or not a QuotaSetsetPage is empty.
64
+ func (page QuotaSetPage ) IsEmpty () (bool , error ) {
65
+ ks , err := ExtractQuotaSets (page )
66
66
return len (ks ) == 0 , err
67
67
}
68
68
69
- // ExtractQuotasets interprets a page of results as a slice of Quotasets .
70
- func ExtractQuotasets (page pagination.Page ) ([]Quotaset , error ) {
69
+ // ExtractQuotaSets interprets a page of results as a slice of QuotaSets .
70
+ func ExtractQuotaSets (page pagination.Page ) ([]QuotaSet , error ) {
71
71
var resp struct {
72
- Quotasets []Quotaset `mapstructure:"quotas"`
72
+ QuotaSets []QuotaSet `mapstructure:"quotas"`
73
73
}
74
74
75
- err := mapstructure .Decode (page .(QuotasetPage ).Body , & resp )
76
- results := make ([]Quotaset , len (resp .Quotasets ))
77
- for i , q := range resp .Quotasets {
75
+ err := mapstructure .Decode (page .(QuotaSetPage ).Body , & resp )
76
+ results := make ([]QuotaSet , len (resp .QuotaSets ))
77
+ for i , q := range resp .QuotaSets {
78
78
results [i ] = q
79
79
}
80
80
return results , err
@@ -84,22 +84,22 @@ type quotaResult struct {
84
84
gophercloud.Result
85
85
}
86
86
87
- // Extract is a method that attempts to interpret any Quotaset resource response as a Quotaset struct.
88
- func (r quotaResult ) Extract () (* Quotaset , 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 ) {
89
89
if r .Err != nil {
90
90
return nil , r .Err
91
91
}
92
92
93
93
var res struct {
94
- Quotaset * Quotaset `json:"quota_set" mapstructure:"quota_set"`
94
+ QuotaSet * QuotaSet `json:"quota_set" mapstructure:"quota_set"`
95
95
}
96
96
97
97
err := mapstructure .Decode (r .Body , & res )
98
- return res .Quotaset , err
98
+ return res .QuotaSet , err
99
99
}
100
100
101
101
// GetResult is the response from a Get operation. Call its Extract method to interpret it
102
- // as a Quotaset .
102
+ // as a QuotaSet .
103
103
type GetResult struct {
104
104
quotaResult
105
105
}
0 commit comments