Help us shape the future of Go! Take the 2026 Go Developer Survey

lifecycle

package
v0.0.42 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: Apache-2.0 Imports: 20 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 CleanupTempPermissionProfile added in v0.0.38

func CleanupTempPermissionProfile(permissionProfilePath string) error

CleanupTempPermissionProfile removes a temporary permission profile file if it was created by toolhive

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