-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig_paramgen.go
117 lines (113 loc) · 4.53 KB
/
config_paramgen.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
// Code generated by paramgen. DO NOT EDIT.
// Source: github.com/ConduitIO/conduit-commons/tree/main/paramgen
package generator
import (
"github.com/conduitio/conduit-commons/config"
)
const (
ConfigBurstGenerateTime = "burst.generateTime"
ConfigBurstSleepTime = "burst.sleepTime"
ConfigCollectionsFormatOptions = "collections.*.format.options.*"
ConfigCollectionsFormatOptionsPath = "collections.*.format.options.path"
ConfigCollectionsFormatType = "collections.*.format.type"
ConfigCollectionsOperations = "collections.*.operations"
ConfigFormatOptions = "format.options.*"
ConfigFormatOptionsPath = "format.options.path"
ConfigFormatType = "format.type"
ConfigOperations = "operations"
ConfigRate = "rate"
ConfigReadTime = "readTime"
ConfigRecordCount = "recordCount"
)
func (Config) Parameters() map[string]config.Parameter {
return map[string]config.Parameter{
ConfigBurstGenerateTime: {
Default: "1s",
Description: "The amount of time the generator is generating records in a burst. Has an\neffect only if `burst.sleepTime` is set.",
Type: config.ParameterTypeDuration,
Validations: []config.Validation{},
},
ConfigBurstSleepTime: {
Default: "",
Description: "The time the generator \"sleeps\" between bursts.",
Type: config.ParameterTypeDuration,
Validations: []config.Validation{},
},
ConfigCollectionsFormatOptions: {
Default: "",
Description: "The options for the `raw` and `structured` format types. It accepts pairs\nof field names and field types, where the type can be one of: `int`, `string`, `time`, `bool`, `duration`.",
Type: config.ParameterTypeString,
Validations: []config.Validation{},
},
ConfigCollectionsFormatOptionsPath: {
Default: "",
Description: "Path to the input file (only applicable if the format type is `file`).",
Type: config.ParameterTypeString,
Validations: []config.Validation{},
},
ConfigCollectionsFormatType: {
Default: "",
Description: "The format of the generated payload data (raw, structured, file).",
Type: config.ParameterTypeString,
Validations: []config.Validation{
config.ValidationInclusion{List: []string{"raw", "structured", "file"}},
},
},
ConfigCollectionsOperations: {
Default: "create",
Description: "Comma separated list of record operations to generate. Allowed values are\n\"create\", \"update\", \"delete\", \"snapshot\".",
Type: config.ParameterTypeString,
Validations: []config.Validation{
config.ValidationRequired{},
},
},
ConfigFormatOptions: {
Default: "",
Description: "The options for the `raw` and `structured` format types. It accepts pairs\nof field names and field types, where the type can be one of: `int`, `string`, `time`, `bool`, `duration`.",
Type: config.ParameterTypeString,
Validations: []config.Validation{},
},
ConfigFormatOptionsPath: {
Default: "",
Description: "Path to the input file (only applicable if the format type is `file`).",
Type: config.ParameterTypeString,
Validations: []config.Validation{},
},
ConfigFormatType: {
Default: "",
Description: "The format of the generated payload data (raw, structured, file).",
Type: config.ParameterTypeString,
Validations: []config.Validation{
config.ValidationInclusion{List: []string{"raw", "structured", "file"}},
},
},
ConfigOperations: {
Default: "create",
Description: "Comma separated list of record operations to generate. Allowed values are\n\"create\", \"update\", \"delete\", \"snapshot\".",
Type: config.ParameterTypeString,
Validations: []config.Validation{
config.ValidationRequired{},
},
},
ConfigRate: {
Default: "",
Description: "The maximum rate in records per second, at which records are generated (0\nmeans no rate limit).",
Type: config.ParameterTypeFloat,
Validations: []config.Validation{},
},
ConfigReadTime: {
Default: "",
Description: "The time it takes to 'read' a record.\nDeprecated: use `rate` instead.",
Type: config.ParameterTypeDuration,
Validations: []config.Validation{},
},
ConfigRecordCount: {
Default: "",
Description: "Number of records to be generated (0 means infinite).",
Type: config.ParameterTypeInt,
Validations: []config.Validation{
config.ValidationGreaterThan{V: -1},
},
},
}
}