todo:finish list netns containers
This commit is contained in:
parent
d09608088f
commit
72b2c8d089
@ -3,31 +3,23 @@ package network
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"floares/config"
|
"floares/config"
|
||||||
|
"floares/lib/model"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Inspect struct {
|
type Inspect struct {
|
||||||
Name string `json:"Name"`
|
Name string `json:"Name"`
|
||||||
Id string `json:"Id"`
|
Id string `json:"Id"`
|
||||||
Created time.Time `json:"Created"`
|
Created time.Time `json:"Created"`
|
||||||
Scope string `json:"Scope"`
|
Scope string `json:"Scope"`
|
||||||
Driver string `json:"Driver"`
|
Driver string `json:"Driver"`
|
||||||
EnableIPv6 bool `json:"EnableIPv6"`
|
EnableIPv6 bool `json:"EnableIPv6"`
|
||||||
IPAM struct {
|
IPAM model.IPAM `json:"IPAM"`
|
||||||
Driver string `json:"Driver"`
|
Internal bool `json:"Internal"`
|
||||||
Options struct {
|
Attachable bool `json:"Attachable"`
|
||||||
Driver string `json:"driver"`
|
Ingress bool `json:"Ingress"`
|
||||||
} `json:"Options"`
|
|
||||||
Config []struct {
|
|
||||||
Subnet string `json:"Subnet"`
|
|
||||||
Gateway string `json:"Gateway"`
|
|
||||||
} `json:"Config"`
|
|
||||||
} `json:"IPAM"`
|
|
||||||
Internal bool `json:"Internal"`
|
|
||||||
Attachable bool `json:"Attachable"`
|
|
||||||
Ingress bool `json:"Ingress"`
|
|
||||||
ConfigFrom struct {
|
ConfigFrom struct {
|
||||||
Network string `json:"Network"`
|
Network string `json:"Network"`
|
||||||
} `json:"ConfigFrom"`
|
} `json:"ConfigFrom"`
|
||||||
@ -55,5 +47,6 @@ func GetInspect(ns string) (net Inspect) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = json.NewDecoder(res.Body).Decode(&net)
|
err = json.NewDecoder(res.Body).Decode(&net)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,19 +9,10 @@ type NetWorkJson struct {
|
|||||||
Scope string `json:"Scope"`
|
Scope string `json:"Scope"`
|
||||||
Driver string `json:"Driver"`
|
Driver string `json:"Driver"`
|
||||||
EnableIPv6 bool `json:"EnableIPv6"`
|
EnableIPv6 bool `json:"EnableIPv6"`
|
||||||
IPAM struct {
|
IPAM IPAM `json:"IPAM"`
|
||||||
Driver string `json:"Driver"`
|
Internal bool `json:"Internal"`
|
||||||
Options struct {
|
Attachable bool `json:"Attachable"`
|
||||||
Driver string `json:"driver"`
|
Ingress bool `json:"Ingress"`
|
||||||
} `json:"Options"`
|
|
||||||
Config []struct {
|
|
||||||
Subnet string `json:"Subnet"`
|
|
||||||
Gateway string `json:"Gateway"`
|
|
||||||
} `json:"Config"`
|
|
||||||
} `json:"IPAM"`
|
|
||||||
Internal bool `json:"Internal"`
|
|
||||||
Attachable bool `json:"Attachable"`
|
|
||||||
Ingress bool `json:"Ingress"`
|
|
||||||
ConfigFrom struct {
|
ConfigFrom struct {
|
||||||
Network string `json:"Network"`
|
Network string `json:"Network"`
|
||||||
} `json:"ConfigFrom"`
|
} `json:"ConfigFrom"`
|
||||||
@ -45,3 +36,28 @@ type Config struct {
|
|||||||
Subnet string `json:"subnet"`
|
Subnet string `json:"subnet"`
|
||||||
Gateway string `json:"gateway"`
|
Gateway string `json:"gateway"`
|
||||||
}
|
}
|
||||||
|
type IPAM struct {
|
||||||
|
Driver string `json:"Driver"`
|
||||||
|
Options struct {
|
||||||
|
Driver string `json:"driver"`
|
||||||
|
} `json:"Options"`
|
||||||
|
Config []struct {
|
||||||
|
Subnet string `json:"Subnet"`
|
||||||
|
Gateway string `json:"Gateway"`
|
||||||
|
} `json:"Config"`
|
||||||
|
}
|
||||||
|
type NetworkInspect struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Id string `json:"id"`
|
||||||
|
Created string `json:"created"`
|
||||||
|
Driver string `json:"driver"`
|
||||||
|
|
||||||
|
Ipam Config `json:"ipam"`
|
||||||
|
Containers
|
||||||
|
}
|
||||||
|
type NetConnect struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Id string `json:"id"`
|
||||||
|
Ip string `json:"ip"`
|
||||||
|
Mac string `json:"mac"`
|
||||||
|
}
|
||||||
|
|||||||
BIN
tmp/runner-build
BIN
tmp/runner-build
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user