2020-04-29 19:57:53 +02:00
|
|
|
package containers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Container struct {
|
|
|
|
ID string
|
|
|
|
Status string
|
|
|
|
Image string
|
|
|
|
Command string
|
|
|
|
CpuTime uint64
|
|
|
|
MemoryUsage uint64
|
|
|
|
MemoryLimit uint64
|
|
|
|
PidsCurrent uint64
|
|
|
|
PidsLimit uint64
|
|
|
|
Labels []string
|
|
|
|
}
|
|
|
|
|
2020-05-01 15:28:44 +02:00
|
|
|
type Port struct {
|
2020-05-01 16:03:33 +02:00
|
|
|
Source uint32
|
|
|
|
Destination uint32
|
2020-05-01 15:28:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type ContainerConfig struct {
|
|
|
|
ID string
|
|
|
|
Image string
|
|
|
|
Ports []Port
|
|
|
|
}
|
|
|
|
|
2020-04-29 19:57:53 +02:00
|
|
|
type ContainerService interface {
|
|
|
|
List(context.Context) ([]Container, error)
|
2020-05-01 15:28:44 +02:00
|
|
|
Run(context.Context, ContainerConfig) error
|
2020-04-29 19:57:53 +02:00
|
|
|
}
|