compose

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

internal/compose/k8s_composer.go

internal/compose/lifecycle.go

internal/compose/toolbox.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToolbox

func CreateToolbox(name, template, file, namespace string) error

CreateToolbox creates a new MCPToolbox resource

func DeleteToolbox

func DeleteToolbox(name, namespace string, removeVolumes, force bool) error

DeleteToolbox deletes an MCPToolbox

func Down

func Down(configFile string, serviceNames []string) error

Down stops services using system approach

func List

func List(configFile string) error

List lists all services and their status (alias for Status but outputs to console)

func ListToolboxTemplates

func ListToolboxTemplates(format, template string) error

ListToolboxTemplates lists available toolbox templates

func ListToolboxes

func ListToolboxes(namespace, format string) error

ListToolboxes lists all MCPToolbox resources

func Logs

func Logs(configFile string, serviceNames []string, follow bool) error

Logs returns logs from services using kubectl logs on pods

func Restart

func Restart(configFile string, serviceNames []string) error

Restart restarts specific services using system approach

func Start

func Start(configFile string, serviceNames []string) error

Start starts specific services using system approach

func StartToolbox

func StartToolbox(name, namespace string, wait bool, timeout time.Duration) error

StartToolbox starts an MCPToolbox

func Stop

func Stop(configFile string, serviceNames []string) error

Stop stops specific services using system approach

func StopToolbox

func StopToolbox(name, namespace string, removeVolumes, force bool) error

StopToolbox stops an MCPToolbox

func ToolboxLogs

func ToolboxLogs(name, namespace, server string, follow bool, tail int) error

ToolboxLogs shows logs from a toolbox

func ToolboxStatus

func ToolboxStatus(name, namespace, format string, watch bool) error

ToolboxStatus shows status of a toolbox

func Up

func Up(configFile string, serviceNames []string) error

Up starts services using system approach

func Validate

func Validate(configFile string) error

Validate validates the configuration

Types

type ComposeStatus

type ComposeStatus struct {
	Services map[string]*ServiceStatus `json:"services"`
}

ComposeStatus represents the status of all services

func Status

func Status(configFile string) (*ComposeStatus, error)

Status returns the status of all services using system approach

type HealthChecker

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

HealthChecker performs health checks on servers

func NewHealthChecker

func NewHealthChecker(healthConfig config.HealthCheck, logger *logging.Logger, baseURL string) *HealthChecker

NewHealthChecker creates a new health checker

func (*HealthChecker) Check

func (hc *HealthChecker) Check() error

Check performs a health check

type K8sComposer

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

K8sComposer orchestrates MCP services using Kubernetes resources

func NewK8sComposer

func NewK8sComposer(configPath string, namespace string) (*K8sComposer, error)

NewK8sComposer creates a new composer instance

func (*K8sComposer) Down

func (c *K8sComposer) Down(serviceNames []string) error

Down stops all services

func (*K8sComposer) Restart

func (c *K8sComposer) Restart(serviceNames []string) error

Restart restarts specific services or all services if none specified

func (*K8sComposer) Start

func (c *K8sComposer) Start(serviceNames []string) error

Start starts specific services

func (*K8sComposer) Status

func (c *K8sComposer) Status() (*ComposeStatus, error)

Status returns the status of all services

func (*K8sComposer) Stop

func (c *K8sComposer) Stop(serviceNames []string) error

Stop stops specific services

func (*K8sComposer) Up

func (c *K8sComposer) Up(serviceNames []string) error

Up starts all enabled services

type LifecycleManager

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

LifecycleManager handles pre/post hooks and health checks

func NewLifecycleManager

func NewLifecycleManager(cfg *config.ComposeConfig, logger *logging.Logger, projectDir string) *LifecycleManager

NewLifecycleManager creates a new lifecycle manager

func (*LifecycleManager) ExecutePostStartHook

func (lm *LifecycleManager) ExecutePostStartHook(serverName string, hook string) error

ExecutePostStartHook executes post-start lifecycle hook

func (*LifecycleManager) ExecutePostStopHook

func (lm *LifecycleManager) ExecutePostStopHook(serverName string, hook string) error

ExecutePostStopHook executes post-stop lifecycle hook

func (*LifecycleManager) ExecutePreStartHook

func (lm *LifecycleManager) ExecutePreStartHook(serverName string, hook string) error

ExecutePreStartHook executes pre-start lifecycle hook

func (*LifecycleManager) ExecutePreStopHook

func (lm *LifecycleManager) ExecutePreStopHook(serverName string, hook string) error

ExecutePreStopHook executes pre-stop lifecycle hook

type ServiceStatus

type ServiceStatus struct {
	Name   string `json:"name"`
	Status string `json:"status"`
	Type   string `json:"type"`
}

ServiceStatus represents the status of a single service

type ToolboxManager

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

ToolboxManager manages MCPToolbox resources

func NewToolboxManager

func NewToolboxManager(namespace string) (*ToolboxManager, error)

NewToolboxManager creates a new toolbox manager

func (*ToolboxManager) CreateToolbox

func (tm *ToolboxManager) CreateToolbox(name, template, file string) error

CreateToolbox creates a new MCPToolbox resource

func (*ToolboxManager) DeleteToolbox

func (tm *ToolboxManager) DeleteToolbox(name string, removeVolumes, force bool) error

DeleteToolbox deletes an MCPToolbox

func (*ToolboxManager) ListToolboxTemplates

func (tm *ToolboxManager) ListToolboxTemplates(format, template string) error

ListToolboxTemplates lists available toolbox templates

func (*ToolboxManager) ListToolboxes

func (tm *ToolboxManager) ListToolboxes(format string) error

ListToolboxes lists all MCPToolbox resources

func (*ToolboxManager) StartToolbox

func (tm *ToolboxManager) StartToolbox(name string, wait bool, timeout time.Duration) error

StartToolbox starts an MCPToolbox (it should already be running via controller)

func (*ToolboxManager) StopToolbox

func (tm *ToolboxManager) StopToolbox(name string, removeVolumes, force bool) error

StopToolbox stops an MCPToolbox by deleting it

func (*ToolboxManager) ToolboxLogs

func (tm *ToolboxManager) ToolboxLogs(name, server string, follow bool, tail int) error

ToolboxLogs shows logs from a toolbox

func (*ToolboxManager) ToolboxStatus

func (tm *ToolboxManager) ToolboxStatus(name, format string, watch bool) error

ToolboxStatus shows status of a toolbox

Jump to

Keyboard shortcuts

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