-
Notifications
You must be signed in to change notification settings - Fork 2
/
struct.go
170 lines (142 loc) · 5.78 KB
/
struct.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
package main
// RedisConfig define redis-config
type RedisConfig struct {
Port string `json:"port"`
Bind string `json:"bind"`
Unixsocket string `json:"unixsocket"`
Unixsocketperm string `json:"unixsocketperm"`
Daemonize string `json:"daemonize"`
Pidfile string `json:"pidfile"`
TcpBacklog string `json:"tcp-backlog"`
TcpKeepalive string `json:"tcp-keepalive"`
Timeout string `json:"timeout"`
Databases string `json:"databases"`
Loglevel string `json:"loglevel"`
Logfile string `json:"logfile"`
Dbfilename string `json:"dbfilename"`
Dir string `json:"dir"`
Save string `json:"save"`
StopWritesOnBgSaveError string `json:"stop-writes-on-bgsave-error"`
Rdbcompression string `json:"rdbcompression"`
Rdbchecksum string `json:"rdbchecksum"`
Slaveof string `json:"slaveof"`
Masterauth string `json:"masterauth"`
SlaveServeStaleData string `json:"slave-serve-stale-data"`
SlaveReadOnly string `json:"slave-read-only"`
ReplDiskLessSync string `json:"repl-diskless-sync"`
ReplDisklessSyncDelay string `json:"repl-diskless-sync-delay"`
ReplPingSlavePeriod string `json:"repl-ping-slave-period"`
ReplTimeout string `json:"repl-timeout"`
ReplDisableTcpNodelay string `json:"repl-disable-tcp-nodelay"`
ReplBacklogSize string `json:"repl-backlog-size"`
ReplBacklogTtl string `json:"repl-backlog-ttl"`
SlavePriority string `json:"slave-priority"`
MinSlavesToWrite string `json:"min-slaves-to-write"`
MinSlavesMaxLag string `json:"min-slaves-max-lag"`
Requirepass string `json:"requirepass"`
MaxClients string `json:"maxclients"`
Maxmemory string `json:"maxmemory"`
MaxmemoryPolicy string `json:"maxmemory-policy"`
MaxmemorySamples string `json:"maxmemory-samples"`
AppendonlySamples string `json:"appendonly-samples"`
AppendfsyncSamples string `json:"appendfsync-samples"`
NoAppendFsyncOnRewrite string `json:"no-appendfsync-on-rewrite"`
AutoAofRewritePercentage string `json:"auto-aof-rewrite-percentage"`
AutoAofRewriteMinSize string `json:"auto-aof-rewrite-min-size"`
AofLoadTruncated string `json:"aof-load-truncated"`
LuaTimeLimit string `json:"lua-time-limit"`
ClusterNodeTimeout string `json:"cluster-node-timeout"`
ClusterSlaveValidityFactor string `json:"cluster-slave-validity-factor"`
ClusterMigrationBarrier string `json:"cluster-migration-barrier"`
ClusterRequireFullCoverage string `json:"cluster-require-full-coverage"`
SlowlogLogSlowerThan string `json:"slowlog-log-slower-than"`
SlowlogMaxLen string `json:"slowlog-max-len"`
LatencyMonitorThreshold string `json:"latency-monitor-threshold"`
NotifyKeyspaceEvents string `json:"notify-keyspace-events"`
HashMaxZiplistEntries string `json:"hash-max-ziplist-entries"`
HashMaxZiplistValue string `json:"hash-max-ziplist-value"`
SetMaxIntsetEntries string `json:"set-max-intset-entries"`
ZsetMaxZiplistEntries string `json:"zset-max-ziplist-entries"`
ZsetMaxZiplistValue string `json:"zset-max-ziplist-value"`
HllSparseMaxBytes string `json:"hll-sparse-max-bytes"`
Activerehashing string `json:"activerehashing"`
ClientOutputBufferLimit string `json:"client-output-buffer-limit"`
Hz string `json:"hz"`
AofRewriteIncrementalFsync string `json:"aof-rewrite-incremental-fsync"`
}
// ConfigInfo style of redisvo.toml
type ConfigInfo struct {
ServerAddress string `toml:"server_address"`
AuthInfo Auth `toml:"auth_info"`
ServerInfo []Info `toml:"server_info"`
}
// Auth authentic struct
type Auth struct {
Admin string `toml:"admin"`
Password string `toml:"password"`
Enable int `toml:"enable"`
}
//Info field of configInfo struct
type Info struct {
Name string `toml:"name"`
Host string `toml:"host"`
Port string `toml:"port"`
Auth string `toml:"auth"`
}
// ServerExtInfoIncVersion include version info and redis-server info
type ServerExtInfoIncVersion struct {
NowVersion string `json:"now_version"`
UpdateVersion string `json:"update_version"`
IsUpdateVersion bool `json:"is_update_version"`
ServerExtInfos []ServerExtInfo `json:"server_ext_infos"`
}
// ServerExtInfo include redis-server info
type ServerExtInfo struct {
ServerAddr string `json:"serveraddr"`
UserMemory string `json:"user_memory"`
ClientOnline string `json:"client_online"`
ExeCommand string `json:"exe_command"`
RedisVer string `json:"redis_verion"`
KeyNumber string `json:"key_number"`
}
// RedisTypeName type and name of key
type RedisTypeName struct {
TypeNames []TypeName `json:"typename"`
KeysNamesWithType struct {
KeysNames []KeyName `json:"keysname"`
SelfTypeName TypeName `json:"selftypename"`
} `json:"keysnameswithtype"`
Contents string `json:"content"`
}
// RedisKeyName json style response of http request
type RedisKeyName struct {
KeysNamesWithType struct {
KeysNames []KeyName `json:"keysname"`
SelfTypeName TypeName `json:"selftypename"`
} `json:"keysnameswithtype"`
Contents string `json:"content"`
}
// TypeName describe type and name of key
type TypeName struct {
Type string `json:"type"`
Name string `json:"name"`
}
// KeyName describe information of field
type KeyName struct {
Name string `json:"name"`
Score int `json:"score"`
}
// MonitorInfo describe monitor push style of message
type MonitorInfo struct {
Message string `json:"message"`
Err error `json:"err"`
}
// Int64Slice descrbie []int64
type Int64Slice []int64
type StringSlice []string
type TypeNames []TypeName
type KeyNameSlice []KeyName
// UpdateTags define the tag of versions control.
type UpdateTags []struct {
Name string `json:"name"`
}