-
Notifications
You must be signed in to change notification settings - Fork 0
/
recipients.go
55 lines (50 loc) · 1.44 KB
/
recipients.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
package axisevents
type RecipientsHandler struct {
collector collector
}
// HTTP get request.
func (h *RecipientsHandler) HTTP(
url string,
username string,
password string,
proxy string,
proxyPort string,
proxyUsername string,
proxyPassword string,
qos string) Command {
h.collector.properties["upload_url"] = url
h.collector.properties["login"] = username
h.collector.properties["password"] = password
h.collector.properties["proxy_host"] = proxy
h.collector.properties["proxy_port"] = proxyPort
h.collector.properties["proxy_login"] = proxyUsername
h.collector.properties["proxy_password"] = proxyPassword
h.collector.properties["qos"] = qos
return &command{collector: h.collector}
}
// HTTP get request.
func (h *RecipientsHandler) HTTPS(
url string,
validateServerCert bool,
username string,
password string,
proxy string,
proxyPort string,
proxyUsername string,
proxyPassword string,
qos string) Command {
cert := 0
if validateServerCert {
cert = 1
}
h.collector.properties["upload_url"] = url
h.collector.properties["validate_server_cert"] = cert
h.collector.properties["login"] = username
h.collector.properties["password"] = password
h.collector.properties["proxy_host"] = proxy
h.collector.properties["proxy_port"] = proxyPort
h.collector.properties["proxy_login"] = proxyUsername
h.collector.properties["proxy_password"] = proxyPassword
h.collector.properties["qos"] = qos
return &command{collector: h.collector}
}