123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- package docker
- import "strings"
- type APIHistory struct {
- ID string `json:"Id"`
- Tags []string `json:",omitempty"`
- Created int64
- CreatedBy string `json:",omitempty"`
- Size int64
- }
- type APIImages struct {
- ID string `json:"Id"`
- RepoTags []string `json:",omitempty"`
- Created int64
- Size int64
- VirtualSize int64
- ParentId string `json:",omitempty"`
- }
- type APIImagesOld struct {
- Repository string `json:",omitempty"`
- Tag string `json:",omitempty"`
- ID string `json:"Id"`
- Created int64
- Size int64
- VirtualSize int64
- }
- func (self *APIImages) ToLegacy() []APIImagesOld {
- outs := []APIImagesOld{}
- for _, repotag := range self.RepoTags {
- components := strings.SplitN(repotag, ":", 2)
- outs = append(outs, APIImagesOld{
- ID: self.ID,
- Repository: components[0],
- Tag: components[1],
- Created: self.Created,
- Size: self.Size,
- VirtualSize: self.VirtualSize,
- })
- }
- return outs
- }
- type APIInfo struct {
- Debug bool
- Containers int
- Images int
- Driver string `json:",omitempty"`
- DriverStatus [][2]string `json:",omitempty"`
- NFd int `json:",omitempty"`
- NGoroutines int `json:",omitempty"`
- MemoryLimit bool `json:",omitempty"`
- SwapLimit bool `json:",omitempty"`
- IPv4Forwarding bool `json:",omitempty"`
- LXCVersion string `json:",omitempty"`
- NEventsListener int `json:",omitempty"`
- KernelVersion string `json:",omitempty"`
- IndexServerAddress string `json:",omitempty"`
- }
- type APITop struct {
- Titles []string
- Processes [][]string
- }
- type APIRmi struct {
- Deleted string `json:",omitempty"`
- Untagged string `json:",omitempty"`
- }
- type APIContainers struct {
- ID string `json:"Id"`
- Image string
- Command string
- Created int64
- Status string
- Ports []APIPort
- SizeRw int64
- SizeRootFs int64
- Names []string
- }
- func (self *APIContainers) ToLegacy() APIContainersOld {
- return APIContainersOld{
- ID: self.ID,
- Image: self.Image,
- Command: self.Command,
- Created: self.Created,
- Status: self.Status,
- Ports: displayablePorts(self.Ports),
- SizeRw: self.SizeRw,
- SizeRootFs: self.SizeRootFs,
- }
- }
- type APIContainersOld struct {
- ID string `json:"Id"`
- Image string
- Command string
- Created int64
- Status string
- Ports string
- SizeRw int64
- SizeRootFs int64
- }
- type APIID struct {
- ID string `json:"Id"`
- }
- type APIRun struct {
- ID string `json:"Id"`
- Warnings []string `json:",omitempty"`
- }
- type APIPort struct {
- PrivatePort int64
- PublicPort int64
- Type string
- IP string
- }
- type APIVersion struct {
- Version string
- GitCommit string `json:",omitempty"`
- GoVersion string `json:",omitempty"`
- }
- type APIWait struct {
- StatusCode int
- }
- type APIAuth struct {
- Status string
- }
- type APIImageConfig struct {
- ID string `json:"Id"`
- *Config
- }
- type APICopy struct {
- Resource string
- HostPath string
- }
|