-
Notifications
You must be signed in to change notification settings - Fork 96
/
app_node.go
42 lines (37 loc) · 1.29 KB
/
app_node.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
package db
// AppNodeAgentView ..
type AppNodeAgentView struct {
HostName string `json:"host_name"`
IPPort string `json:"ip"`
}
// AppNode ..
type AppNode struct {
ID int `json:"id" gorm:"not null;column:id"` // id类型?
AppName string `json:"app_name" gorm:"not null;column:app_name"`
Aid int `json:"aid" gorm:"not null;column:aid"` // id类型?
HostName string `json:"host_name" gorm:"not null;column:host_name"`
IP string `json:"ip" gorm:"not null;column:ip;index"`
DeviceID int `json:"device_id" gorm:"not null;column:device_id"`
Env string `json:"env" gorm:"not null"`
RegionCode string `json:"region_code" gorm:"not null"`
RegionName string `json:"region_name" gorm:"not null"`
ZoneCode string `json:"zone_code" gorm:"not null"`
ZoneName string `json:"zone_name" gorm:"not null"`
CreateTime int64 `gorm:"not null;" json:"create_time"`
UpdateTime int64 `gorm:"not null;" json:"update_time"`
}
// TableName ..
func (t *AppNode) TableName() string {
return "app_node"
}
// AppNodeMap ..
type AppNodeMap struct {
ID int `json:"id"`
Aid int `json:"aid"`
AppName string `json:"app_name"`
MD5 string `json:"md5"` // 由md5(app_name+deviceIDs)
}
// TableName ..
func (a *AppNodeMap) TableName() string {
return "app_node_map"
}