-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstructnetwork.go
66 lines (56 loc) · 1.1 KB
/
structnetwork.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
package main
import (
"fmt"
"math/rand"
"strconv"
)
type Date struct{
day int
month int
year int
}
type Config struct{
subnet string
gateway string
}
type ConfigFrom struct{
network string
}
type IPAM struct{
driver string
options string
config [2]Config
}
type Network struct{
name string
id string
created Date
scope string
driver string
enableIPv6 bool
ipam IPAM
internal bool
attachable bool
ingress bool
configFrom ConfigFrom
configOnly bool
containers string
options string
labels string
}
func main() {
var config [2]Config
for i:=0;i<len(config);i++ {
config[i] = Config{"172.20.0.0/16"+strconv.Itoa(rand.Int()),
"172.20.0.1"+strconv.Itoa(rand.Int())}
}
ipam:=IPAM{"default","",config}
configFrom:=ConfigFrom{""}
network:=Network{"virtusa_network","fa3d377e197ab5eec3e44951b1f3de60b906c1924d06ab7fe20349874dd7707e",
Date{11,11,2020},"local","bridge",
false,ipam,false,false,false,
configFrom,false,"","",""}
fmt.Println(network)
fmt.Printf("Netowrk Details %+v",network)
fmt.Println("\nEnableIPV6 Status",network.enableIPv6)
}