lifecycle

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package lifecycle contains high-level logic for managing the lifecycle of ToolHive-managed containers.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrContainerNotFound   = fmt.Errorf("container not found")
	ErrContainerNotRunning = fmt.Errorf("container not running")
)

ErrContainerNotFound is returned when a container cannot be found by name.

Functions

func CreatePermissionProfileFile added in v0.0.34

func CreatePermissionProfileFile(serverName string, permProfile *permissions.Profile) (string, error)

CreatePermissionProfileFile creates a temporary file with the permission profile

Types

type Manager

type Manager interface {
	// GetContainer returns information about the named container.
	GetContainer(ctx context.Context, name string) (*rt.ContainerInfo, error)
	// ListContainers lists all ToolHive-managed containers.
	ListContainers(ctx context.Context, listAll bool) ([]rt.ContainerInfo, error)
	// DeleteContainer deletes a container and its associated proxy process.
	DeleteContainer(ctx context.Context, name string, forceDelete bool) error
	// StopContainer stops a container and its associated proxy process.
	StopContainer(ctx context.Context, name string) error
	// RunContainer runs a container in the foreground.
	RunContainer(ctx context.Context, runConfig *runner.RunConfig) error
	// RunContainerDetached runs a container in the background.
	RunContainerDetached(runConfig *runner.RunConfig) error
	// RestartContainer restarts a previously stopped container.
	RestartContainer(ctx context.Context, name string) error
}

Manager is responsible for managing the state of ToolHive-managed containers.

func NewManager

func NewManager(ctx context.Context) (Manager, error)

NewManager creates a new container manager instance.

Jump to

Keyboard shortcuts

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