-
Notifications
You must be signed in to change notification settings - Fork 246
/
zz_generated.options.go
92 lines (80 loc) · 3.02 KB
/
zz_generated.options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// Code generated by github.com/ecordell/optgen. DO NOT EDIT.
package graph
import (
defaults "github.com/creasty/defaults"
helpers "github.com/ecordell/optgen/helpers"
)
type ConcurrencyLimitsOption func(c *ConcurrencyLimits)
// NewConcurrencyLimitsWithOptions creates a new ConcurrencyLimits with the passed in options set
func NewConcurrencyLimitsWithOptions(opts ...ConcurrencyLimitsOption) *ConcurrencyLimits {
c := &ConcurrencyLimits{}
for _, o := range opts {
o(c)
}
return c
}
// NewConcurrencyLimitsWithOptionsAndDefaults creates a new ConcurrencyLimits with the passed in options set starting from the defaults
func NewConcurrencyLimitsWithOptionsAndDefaults(opts ...ConcurrencyLimitsOption) *ConcurrencyLimits {
c := &ConcurrencyLimits{}
defaults.MustSet(c)
for _, o := range opts {
o(c)
}
return c
}
// ToOption returns a new ConcurrencyLimitsOption that sets the values from the passed in ConcurrencyLimits
func (c *ConcurrencyLimits) ToOption() ConcurrencyLimitsOption {
return func(to *ConcurrencyLimits) {
to.Check = c.Check
to.ReachableResources = c.ReachableResources
to.LookupResources = c.LookupResources
to.LookupSubjects = c.LookupSubjects
}
}
// DebugMap returns a map form of ConcurrencyLimits for debugging
func (c ConcurrencyLimits) DebugMap() map[string]any {
debugMap := map[string]any{}
debugMap["Check"] = helpers.DebugValue(c.Check, false)
debugMap["ReachableResources"] = helpers.DebugValue(c.ReachableResources, false)
debugMap["LookupResources"] = helpers.DebugValue(c.LookupResources, false)
debugMap["LookupSubjects"] = helpers.DebugValue(c.LookupSubjects, false)
return debugMap
}
// ConcurrencyLimitsWithOptions configures an existing ConcurrencyLimits with the passed in options set
func ConcurrencyLimitsWithOptions(c *ConcurrencyLimits, opts ...ConcurrencyLimitsOption) *ConcurrencyLimits {
for _, o := range opts {
o(c)
}
return c
}
// WithOptions configures the receiver ConcurrencyLimits with the passed in options set
func (c *ConcurrencyLimits) WithOptions(opts ...ConcurrencyLimitsOption) *ConcurrencyLimits {
for _, o := range opts {
o(c)
}
return c
}
// WithCheck returns an option that can set Check on a ConcurrencyLimits
func WithCheck(check uint16) ConcurrencyLimitsOption {
return func(c *ConcurrencyLimits) {
c.Check = check
}
}
// WithReachableResources returns an option that can set ReachableResources on a ConcurrencyLimits
func WithReachableResources(reachableResources uint16) ConcurrencyLimitsOption {
return func(c *ConcurrencyLimits) {
c.ReachableResources = reachableResources
}
}
// WithLookupResources returns an option that can set LookupResources on a ConcurrencyLimits
func WithLookupResources(lookupResources uint16) ConcurrencyLimitsOption {
return func(c *ConcurrencyLimits) {
c.LookupResources = lookupResources
}
}
// WithLookupSubjects returns an option that can set LookupSubjects on a ConcurrencyLimits
func WithLookupSubjects(lookupSubjects uint16) ConcurrencyLimitsOption {
return func(c *ConcurrencyLimits) {
c.LookupSubjects = lookupSubjects
}
}