-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathini.go
81 lines (64 loc) · 1.3 KB
/
ini.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
package rabbitevents
import "time"
type RabbitIni struct {
host string
username string
password string
notifChannel string
eventChannel string
typingChannel string
connectTimeout time.Duration
}
func (m *RabbitIni) GetHost() string {
if m != nil {
return m.host
}
return ""
}
func (m *RabbitIni) GetUserName() string {
if m != nil {
return m.username
}
return ""
}
func (m *RabbitIni) GetPassword() string {
if m != nil {
return m.password
}
return ""
}
func (m *RabbitIni) GetNotifChannel() string {
if m != nil {
return m.notifChannel
}
return ""
}
func (m *RabbitIni) GetEventChannel() string {
if m != nil {
return m.eventChannel
}
return ""
}
func (m *RabbitIni) GetTypingChannel() string {
if m != nil {
return m.typingChannel
}
return ""
}
func (m *RabbitIni) GetConnectTimeout() time.Duration {
if m != nil {
return m.connectTimeout
}
return time.Second * 30
}
func NewRabbitIni(host, username, password, notifChannel, eventChannel, typingChannel string, connectTimeout time.Duration) *RabbitIni {
return &RabbitIni{
host: host,
username: username,
password: password,
notifChannel: notifChannel,
eventChannel: eventChannel,
typingChannel: typingChannel,
connectTimeout: connectTimeout,
}
}