Skip to content

Commit 20c34ef

Browse files
authored
Merge pull request #6292 from thaJeztah/28.x_backport_deprecate_opts
[28.x backport] opts: deprecate NewNamedListOptsRef, NewNamedMapOpts
2 parents 34a90bd + 7ccd6d2 commit 20c34ef

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

opts/opts.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,17 @@ func (opts *ListOpts) WithValidator(validator ValidatorFctType) *ListOpts {
134134

135135
// NamedOption is an interface that list and map options
136136
// with names implement.
137+
//
138+
// Deprecated: NamedOption is no longer used and will be removed in the next release.
137139
type NamedOption interface {
138140
Name() string
139141
}
140142

141143
// NamedListOpts is a ListOpts with a configuration name.
142144
// This struct is useful to keep reference to the assigned
143145
// field name in the internal configuration struct.
146+
//
147+
// Deprecated: NamedListOpts is no longer used and will be removed in the next release.
144148
type NamedListOpts struct {
145149
name string
146150
ListOpts
@@ -149,6 +153,8 @@ type NamedListOpts struct {
149153
var _ NamedOption = &NamedListOpts{}
150154

151155
// NewNamedListOptsRef creates a reference to a new NamedListOpts struct.
156+
//
157+
// Deprecated: NewNamedListOptsRef is no longer used and will be removed in the next release.
152158
func NewNamedListOptsRef(name string, values *[]string, validator ValidatorFctType) *NamedListOpts {
153159
return &NamedListOpts{
154160
name: name,
@@ -157,6 +163,8 @@ func NewNamedListOptsRef(name string, values *[]string, validator ValidatorFctTy
157163
}
158164

159165
// Name returns the name of the NamedListOpts in the configuration.
166+
//
167+
// Deprecated: NamedListOpts is no longer used and will be removed in the next release.
160168
func (o *NamedListOpts) Name() string {
161169
return o.name
162170
}
@@ -210,6 +218,8 @@ func NewMapOpts(values map[string]string, validator ValidatorFctType) *MapOpts {
210218
// NamedMapOpts is a MapOpts struct with a configuration name.
211219
// This struct is useful to keep reference to the assigned
212220
// field name in the internal configuration struct.
221+
//
222+
// Deprecated: NamedMapOpts is no longer used and will be removed in the next release.
213223
type NamedMapOpts struct {
214224
name string
215225
MapOpts
@@ -218,6 +228,8 @@ type NamedMapOpts struct {
218228
var _ NamedOption = &NamedMapOpts{}
219229

220230
// NewNamedMapOpts creates a reference to a new NamedMapOpts struct.
231+
//
232+
// Deprecated: NamedMapOpts is no longer used and will be removed in the next release.
221233
func NewNamedMapOpts(name string, values map[string]string, validator ValidatorFctType) *NamedMapOpts {
222234
return &NamedMapOpts{
223235
name: name,
@@ -226,6 +238,8 @@ func NewNamedMapOpts(name string, values map[string]string, validator ValidatorF
226238
}
227239

228240
// Name returns the name of the NamedMapOpts in the configuration.
241+
//
242+
// Deprecated: NamedMapOpts is no longer used and will be removed in the next release.
229243
func (o *NamedMapOpts) Name() string {
230244
return o.name
231245
}

0 commit comments

Comments
 (0)