generated from ConduitIO/conduit-connector-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
paramgen_src.go
59 lines (56 loc) · 2.36 KB
/
paramgen_src.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
// Code generated by paramgen. DO NOT EDIT.
// Source: github.com/ConduitIO/conduit-connector-sdk/tree/main/cmd/paramgen
package http
import (
sdk "github.com/conduitio/conduit-connector-sdk"
)
func (SourceConfig) Parameters() map[string]sdk.Parameter {
return map[string]sdk.Parameter{
"headers": {
Default: "",
Description: "Http headers to use in the request, comma separated list of : separated pairs",
Type: sdk.ParameterTypeString,
Validations: []sdk.Validation{},
},
"method": {
Default: "GET",
Description: "Http method to use in the request",
Type: sdk.ParameterTypeString,
Validations: []sdk.Validation{
sdk.ValidationInclusion{List: []string{"GET", "HEAD", "OPTIONS"}},
},
},
"params.*": {
Default: "",
Description: "parameters to use in the request, use params.* as the config key and specify its value, ex: set \"params.id\" as \"1\".",
Type: sdk.ParameterTypeString,
Validations: []sdk.Validation{},
},
"pollingPeriod": {
Default: "5m",
Description: "how often the connector will get data from the url",
Type: sdk.ParameterTypeDuration,
Validations: []sdk.Validation{},
},
"script.getRequestData": {
Default: "",
Description: "The path to a .js file containing the code to prepare the request data. The signature of the function needs to be: `function getRequestData(cfg, previousResponse, position)` where: * `cfg` (a map) is the connector configuration * `previousResponse` (a map) contains data from the previous response (if any), returned by `parseResponse` * `position` (a byte array) contains the starting position of the connector. The function needs to return a Request object.",
Type: sdk.ParameterTypeString,
Validations: []sdk.Validation{},
},
"script.parseResponse": {
Default: "",
Description: "The path to a .js file containing the code to parse the response. The signature of the function needs to be: `function parseResponse(bytes)` where `bytes` are the original response's raw bytes (i.e. unparsed). The response should be a Response object.",
Type: sdk.ParameterTypeString,
Validations: []sdk.Validation{},
},
"url": {
Default: "",
Description: "Http url to send requests to",
Type: sdk.ParameterTypeString,
Validations: []sdk.Validation{
sdk.ValidationRequired{},
},
},
}
}