Documentation
¶
Index ¶
- func AddNetworkToCompose(content string, networkName string) (string, error)
- func AddVolumeToService(content string, serviceName string, volumeMount string) (string, error)
- func EnsureContainerNames(content string, deploymentName string) (string, error)
- func ExecuteService(cfg *config.ServiceExecConfig, args []string) ([]byte, error)
- func ExtractBindMounts(composeContent string) []string
- func GetDeploymentResources(projectName string) (map[string]*ResourceLimits, error)
- func HasVolumeMount(content string, serviceName string, volumeMount string) bool
- func InspectContainerUser(containerName string) (string, error)
- func MarshalComposeYAML(compose map[string]interface{}) ([]byte, error)
- func ParseComposeYAML(content string) (map[string]interface{}, error)
- func RemoveVolumeFromService(content string, serviceName string, volumeMount string) (string, error)
- func UpdateContainerResources(containerID string, update *ResourceUpdate) error
- type APIClient
- func (a *APIClient) Close() error
- func (a *APIClient) ExecInContainer(ctx context.Context, containerID string, command string) (string, error)
- func (a *APIClient) ExecInService(ctx context.Context, project, service, command string) (string, error)
- func (a *APIClient) FindContainer(ctx context.Context, project, service string) (string, error)
- func (a *APIClient) ListServiceContainers(ctx context.Context, project string) ([]container.Summary, error)
- type ComposeExecutor
- func (c *ComposeExecutor) Down(deploymentPath string) (string, error)
- func (c *ComposeExecutor) ExecCommand(containerID string, command string) (string, error)
- func (c *ComposeExecutor) GetImageInfo(deploymentPath string) ([]ImageInfo, error)
- func (c *ComposeExecutor) GetStatus(deploymentPath string) (string, error)
- func (c *ComposeExecutor) Logs(deploymentPath string, tail int) (string, error)
- func (c *ComposeExecutor) PS(deploymentPath string) (string, error)
- func (c *ComposeExecutor) Pull(deploymentPath string, onlyLatest bool) (string, error)
- func (c *ComposeExecutor) Rebuild(deploymentPath string) (string, error)
- func (c *ComposeExecutor) Restart(deploymentPath string) (string, error)
- func (c *ComposeExecutor) Start(deploymentPath string) (string, error)
- func (c *ComposeExecutor) Stop(deploymentPath string) (string, error)
- func (c *ComposeExecutor) Up(deploymentPath string) (string, error)
- type ContainerStats
- type DeploymentStats
- type Discovery
- func (d *Discovery) ApplyMountOwnership(deploymentPath string, mounts []MountOwnership) error
- func (d *Discovery) CreateDeployment(name string, composeContent string) error
- func (d *Discovery) DeleteDeployment(name string) error
- func (d *Discovery) DeleteMetadata(name string) error
- func (d *Discovery) FindDeployments() ([]models.Deployment, error)
- func (d *Discovery) FindInfrastructure() ([]models.Deployment, error)
- func (d *Discovery) GetComposeFile(name string) (string, string, error)
- func (d *Discovery) GetDeployment(name string) (*models.Deployment, error)
- func (d *Discovery) SaveMetadata(name string, metadata *models.ServiceMetadata) error
- func (d *Discovery) UpdateComposeFile(name string, content string) error
- type ImageInfo
- type Manager
- func (m *Manager) ApplyMountOwnership(name string, mounts []MountOwnership) error
- func (m *Manager) BasePath() string
- func (m *Manager) ComposeExec(ctx context.Context, name string, service string, command string) (string, error)
- func (m *Manager) CreateDeployment(name string, composeContent string) error
- func (m *Manager) DeleteDeployment(name string) error
- func (m *Manager) ExecuteQuickAction(name string, actionID string) (string, error)
- func (m *Manager) GetComposeFile(name string) (string, string, error)
- func (m *Manager) GetComposeServiceNames(name string) ([]string, error)
- func (m *Manager) GetComposeServices(name string) ([]models.Service, error)
- func (m *Manager) GetDeployment(name string) (*models.Deployment, error)
- func (m *Manager) GetDeploymentImages(name string) ([]ImageInfo, error)
- func (m *Manager) GetDeploymentLogs(name string, tail int) (string, error)
- func (m *Manager) GetStats() (*DeploymentStats, error)
- func (m *Manager) ListDeployments() ([]models.Deployment, error)
- func (m *Manager) ListInfrastructure() ([]models.Deployment, error)
- func (m *Manager) PullDeployment(name string, onlyLatest bool) (string, error)
- func (m *Manager) RebuildDeployment(name string) (string, error)
- func (m *Manager) ResolveService(name string, serviceName string) (string, error)
- func (m *Manager) RestartDeployment(name string) (string, error)
- func (m *Manager) SaveMetadata(name string, metadata *models.ServiceMetadata) error
- func (m *Manager) StartDeployment(name string) (string, error)
- func (m *Manager) StopDeployment(name string) (string, error)
- func (m *Manager) UpdateDeployment(name string, composeContent string) error
- type MountOwnership
- type ResourceLimits
- type ResourceUpdate
- type ServiceExecutor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddNetworkToCompose ¶ added in v0.1.5
func AddVolumeToService ¶ added in v0.1.5
AddVolumeToService adds a volume mount to a specific service in the compose file
func EnsureContainerNames ¶ added in v0.1.5
EnsureContainerNames ensures all services have explicit container_name set. The primary service (preferring "app") gets deploymentName as its container name. All other services get "{deploymentName}-{serviceName}". Existing container_name values are preserved.
func ExecuteService ¶ added in v0.1.5
func ExecuteService(cfg *config.ServiceExecConfig, args []string) ([]byte, error)
func ExtractBindMounts ¶ added in v0.1.5
ExtractBindMounts parses compose content and returns bind mount host paths.
func GetDeploymentResources ¶ added in v0.1.5
func GetDeploymentResources(projectName string) (map[string]*ResourceLimits, error)
func HasVolumeMount ¶ added in v0.1.5
HasVolumeMount checks if a service has a specific volume mount
func InspectContainerUser ¶ added in v0.1.5
InspectContainerUser gets the UID:GID of the running process inside a container.
func MarshalComposeYAML ¶ added in v0.1.5
func ParseComposeYAML ¶ added in v0.1.5
func RemoveVolumeFromService ¶ added in v0.1.5
func RemoveVolumeFromService(content string, serviceName string, volumeMount string) (string, error)
RemoveVolumeFromService removes a volume mount from a specific service in the compose file
func UpdateContainerResources ¶ added in v0.1.5
func UpdateContainerResources(containerID string, update *ResourceUpdate) error
Types ¶
type APIClient ¶ added in v0.1.5
type APIClient struct {
// contains filtered or unexported fields
}
func NewAPIClient ¶ added in v0.1.5
func (*APIClient) ExecInContainer ¶ added in v0.1.5
func (*APIClient) ExecInService ¶ added in v0.1.5
func (*APIClient) FindContainer ¶ added in v0.1.5
type ComposeExecutor ¶
type ComposeExecutor struct {
// contains filtered or unexported fields
}
func NewComposeExecutor ¶
func NewComposeExecutor(basePath string) *ComposeExecutor
func (*ComposeExecutor) Down ¶
func (c *ComposeExecutor) Down(deploymentPath string) (string, error)
func (*ComposeExecutor) ExecCommand ¶ added in v0.1.5
func (c *ComposeExecutor) ExecCommand(containerID string, command string) (string, error)
func (*ComposeExecutor) GetImageInfo ¶ added in v0.1.5
func (c *ComposeExecutor) GetImageInfo(deploymentPath string) ([]ImageInfo, error)
func (*ComposeExecutor) GetStatus ¶
func (c *ComposeExecutor) GetStatus(deploymentPath string) (string, error)
func (*ComposeExecutor) Logs ¶
func (c *ComposeExecutor) Logs(deploymentPath string, tail int) (string, error)
func (*ComposeExecutor) Pull ¶
func (c *ComposeExecutor) Pull(deploymentPath string, onlyLatest bool) (string, error)
func (*ComposeExecutor) Rebuild ¶ added in v0.1.5
func (c *ComposeExecutor) Rebuild(deploymentPath string) (string, error)
func (*ComposeExecutor) Restart ¶
func (c *ComposeExecutor) Restart(deploymentPath string) (string, error)
func (*ComposeExecutor) Start ¶
func (c *ComposeExecutor) Start(deploymentPath string) (string, error)
type ContainerStats ¶ added in v0.1.5
type ContainerStats struct {
ContainerID string `json:"container_id"`
Name string `json:"name"`
CPUPercent float64 `json:"cpu_percent"`
MemoryUsage uint64 `json:"memory_usage"`
MemoryLimit uint64 `json:"memory_limit"`
MemoryPercent float64 `json:"memory_percent"`
NetworkRx uint64 `json:"network_rx"`
NetworkTx uint64 `json:"network_tx"`
BlockRead uint64 `json:"block_read"`
BlockWrite uint64 `json:"block_write"`
PIDs int `json:"pids"`
}
func GetAllContainerStats ¶ added in v0.1.5
func GetAllContainerStats() ([]ContainerStats, error)
func GetContainerStats ¶ added in v0.1.5
func GetContainerStats(containerID string) (*ContainerStats, error)
func GetDeploymentStats ¶ added in v0.1.5
func GetDeploymentStats(projectName string) ([]ContainerStats, error)
type DeploymentStats ¶
type Discovery ¶
type Discovery struct {
// contains filtered or unexported fields
}
func NewDiscovery ¶
func (*Discovery) ApplyMountOwnership ¶ added in v0.1.5
func (d *Discovery) ApplyMountOwnership(deploymentPath string, mounts []MountOwnership) error
ApplyMountOwnership sets ownership and creates subdirectories for bind mounts. When User is specified (UID:GID format), directories are chowned to that user. When User is empty, directories are chmod'd to 0777 as a fallback for non-template deploys.
func (*Discovery) CreateDeployment ¶
func (*Discovery) DeleteDeployment ¶
func (*Discovery) DeleteMetadata ¶
func (*Discovery) FindDeployments ¶
func (d *Discovery) FindDeployments() ([]models.Deployment, error)
func (*Discovery) FindInfrastructure ¶ added in v0.1.5
func (d *Discovery) FindInfrastructure() ([]models.Deployment, error)
func (*Discovery) GetComposeFile ¶
func (*Discovery) GetDeployment ¶
func (d *Discovery) GetDeployment(name string) (*models.Deployment, error)
func (*Discovery) SaveMetadata ¶
func (d *Discovery) SaveMetadata(name string, metadata *models.ServiceMetadata) error
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) ApplyMountOwnership ¶ added in v0.1.5
func (m *Manager) ApplyMountOwnership(name string, mounts []MountOwnership) error
func (*Manager) ComposeExec ¶ added in v0.1.5
func (*Manager) CreateDeployment ¶
func (*Manager) DeleteDeployment ¶
func (*Manager) ExecuteQuickAction ¶ added in v0.1.5
func (*Manager) GetComposeFile ¶
func (*Manager) GetComposeServiceNames ¶ added in v0.1.5
func (*Manager) GetComposeServices ¶ added in v0.1.5
func (*Manager) GetDeployment ¶
func (m *Manager) GetDeployment(name string) (*models.Deployment, error)
func (*Manager) GetDeploymentImages ¶ added in v0.1.5
func (*Manager) GetDeploymentLogs ¶
func (*Manager) GetStats ¶
func (m *Manager) GetStats() (*DeploymentStats, error)
func (*Manager) ListDeployments ¶
func (m *Manager) ListDeployments() ([]models.Deployment, error)
func (*Manager) ListInfrastructure ¶ added in v0.1.5
func (m *Manager) ListInfrastructure() ([]models.Deployment, error)
func (*Manager) PullDeployment ¶ added in v0.1.5
func (*Manager) RebuildDeployment ¶ added in v0.1.5
func (*Manager) ResolveService ¶ added in v0.1.5
func (*Manager) RestartDeployment ¶
func (*Manager) SaveMetadata ¶
func (m *Manager) SaveMetadata(name string, metadata *models.ServiceMetadata) error
type MountOwnership ¶ added in v0.1.5
type MountOwnership struct {
HostPath string
User string // "UID:GID" or empty
Subdirectories []string
}
MountOwnership describes ownership and subdirectory requirements for a bind mount.
type ResourceLimits ¶ added in v0.1.5
type ResourceLimits struct {
MemoryLimit int64 `json:"memory_limit"`
MemorySwap int64 `json:"memory_swap"`
CPUs float64 `json:"cpus"`
RestartPolicy string `json:"restart_policy"`
}
func GetContainerResources ¶ added in v0.1.5
func GetContainerResources(containerID string) (*ResourceLimits, error)
type ResourceUpdate ¶ added in v0.1.5
type ServiceExecutor ¶ added in v0.1.5
type ServiceExecutor struct {
// contains filtered or unexported fields
}
func NewServiceExecutor ¶ added in v0.1.5
func NewServiceExecutor(cfg *config.ServiceExecConfig) *ServiceExecutor