-
Notifications
You must be signed in to change notification settings - Fork 246
/
zz_generated.query_options.go
84 lines (73 loc) · 3.19 KB
/
zz_generated.query_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
// Code generated by github.com/ecordell/optgen. DO NOT EDIT.
package options
import (
defaults "github.com/creasty/defaults"
helpers "github.com/ecordell/optgen/helpers"
"time"
)
type ExperimentalServerOptionsOption func(e *ExperimentalServerOptions)
// NewExperimentalServerOptionsWithOptions creates a new ExperimentalServerOptions with the passed in options set
func NewExperimentalServerOptionsWithOptions(opts ...ExperimentalServerOptionsOption) *ExperimentalServerOptions {
e := &ExperimentalServerOptions{}
for _, o := range opts {
o(e)
}
return e
}
// NewExperimentalServerOptionsWithOptionsAndDefaults creates a new ExperimentalServerOptions with the passed in options set starting from the defaults
func NewExperimentalServerOptionsWithOptionsAndDefaults(opts ...ExperimentalServerOptionsOption) *ExperimentalServerOptions {
e := &ExperimentalServerOptions{}
defaults.MustSet(e)
for _, o := range opts {
o(e)
}
return e
}
// ToOption returns a new ExperimentalServerOptionsOption that sets the values from the passed in ExperimentalServerOptions
func (e *ExperimentalServerOptions) ToOption() ExperimentalServerOptionsOption {
return func(to *ExperimentalServerOptions) {
to.StreamReadTimeout = e.StreamReadTimeout
to.DefaultExportBatchSize = e.DefaultExportBatchSize
to.MaxExportBatchSize = e.MaxExportBatchSize
}
}
// DebugMap returns a map form of ExperimentalServerOptions for debugging
func (e ExperimentalServerOptions) DebugMap() map[string]any {
debugMap := map[string]any{}
debugMap["StreamReadTimeout"] = helpers.DebugValue(e.StreamReadTimeout, false)
debugMap["DefaultExportBatchSize"] = helpers.DebugValue(e.DefaultExportBatchSize, false)
debugMap["MaxExportBatchSize"] = helpers.DebugValue(e.MaxExportBatchSize, false)
return debugMap
}
// ExperimentalServerOptionsWithOptions configures an existing ExperimentalServerOptions with the passed in options set
func ExperimentalServerOptionsWithOptions(e *ExperimentalServerOptions, opts ...ExperimentalServerOptionsOption) *ExperimentalServerOptions {
for _, o := range opts {
o(e)
}
return e
}
// WithOptions configures the receiver ExperimentalServerOptions with the passed in options set
func (e *ExperimentalServerOptions) WithOptions(opts ...ExperimentalServerOptionsOption) *ExperimentalServerOptions {
for _, o := range opts {
o(e)
}
return e
}
// WithStreamReadTimeout returns an option that can set StreamReadTimeout on a ExperimentalServerOptions
func WithStreamReadTimeout(streamReadTimeout time.Duration) ExperimentalServerOptionsOption {
return func(e *ExperimentalServerOptions) {
e.StreamReadTimeout = streamReadTimeout
}
}
// WithDefaultExportBatchSize returns an option that can set DefaultExportBatchSize on a ExperimentalServerOptions
func WithDefaultExportBatchSize(defaultExportBatchSize uint32) ExperimentalServerOptionsOption {
return func(e *ExperimentalServerOptions) {
e.DefaultExportBatchSize = defaultExportBatchSize
}
}
// WithMaxExportBatchSize returns an option that can set MaxExportBatchSize on a ExperimentalServerOptions
func WithMaxExportBatchSize(maxExportBatchSize uint32) ExperimentalServerOptionsOption {
return func(e *ExperimentalServerOptions) {
e.MaxExportBatchSize = maxExportBatchSize
}
}