stack

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyStackRequest

type ApplyStackRequest struct {
	StackName      string
	ComposeContent string
	EnvVars        map[string]string
	ForceRecreate  bool
	Services       []string
	PullImages     bool
}

type ContainerInfo

type ContainerInfo struct {
	ID      string
	Name    string
	Service string
	State   string
	Status  string
	Image   string
}

type DiffAction

type DiffAction int
const (
	DiffActionNone DiffAction = iota
	DiffActionCreate
	DiffActionUpdate
	DiffActionDelete
)

type DiffResult

type DiffResult struct {
	Services   []ServiceDiff
	HasChanges bool
}

type Manager

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

func NewManager

func NewManager(stackRoot string, docker *client.Client, opMgr *operation.Manager) *Manager

func (*Manager) ApplyStack

func (m *Manager) ApplyStack(ctx context.Context, req *ApplyStackRequest) (string, error)

ApplyStack applies a compose file (create or update)

func (*Manager) DiffStack

func (m *Manager) DiffStack(ctx context.Context, stackName string, newContent string) (*DiffResult, error)

DiffStack compares current stack with new compose content

func (*Manager) GetStack

func (m *Manager) GetStack(ctx context.Context, name string) (*Stack, error)

GetStack retrieves a specific stack with current state

func (*Manager) ListStacks

func (m *Manager) ListStacks(ctx context.Context) ([]*Stack, error)

ListStacks discovers all stacks in the stack root

func (*Manager) RemoveStack

func (m *Manager) RemoveStack(ctx context.Context, stackName string, removeVolumes bool) (string, error)

RemoveStack removes a stack and its containers

type ServiceDiff

type ServiceDiff struct {
	Name    string
	Action  DiffAction
	Changes []string
}

type Stack

type Stack struct {
	ID         string
	Name       string
	Path       string
	Project    *types.Project
	State      StackState
	Containers []ContainerInfo
	CreatedAt  time.Time
	UpdatedAt  time.Time
	Labels     map[string]string
}

type StackState

type StackState int
const (
	StateUnknown StackState = iota
	StateRunning
	StateStopped
	StateError
	StatePartial
)

Jump to

Keyboard shortcuts

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