forked from yunionio/kubecomps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
47 lines (41 loc) · 1.22 KB
/
types.go
File metadata and controls
47 lines (41 loc) · 1.22 KB
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
package plugin
import "fmt"
type PodDesc struct {
Id string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
Nics []PodNic `json:"nics"`
}
const (
POD_NIC_PROVIDER_OVN = "ovn"
)
type PodNicVpc struct {
Id string `json:"id"`
MappedIpAddr string `json:"mapped_ip_addr"`
Provider string `json:"provider"`
}
type PodNic struct {
Index int `json:"index"`
Bridge string `json:"bridge"`
Ifname string `json:"ifname"`
Interface string `json:"interface"`
Ip string `json:"ip"`
Ip6 string `json:"ip6"`
Mac string `json:"mac"`
Gateway string `json:"gateway"`
Gateway6 string `json:"gateway6"`
Bandwidth int `json:"bw"`
Dns string `json:"dns"`
Mtu int `json:"mtu"`
Masklen int `json:"masklen,omitempty"`
Masklen6 int `json:"masklen6,omitempty"`
Domain string `json:"domain,omitempty"`
NetId string `json:"net_id"`
WireId string `json:"wire_id"`
Vlan int `json:"vlan"`
Vpc *PodNicVpc `json:"vpc,omitempty"`
}
func (n PodNic) GetInterface(idx int) string {
defaultName := fmt.Sprintf("eth%d", idx)
return defaultName
}