runtime

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerConfig

type ContainerConfig struct {
	Image       string
	Name        string
	Port        string
	HealthPath  string
	Env         []string // e.g., ["KEY=value", "FOO=bar"]
	Tag         string
	ProductName string
}

type DockerRuntime

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

DockerRuntime implements Runtime using the Docker API.

func NewDockerRuntime

func NewDockerRuntime() (*DockerRuntime, error)

func (*DockerRuntime) GetImageVersion

func (d *DockerRuntime) GetImageVersion(ctx context.Context, imageName string) (string, error)

func (*DockerRuntime) IsRunning

func (d *DockerRuntime) IsRunning(ctx context.Context, containerID string) (bool, error)

func (*DockerRuntime) Logs

func (d *DockerRuntime) Logs(ctx context.Context, containerID string, tail int) (string, error)

func (*DockerRuntime) PullImage

func (d *DockerRuntime) PullImage(ctx context.Context, imageName string, progress chan<- PullProgress) error

func (*DockerRuntime) Remove

func (d *DockerRuntime) Remove(ctx context.Context, containerName string) error

func (*DockerRuntime) Start

func (d *DockerRuntime) Start(ctx context.Context, config ContainerConfig) (string, error)

func (*DockerRuntime) Stop

func (d *DockerRuntime) Stop(ctx context.Context, containerName string) error

func (*DockerRuntime) StreamLogs

func (d *DockerRuntime) StreamLogs(ctx context.Context, containerID string, out io.Writer) error

type PullProgress

type PullProgress struct {
	LayerID string
	Status  string
	Current int64
	Total   int64
}

type Runtime

type Runtime interface {
	PullImage(ctx context.Context, image string, progress chan<- PullProgress) error
	Start(ctx context.Context, config ContainerConfig) (string, error)
	Stop(ctx context.Context, containerName string) error
	Remove(ctx context.Context, containerName string) error
	IsRunning(ctx context.Context, containerID string) (bool, error)
	Logs(ctx context.Context, containerID string, tail int) (string, error)
	StreamLogs(ctx context.Context, containerID string, out io.Writer) error
	GetImageVersion(ctx context.Context, imageName string) (string, error)
}

Runtime abstracts container runtime operations (Docker, Podman, Kubernetes, etc.)

Jump to

Keyboard shortcuts

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