service

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

internal/container/service/container_service.go

Index

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) List

List returns all containers

func (*ContainerService) Remove

func (s *ContainerService) Remove(ctx context.Context, containerID string) error

Remove removes a container

func (*ContainerService) Start

func (s *ContainerService) Start(ctx context.Context, containerID string) error

Start starts a container

func (*ContainerService) Stop

func (s *ContainerService) Stop(ctx context.Context, containerID string) error

Stop stops 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL