Skip to content

Commit c82ea59

Browse files
authored
feat: make ListOpts.Values method public (#285)
1 parent b8a0c24 commit c82ea59

18 files changed

+19
-18
lines changed

hcloud/action.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ type ActionListOpts struct {
102102
}
103103

104104
func (l ActionListOpts) values() url.Values {
105-
vals := l.ListOpts.values()
105+
vals := l.ListOpts.Values()
106106
for _, id := range l.ID {
107107
vals.Add("id", fmt.Sprintf("%d", id))
108108
}

hcloud/certificate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ type CertificateListOpts struct {
142142
}
143143

144144
func (l CertificateListOpts) values() url.Values {
145-
vals := l.ListOpts.values()
145+
vals := l.ListOpts.Values()
146146
if l.Name != "" {
147147
vals.Add("name", l.Name)
148148
}

hcloud/client.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,8 @@ type ListOpts struct {
445445
LabelSelector string // Label selector for filtering by labels
446446
}
447447

448-
func (l ListOpts) values() url.Values {
448+
// Values returns the ListOpts as URL values.
449+
func (l ListOpts) Values() url.Values {
449450
vals := url.Values{}
450451
if l.Page > 0 {
451452
vals.Add("page", strconv.Itoa(l.Page))

hcloud/datacenter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ type DatacenterListOpts struct {
7676
}
7777

7878
func (l DatacenterListOpts) values() url.Values {
79-
vals := l.ListOpts.values()
79+
vals := l.ListOpts.Values()
8080
if l.Name != "" {
8181
vals.Add("name", l.Name)
8282
}

hcloud/firewall.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ type FirewallListOpts struct {
140140
}
141141

142142
func (l FirewallListOpts) values() url.Values {
143-
vals := l.ListOpts.values()
143+
vals := l.ListOpts.Values()
144144
if l.Name != "" {
145145
vals.Add("name", l.Name)
146146
}

hcloud/floating_ip.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ type FloatingIPListOpts struct {
141141
}
142142

143143
func (l FloatingIPListOpts) values() url.Values {
144-
vals := l.ListOpts.values()
144+
vals := l.ListOpts.Values()
145145
if l.Name != "" {
146146
vals.Add("name", l.Name)
147147
}

hcloud/image.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ type ImageListOpts struct {
163163
}
164164

165165
func (l ImageListOpts) values() url.Values {
166-
vals := l.ListOpts.values()
166+
vals := l.ListOpts.Values()
167167
for _, typ := range l.Type {
168168
vals.Add("type", string(typ))
169169
}

hcloud/iso.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ type ISOListOpts struct {
9797
}
9898

9999
func (l ISOListOpts) values() url.Values {
100-
vals := l.ListOpts.values()
100+
vals := l.ListOpts.Values()
101101
if l.Name != "" {
102102
vals.Add("name", l.Name)
103103
}

hcloud/load_balancer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ type LoadBalancerListOpts struct {
287287
}
288288

289289
func (l LoadBalancerListOpts) values() url.Values {
290-
vals := l.ListOpts.values()
290+
vals := l.ListOpts.Values()
291291
if l.Name != "" {
292292
vals.Add("name", l.Name)
293293
}

hcloud/load_balancer_type.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ type LoadBalancerTypeListOpts struct {
7373
}
7474

7575
func (l LoadBalancerTypeListOpts) values() url.Values {
76-
vals := l.ListOpts.values()
76+
vals := l.ListOpts.Values()
7777
if l.Name != "" {
7878
vals.Add("name", l.Name)
7979
}

hcloud/location.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ type LocationListOpts struct {
7373
}
7474

7575
func (l LocationListOpts) values() url.Values {
76-
vals := l.ListOpts.values()
76+
vals := l.ListOpts.Values()
7777
if l.Name != "" {
7878
vals.Add("name", l.Name)
7979
}

hcloud/network.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ type NetworkListOpts struct {
122122
}
123123

124124
func (l NetworkListOpts) values() url.Values {
125-
vals := l.ListOpts.values()
125+
vals := l.ListOpts.Values()
126126
if l.Name != "" {
127127
vals.Add("name", l.Name)
128128
}

hcloud/placement_group.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ type PlacementGroupListOpts struct {
8484
}
8585

8686
func (l PlacementGroupListOpts) values() url.Values {
87-
vals := l.ListOpts.values()
87+
vals := l.ListOpts.Values()
8888
if l.Name != "" {
8989
vals.Add("name", l.Name)
9090
}

hcloud/primary_ip.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ type PrimaryIPListOpts struct {
222222
}
223223

224224
func (l PrimaryIPListOpts) values() url.Values {
225-
vals := l.ListOpts.values()
225+
vals := l.ListOpts.Values()
226226
if l.Name != "" {
227227
vals.Add("name", l.Name)
228228
}

hcloud/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ type ServerListOpts struct {
241241
}
242242

243243
func (l ServerListOpts) values() url.Values {
244-
vals := l.ListOpts.values()
244+
vals := l.ListOpts.Values()
245245
if l.Name != "" {
246246
vals.Add("name", l.Name)
247247
}

hcloud/server_type.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ type ServerTypeListOpts struct {
100100
}
101101

102102
func (l ServerTypeListOpts) values() url.Values {
103-
vals := l.ListOpts.values()
103+
vals := l.ListOpts.Values()
104104
if l.Name != "" {
105105
vals.Add("name", l.Name)
106106
}

hcloud/ssh_key.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ type SSHKeyListOpts struct {
8585
}
8686

8787
func (l SSHKeyListOpts) values() url.Values {
88-
vals := l.ListOpts.values()
88+
vals := l.ListOpts.Values()
8989
if l.Name != "" {
9090
vals.Add("name", l.Name)
9191
}

hcloud/volume.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ type VolumeListOpts struct {
9696
}
9797

9898
func (l VolumeListOpts) values() url.Values {
99-
vals := l.ListOpts.values()
99+
vals := l.ListOpts.Values()
100100
if l.Name != "" {
101101
vals.Add("name", l.Name)
102102
}

0 commit comments

Comments
 (0)