33 lines
636 B
Go
33 lines
636 B
Go
package podman
|
|
|
|
// Client talks to Podman socket inside a container.
|
|
type Client interface {
|
|
List(ctID string) ([]OCIContainer, error)
|
|
Create(ctID string, spec CreateSpec) (OCIContainer, error)
|
|
Start(ctID, cid string) error
|
|
Stop(ctID, cid string) error
|
|
Delete(ctID, cid string) error
|
|
}
|
|
|
|
type CreateSpec struct {
|
|
Image string
|
|
Cmd []string
|
|
Env map[string]string
|
|
Ports []PortMap
|
|
Volumes []string
|
|
Restart string
|
|
}
|
|
|
|
type PortMap struct {
|
|
HostPort int
|
|
ContainerPort int
|
|
}
|
|
|
|
type OCIContainer struct {
|
|
ID string
|
|
Image string
|
|
Status string
|
|
}
|
|
|
|
// TODO: connect via nsenter into CT and talk to Podman socket.
|