31 lines
599 B
Go
31 lines
599 B
Go
package models
|
|
|
|
import (
|
|
"github.com/containers/podman/v4/pkg/domain/entities"
|
|
)
|
|
|
|
type ContainerStatus int
|
|
|
|
const (
|
|
StopContainer ContainerStatus = iota
|
|
StartContainer
|
|
RestartContainer
|
|
)
|
|
|
|
type PodmanService interface {
|
|
List() ([]entities.ListContainer, error)
|
|
Create(ContainerBlueprint) error
|
|
Delete(string) error
|
|
UpdateStatus(string, string) error
|
|
}
|
|
|
|
type PortMapping struct {
|
|
ContainerPort uint16 `json:"containerPort"`
|
|
HostPort uint16 `json:"hostPort"`
|
|
}
|
|
|
|
type ContainerBlueprint struct {
|
|
Image string `json:"image"`
|
|
PortMapping []PortMapping `json:"portMapping"`
|
|
}
|