docker

package
v0.0.0-...-6896650 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerResult

type ContainerResult struct {
	Output    string
	ExitCode  int
	Duration  int // in seconds
	StartedAt time.Time
	Error     error
}

ContainerResult holds the output and metadata from container execution

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service handles Docker container operations

func NewDockerService

func NewDockerService() (*Service, error)

NewDockerService creates a new Docker service instance

func (*Service) Close

func (s *Service) Close() error

Close closes the Docker client connection

func (*Service) GetDockerInfo

func (s *Service) GetDockerInfo(ctx context.Context) (map[string]interface{}, error)

GetDockerInfo returns Docker system information

func (*Service) ListRunningContainers

func (s *Service) ListRunningContainers(ctx context.Context) (int, error)

ListRunningContainers returns the count of currently running containers

func (*Service) Ping

func (s *Service) Ping(ctx context.Context) error

Ping checks if Docker daemon is accessible

func (*Service) PullImage

func (s *Service) PullImage(ctx context.Context, imageName string) error

PullImage pulls a Docker image if not already present

func (*Service) RunContainer

func (s *Service) RunContainer(ctx context.Context, imageName string, command []string) (*ContainerResult, error)

RunContainer runs a Docker container and captures its output This is the main function that executes user code

Jump to

Keyboard shortcuts

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