forked from TarsCloud/TarsGo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.go
executable file
·95 lines (86 loc) · 1.98 KB
/
config.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
package tars
import (
"time"
"github.com/TarsCloud/TarsGo/tars/util/endpoint"
)
var svrCfg *serverConfig
var cltCfg *clientConfig
// GetServerConfig Get server config
func GetServerConfig() *serverConfig {
Init()
return svrCfg
}
// GetClientConfig Get client config
func GetClientConfig() *clientConfig {
Init()
return cltCfg
}
type adapterConfig struct {
Endpoint endpoint.Endpoint
Protocol string
Obj string
Threads int
}
type serverConfig struct {
Node string
App string
Server string
LogPath string
LogSize uint64
LogNum uint64
LogLevel string
Version string
LocalIP string
Local string
BasePath string
DataPath string
Config string
Notify string
Log string
Adapters map[string]adapterConfig
Container string
Isdocker bool
Enableset bool
Setdivision string
//add server timeout
AcceptTimeout time.Duration
ReadTimeout time.Duration
WriteTimeout time.Duration
HandleTimeout time.Duration
IdleTimeout time.Duration
ZombileTimeout time.Duration
QueueCap int
//add tcp config
TCPReadBuffer int
TCPWriteBuffer int
TCPNoDelay bool
//add routine number
MaxInvoke int32
//add adapter & report config
PropertyReportInterval time.Duration
StatReportInterval time.Duration
MainLoopTicker time.Duration
StatReportChannelBufLen int32
MaxPackageLength int
GracedownTimeout time.Duration
}
type clientConfig struct {
Locator string
Stat string
Property string
Modulename string
RefreshEndpointInterval int
ReportInterval int
CheckStatusInterval int
AsyncInvokeTimeout int
//add client timeout
ClientQueueLen int
ClientIdleTimeout time.Duration
ClientReadTimeout time.Duration
ClientWriteTimeout time.Duration
ClientDialTimeout time.Duration
ReqDefaultTimeout int32
ObjQueueMax int32
AdapterProxyTicker time.Duration
AdapterProxyResetCount int
}