container

package
v0.27.3 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Image                 string
	OpenclawImage         string
	MemoryLimit           int64
	NanoCPUs              int64
	PidsLimit             int64
	NetworkMode           string
	OpencodeConfigContent string
	OpenclawWeixinEnabled bool
}

func DefaultConfig

func DefaultConfig() Config

type Manager

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

func NewManager

func NewManager(cfg Config) (*Manager, error)

func (*Manager) CleanOrphans

func (m *Manager) CleanOrphans(knownContainerNames []string)

CleanOrphans removes containers labelled managed-by=agentserver that are NOT in the known set.

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) EnsureContainer

func (m *Manager) EnsureContainer(id string, opts process.StartOptions) (string, error)

EnsureContainer creates and starts a container without exec-ing into it. The container's entrypoint (sleep infinity) keeps it alive. Returns the container ID.

func (*Manager) Get

func (m *Manager) Get(id string) (process.Process, bool)

func (*Manager) Pause

func (m *Manager) Pause(id string) error

Pause stops the exec process and Docker container, preserving volumes.

func (*Manager) Resume

func (m *Manager) Resume(id, containerName, command string, args []string) (process.Process, error)

Resume starts the stopped container and exec's into it.

func (*Manager) Start

func (m *Manager) Start(id, command string, args, env []string, opts process.StartOptions) (process.Process, error)

func (*Manager) StartContainer

func (m *Manager) StartContainer(id string, opts process.StartOptions) error

StartContainer creates and starts a container without exec-ing into it.

func (*Manager) Stop

func (m *Manager) Stop(id string) error

func (*Manager) StopAll

func (m *Manager) StopAll()

func (*Manager) StopByContainerName

func (m *Manager) StopByContainerName(containerName string) error

StopByContainerName stops and removes a container by name (for paused sessions).

Jump to

Keyboard shortcuts

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