Documentation
¶
Overview ¶
internal/container/service/container_service.go
Index ¶
- type ContainerService
- func (s *ContainerService) Create(ctx context.Context, config *model.ContainerConfig) (string, error)
- func (s *ContainerService) Inspect(ctx context.Context, containerID string) (*model.ContainerInfo, error)
- func (s *ContainerService) List(ctx context.Context) ([]model.Container, error)
- func (s *ContainerService) Remove(ctx context.Context, containerID string) error
- func (s *ContainerService) Start(ctx context.Context, containerID string) error
- func (s *ContainerService) Stop(ctx context.Context, containerID string) error
- type DockerClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerService ¶
type ContainerService struct {
// contains filtered or unexported fields
}
ContainerService implements the Service interface
func NewContainerService ¶
func NewContainerService() (*ContainerService, error)
NewContainerService creates a new ContainerService
func NewContainerServiceWithClient ¶
func NewContainerServiceWithClient(client DockerClient) *ContainerService
NewContainerServiceWithClient creates a new ContainerService with the provided client
func (*ContainerService) Create ¶
func (s *ContainerService) Create(ctx context.Context, config *model.ContainerConfig) (string, error)
Create creates a new container
func (*ContainerService) Inspect ¶
func (s *ContainerService) Inspect(ctx context.Context, containerID string) (*model.ContainerInfo, error)
Inspect returns detailed information about a container
func (*ContainerService) Remove ¶
func (s *ContainerService) Remove(ctx context.Context, containerID string) error
Remove removes a container
type DockerClient ¶
type DockerClient interface {
List(ctx context.Context) ([]model.Container, error)
Create(ctx context.Context, config *model.ContainerConfig) (string, error)
Start(ctx context.Context, containerID string) error
Stop(ctx context.Context, containerID string) error
Remove(ctx context.Context, containerID string) error
Inspect(ctx context.Context, containerID string) (*model.ContainerInfo, error)
}
DockerClient defines the interface for container operations
Click to show internal directories.
Click to hide internal directories.