discover

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProjectConfigKey

func ProjectConfigKey(services map[string]compose.Service) string

ProjectConfigKey returns a stable fingerprint of service topology for one project.

Types

type Project

type Project struct {
	Name        string
	Graph       *dag.Graph
	Containers  map[string]string // service name -> container ID
	ConfigFiles []string          // compose files used to create the project
}

Project is a single Docker Compose stack with a dependency graph.

type Snapshot

type Snapshot struct {
	Projects   []Project
	Standalone []Standalone
}

Snapshot is the full discovery result shown in the TUI.

func FromContainers

func FromContainers(containers []docker.ContainerInfo) (*Snapshot, error)

FromContainers builds a Snapshot from pre-fetched container metadata (testable without Docker).

func FromDocker

func FromDocker(ctx context.Context, client *docker.Client) (*Snapshot, error)

FromDocker lists all containers and builds a Snapshot.

func (*Snapshot) ApplyStatesFrom

func (s *Snapshot) ApplyStatesFrom(other *Snapshot)

ApplyStatesFrom copies runtime state from other into s without changing graph topology. SameStructure must be true.

func (*Snapshot) SameStructure

func (s *Snapshot) SameStructure(other *Snapshot) bool

SameStructure reports whether two snapshots have identical project/service topology (names and depends_on). Container state and IDs may differ.

type Standalone

type Standalone struct {
	ID    string
	Name  string
	Image string
	State docker.ContainerState
}

Standalone is a container not managed by Docker Compose.

Jump to

Keyboard shortcuts

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