-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.go
80 lines (70 loc) · 1.38 KB
/
header.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
package httpfsclient
import (
"database/sql"
"os"
"time"
)
const (
StateOk = 0
StateError = 1
)
type JsonResult struct {
State int
Data interface{}
Err error
}
func (r *JsonResult) Error() string {
return r.Err.Error()
}
type FileInfo struct {
Name string
Size int64
Mode os.FileMode
ModeTime time.Time
IsDir bool
RawName string
}
type File struct {
Id int
ServerId int
Path string
Bytes int64
State int
CreateTime int64
Mime sql.NullString
RawName sql.NullString
Backup1 sql.NullInt64
Backup2 sql.NullInt64
}
// type Server struct {
// Id int
// Server string
// Proxy string
// Root string
// Ready bool
// RatedSpace int
// UsedSpace int64
// Backup1 sql.NullInt64
// Backup2 sql.NullInt64
// }
type Server struct {
ClusterId, ServerId string
Local, Proxy string
Ut int64 //update time
RatedSpace int //MB
FreeSpace int //MB
Cpu int //
Mem int //MB
MemFree int
LoadAverage int
available bool //如果ut5分钟内没更新,则不可用
}
func (s Server) Id() string {
if s.ClusterId != "" && s.ServerId != "" {
return s.ClusterId + ":" + s.ServerId
}
return ""
}
type RedisService interface {
HMGetAll(key string, result interface{}) error
}