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

Commit 0792eb7

Browse files
carlpettDSpeichert
authored andcommitted
Update names per PR comments
1 parent 885664e commit 0792eb7

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

openstack/telemetry/v2/meters/fixtures.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ const MeterStatisticsBody = `
9595
`
9696

9797
var (
98-
// MeterHerp is a MeterListResult struct that should correspond to the first result in *[]MeterListResult.
99-
MeterHerp = MeterListResult{
98+
// MeterHerp is a Meter struct that should correspond to the first result in *[]Meter.
99+
MeterHerp = Meter{
100100
MeterId: "YmQ5NDMxYzEtOGQ2OS00YWQzLTgwM2EtOGQ0YTZiODlmZDM2K2luc3RhbmNl",
101101
Name: "instance",
102102
ProjectId: "35b17138-b364-4e6a-a131-8f3099c5be68",
@@ -107,8 +107,8 @@ var (
107107
UserId: "efd87807-12d2-4b38-9c70-5f5c2ac427ff",
108108
}
109109

110-
// MeterDerp is a MeterListResult struct that should correspond to the second result in *[]MeterListResult.
111-
MeterDerp = MeterListResult{
110+
// MeterDerp is a Meter struct that should correspond to the second result in *[]Meter.
111+
MeterDerp = Meter{
112112
MeterId: "NWI4ODIzOWAtOGJhMS00NGZhLWExNTQtOTc4Y2JkYTIzNDc5K2NwdV91dGls",
113113
Name: "cpu_util",
114114
ProjectId: "69e6e7c4ed8b434e92feacbf3d4891fd",
@@ -119,8 +119,8 @@ var (
119119
UserId: "7ya0f7a33717400b951037d55b929c53",
120120
}
121121

122-
// StatisticsHerp is a MeterStatisticsResult struct that should correspond to the first result in *[]MeterStatisticsResult.
123-
StatisticsHerp = MeterStatisticsResult{
122+
// StatisticsHerp is a Statistics struct that should correspond to the first result in *[]Statistics.
123+
StatisticsHerp = Statistics{
124124
Avg: 4.5,
125125
Count: 10,
126126
Duration: 300.0,
@@ -135,8 +135,8 @@ var (
135135
Unit: "GiB",
136136
}
137137

138-
// StatisticsDerp is a MeterStatisticsResult struct that should correspond to the second result in *[]MeterStatisticsResult.
139-
StatisticsDerp = MeterStatisticsResult{
138+
// StatisticsDerp is a Statistics struct that should correspond to the second result in *[]Statistics.
139+
StatisticsDerp = Statistics{
140140
Avg: 1.5856751105737468,
141141
Count: 28162,
142142
Duration: 2591694.0,

openstack/telemetry/v2/meters/requests.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type ListOptsBuilder interface {
1616
type ListOpts struct {
1717
}
1818

19-
// ToServerListQuery formats a ListOpts into a query string.
19+
// ToMeterListQuery formats a ListOpts into a query string.
2020
func (opts ListOpts) ToMeterListQuery() (string, error) {
2121
q, err := gophercloud.BuildQueryString(opts)
2222
if err != nil {
@@ -26,8 +26,8 @@ func (opts ListOpts) ToMeterListQuery() (string, error) {
2626
}
2727

2828
// List makes a request against the API to list meters accessible to you.
29-
func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) listResult {
30-
var res listResult
29+
func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) ListResult {
30+
var res ListResult
3131
url := listURL(client)
3232

3333
if opts != nil {
@@ -74,8 +74,8 @@ func (opts MeterStatisticsOpts) ToMeterStatisticsQuery() (string, error) {
7474
}
7575

7676
// List makes a request against the API to list meters accessible to you.
77-
func MeterStatistics(client *gophercloud.ServiceClient, n string, opts MeterStatisticsOptsBuilder) statisticsResult {
78-
var res statisticsResult
77+
func MeterStatistics(client *gophercloud.ServiceClient, n string, opts MeterStatisticsOptsBuilder) StatisticsResult {
78+
var res StatisticsResult
7979
url := statisticsURL(client, n)
8080

8181
if opts != nil {

openstack/telemetry/v2/meters/results.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/rackspace/gophercloud"
88
)
99

10-
type MeterListResult struct {
10+
type Meter struct {
1111
MeterId string `mapstructure:"meter_id"`
1212
Name string `json:"name"`
1313
ProjectId string `mapstructure:"project_id"`
@@ -18,17 +18,17 @@ type MeterListResult struct {
1818
UserId string `mapstructure:"user_id"`
1919
}
2020

21-
type listResult struct {
21+
type ListResult struct {
2222
gophercloud.Result
2323
}
2424

25-
// Extract interprets any listResult as an array of MeterListResult
26-
func (r listResult) Extract() ([]MeterListResult, error) {
25+
// Extract interprets any ListResult as an array of Meter
26+
func (r ListResult) Extract() ([]Meter, error) {
2727
if r.Err != nil {
2828
return nil, r.Err
2929
}
3030

31-
var response []MeterListResult
31+
var response []Meter
3232

3333
config := &mapstructure.DecoderConfig{
3434
DecodeHook: toMapFromString,
@@ -47,7 +47,7 @@ func (r listResult) Extract() ([]MeterListResult, error) {
4747
return response, nil
4848
}
4949

50-
type MeterStatisticsResult struct {
50+
type Statistics struct {
5151
Avg float32 `json:"avg"`
5252
Count int `json:"count"`
5353
Duration float32 `json:"duration"`
@@ -62,17 +62,17 @@ type MeterStatisticsResult struct {
6262
Unit string `json:"unit"`
6363
}
6464

65-
type statisticsResult struct {
65+
type StatisticsResult struct {
6666
gophercloud.Result
6767
}
6868

6969
// Extract interprets any serverResult as a Server, if possible.
70-
func (r statisticsResult) Extract() ([]MeterStatisticsResult, error) {
70+
func (r StatisticsResult) Extract() ([]Statistics, error) {
7171
if r.Err != nil {
7272
return nil, r.Err
7373
}
7474

75-
var response []MeterStatisticsResult
75+
var response []Statistics
7676

7777
config := &mapstructure.DecoderConfig{
7878
DecodeHook: toMapFromString,

0 commit comments

Comments
 (0)