service

package
v0.0.0-alpha-36 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InstallOptions

type InstallOptions struct {
	ServiceName  string            // Service name from catalog
	Version      string            // Version to install (empty = latest)
	InstanceName string            // Custom instance name (empty = auto-generate)
	Environment  map[string]string // Override environment variables
	MemoryLimit  string            // Override memory limit
	CPULimit     string            // Override CPU limit
	Volumes      map[string]string // Volume mappings (host:container)
	PortMappings map[string]string // Port mappings (containerPort:hostPort as strings)
	Internal     bool              // If true, don't expose via Traefik

	// Dependency management (Phase 3)
	SkipDependencies bool // If true, skip dependency resolution
	AutoInstallDeps  bool // If true, auto-install dependencies without prompting
	IsDepend         bool // Internal: true if this is being installed as a dependency
	Replace          bool // If true, replace existing instance without prompting
}

InstallOptions holds options for service installation

type Installer

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

Installer handles service installation

func NewInstaller

func NewInstaller(dockerClient *docker.Client, configMgr *config.Manager, catalogMgr *catalog.Manager) (*Installer, error)

NewInstaller creates a new service installer

func (*Installer) Install

func (i *Installer) Install(opts InstallOptions) (*types.Instance, error)

Install installs a service from the catalog

type Manager

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

Manager handles service instance management

func NewManager

func NewManager(dockerClient *docker.Client, configMgr *config.Manager) *Manager

NewManager creates a new service manager

func (*Manager) Get

func (m *Manager) Get(instanceName string) (*types.Instance, error)

Get retrieves a specific instance (checks both catalog services and custom projects)

func (*Manager) GetConnectionInfo

func (m *Manager) GetConnectionInfo(instanceName string) (*types.ConnectionInfo, error)

GetConnectionInfo returns connection information for a service

func (*Manager) GetContainerLogs

func (m *Manager) GetContainerLogs(instanceName, containerName string, follow bool) (string, error)

GetContainerLogs retrieves logs from a specific container in a multi-container service

func (*Manager) GetLogs

func (m *Manager) GetLogs(instanceName string, follow bool) (string, error)

GetLogs retrieves logs from a service instance

func (*Manager) GetStats

func (m *Manager) GetStats(instanceName string) (container.StatsResponseReader, error)

GetStats retrieves resource usage statistics

func (*Manager) GetStatus

func (m *Manager) GetStatus(instanceName string) (types.ServiceStatus, error)

GetStatus retrieves the current status of an instance

func (*Manager) List

func (m *Manager) List() ([]*types.Instance, error)

List returns all service instances (including custom projects)

func (*Manager) Recreate added in v0.1.1

func (m *Manager) Recreate(instanceName string) error

Recreate recreates a service container to apply configuration changes (like environment variables) This stops, removes, and recreates the container with the current configuration from the config file

func (*Manager) RefreshStatus

func (m *Manager) RefreshStatus() error

RefreshStatus updates the status of all instances

func (*Manager) Remove

func (m *Manager) Remove(instanceName string, force bool, removeVolumes bool) error

Remove removes a service instance (stops and deletes)

func (*Manager) Restart

func (m *Manager) Restart(instanceName string) error

Restart restarts a service instance

func (*Manager) RestartWithPort added in v0.1.1

func (m *Manager) RestartWithPort(instanceName string, newPort int) error

RestartWithPort restarts a service instance with a new host port mapping This requires recreating the container since port mappings cannot be changed on existing containers

func (*Manager) Start

func (m *Manager) Start(instanceName string) error

Start starts a stopped service instance

func (*Manager) Stop

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

Stop stops a running service instance

Jump to

Keyboard shortcuts

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