-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel.go
40 lines (35 loc) · 1.49 KB
/
model.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
package carrier
import (
"time"
)
// Config model for carrier services
type Config struct {
Gorilla GorillaConfigModel `json:"gorilla,omitempty"`
Eclipse EclipseConfigModel `json:"eclipse,omitempty"`
CustomMail CustomMailConfigModel `json:"customMail,omitempty"`
}
// GorillaConfigModel connection config model
type GorillaConfigModel struct {
Scheme string `json:"scheme"`
URL string `json:"url"`
Channel string `json:"channel"`
RecIntervalMin time.Duration `json:"recIntervalMin"` // RecIntervalMin specifies the initial reconnecting interval, example: 2 * time.Second (2 seconds)
RecIntervalMax time.Duration `json:"recIntervalMax"` // RecIntervalMax specifies the maximum reconnecting interval, example: 30 * time.Second (30 seconds)
RecIntervalFactor float64 `json:"recIntervalFactor"` // RecIntervalFactor specifies the rate of increase of the reconnection interval, example: 0.5 * time.Second (0.5 seconds)
}
// EclipseConfigModel connection config model
type EclipseConfigModel struct {
ClientID string `json:"clientID"`
URL string `json:"url"`
Username string `json:"username"`
Password string `json:"password"`
}
// CustomMailConfigModel connection config model
type CustomMailConfigModel struct {
PoolSize int `json:"poolSize"`
Host string `json:"host"`
Port string `json:"port"`
Identity string `json:"identity"`
Username string `json:"username"`
Password string `json:"password"`
}