-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconnector.go
85 lines (83 loc) · 1.8 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
package mqtt
import (
"github.com/kubemq-hub/builder/connector/common"
)
func Connector() *common.Connector {
return common.NewConnector().
SetKind("messaging.mqtt").
SetDescription("MQTT Messaging Target").
SetName("MQTT").
SetProvider("").
SetCategory("Messaging").
SetTags("iot", "pub/sub").
AddProperty(
common.NewProperty().
SetKind("string").
SetName("host").
SetTitle("Host Address").
SetDescription("Set MQTT broker host").
SetMust(true).
SetDefault(""),
).
AddProperty(
common.NewProperty().
SetKind("string").
SetName("username").
SetDescription("Set MQTT broker username").
SetMust(false).
SetDefault(""),
).
AddProperty(
common.NewProperty().
SetKind("string").
SetName("password").
SetDescription("Set MQTT broker password").
SetMust(false).
SetDefault(""),
).
AddProperty(
common.NewProperty().
SetKind("string").
SetName("client_id").
SetTitle("Client ID").
SetDescription("Set MQTT broker client id").
SetMust(false).
SetDefault(""),
).
AddProperty(
common.NewProperty().
SetKind("string").
SetName("default_topic").
SetDescription("Set MQTT default topic").
SetDefault("").
SetMust(false),
).
AddProperty(
common.NewProperty().
SetKind("int").
SetName("default_qos").
SetDescription("Set MQTT default qos level").
SetMust(false).
SetMin(0).
SetMax(2).
SetDefault("0"),
).
AddMetadata(
common.NewMetadata().
SetKind("string").
SetName("topic").
SetDescription("Set MQTT topic").
SetDefault("").
SetMust(true),
).
AddMetadata(
common.NewMetadata().
SetKind("int").
SetName("qos").
SetDescription("Set MQTT qos level").
SetMust(true).
SetMin(0).
SetMax(2).
SetDefault("0"),
)
}