| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 | package containersimport (	"context"	"io")// Container represents a created containertype Container struct {	ID          string	Status      string	Image       string	Command     string	CPUTime     uint64	MemoryUsage uint64	MemoryLimit uint64	PidsCurrent uint64	PidsLimit   uint64	Labels      []string	Ports       []Port}// Port represents a published port of a containertype Port struct {	// HostPort is the port number on the host	HostPort uint32	// ContainerPort is the port number inside the container	ContainerPort uint32	// Protocol is the protocol of the port mapping	Protocol string	// HostIP is the host ip to use	HostIP string}// ContainerConfig contains the configuration data about a containertype ContainerConfig struct {	// ID uniquely identifies the container	ID string	// Image specifies the iamge reference used for a container	Image string	// Ports provide a list of published ports	Ports []Port	// Labels set labels to the container	Labels map[string]string	// Volumes to be mounted	Volumes []string}// LogsRequest contains configuration about a log requesttype LogsRequest struct {	Follow bool	Tail   string	Writer io.Writer}// Service interacts with the underlying container backendtype Service interface {	// List returns all the containers	List(ctx context.Context, all bool) ([]Container, error)	// Stop stops the running container	Stop(ctx context.Context, containerID string, timeout *uint32) error	// Run creates and starts a container	Run(ctx context.Context, config ContainerConfig) error	// Exec executes a command inside a running container	Exec(ctx context.Context, containerName string, command string, reader io.Reader, writer io.Writer) error	// Logs returns all the logs of a container	Logs(ctx context.Context, containerName string, request LogsRequest) error	// Delete removes containers	Delete(ctx context.Context, id string, force bool) error	// Inspect get a specific container	Inspect(ctx context.Context, id string) (Container, error)}
 |