-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconnector.go
98 lines (96 loc) · 2.21 KB
/
connector.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
package nats
import (
"github.com/kubemq-hub/builder/connector/common"
)
func Connector() *common.Connector {
return common.NewConnector().
SetKind("messaging.nats").
SetDescription("nats source properties").
SetName("NATS").
SetProvider("").
SetCategory("Messaging").
SetTags("queue", "pub/sub").
AddProperty(
common.NewProperty().
SetKind("string").
SetName("url").
SetTitle("URL Address").
SetDescription("Set nats url connection").
SetMust(true),
).
AddProperty(
common.NewProperty().
SetKind("string").
SetName("subject").
SetDescription("Set subject").
SetMust(true).
SetDefault(""),
).
AddProperty(
common.NewProperty().
SetKind("string").
SetName("username").
SetDescription("Set Username").
SetMust(false).
SetDefault(""),
).
AddProperty(
common.NewProperty().
SetKind("string").
SetName("password").
SetDescription("Set Password").
SetMust(false).
SetDefault(""),
).
AddProperty(
common.NewProperty().
SetKind("string").
SetName("token").
SetDescription("Set token").
SetMust(false).
SetDefault(""),
).
AddProperty(
common.NewProperty().
SetKind("bool").
SetName("tls").
SetTitle("TLS").
SetDescription("Set if use tls").
SetMust(false).
SetDefault("false"),
).
AddProperty(
common.NewProperty().
SetKind("bool").
SetName("dynamic_mapping").
SetDescription("Set Subject/Channel dynamic mapping").
SetMust(true).
SetDefault("false"),
).
AddProperty(
common.NewProperty().
SetKind("condition").
SetName("tls").
SetTitle("TLS").
SetOptions([]string{"true", "false"}).
SetDescription("Set tls conditions").
SetMust(true).
SetDefault("false").
NewCondition("true", []*common.Property{
common.NewProperty().
SetKind("multilines").
SetName("cert_key").
SetTitle("Certificate Key").
SetDescription("Set certificate key").
SetMust(false).
SetDefault(""),
common.NewProperty().
SetKind("multilines").
SetName("cert_file").
SetTitle("Certificate File").
SetDescription("Set certificate file").
SetMust(false).
SetDefault(""),
}),
)
}