runtime

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerInfo

type ContainerInfo struct {
	ID      string
	Name    string
	Image   string
	Ports   []PortInfo
	Service string
}

ContainerInfo holds tent-owned container metadata, replacing the Podman entities.ListContainer type.

func FilterContainers

func FilterContainers(tentContainers []ContainerInfo, serviceName string) []ContainerInfo

FilterContainers filters a list of ContainerInfo by service name.

type PortInfo

type PortInfo struct {
	HostPort      uint16
	ContainerPort uint16
	Protocol      string
}

PortInfo holds port mapping details for a container.

type Runtime

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

Runtime holds a Podman connection and exposes methods for container operations.

func Connect

func Connect() (*Runtime, error)

Connect establishes a connection with the Podman System Service and returns a Runtime.

func (*Runtime) CreateContainer

func (r *Runtime) CreateContainer(service *types.Service, restartPolicy string) (string, error)

CreateContainer creates a new container for the given service, pulling the image if needed. Returns the container ID and a nil error, or an empty string if the container is already running.

func (*Runtime) ListTentContainers

func (r *Runtime) ListTentContainers() ([]ContainerInfo, error)

ListTentContainers lists all containers started by tent, converting Podman types to ContainerInfo.

func (*Runtime) RemoveContainer

func (r *Runtime) RemoveContainer(containerID string) error

RemoveContainer removes a stopped container.

func (*Runtime) StartContainer

func (r *Runtime) StartContainer(containerID string) error

StartContainer starts a container by ID, waiting until it reaches the running state.

func (*Runtime) StopContainer

func (r *Runtime) StopContainer(containerID string) error

StopContainer stops a running container by dispatching a SIGTERM signal.

Jump to

Keyboard shortcuts

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