Documentation
¶
Overview ¶
Package composegraph renders a docker-compose file's service dependency graph as a Mermaid flowchart, then hands that off to go-mermaid for SVG/PNG rendering — no headless browser, no Node, no Graphviz.
svg, err := composegraph.Render(composeYAML)
Nodes are services; edges come from `depends_on` (labeled with any non-default condition) and `volumes_from`. Services sharing a `networks:` entry are grouped into a subgraph, so the diagram clusters visually by network.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Render ¶
Render parses a docker-compose YAML document and renders its dependency graph straight to SVG via go-mermaid. opts are passed through to mermaid.Render (theme, padding, spacing, ...).
Types ¶
type Edge ¶
type Edge struct {
From, To string
Kind EdgeKind
// Label is shown on the edge; empty for a plain dependency.
Label string
}
Edge is a directed relationship between two services.
type EdgeKind ¶
type EdgeKind int
EdgeKind distinguishes the compose relationship an Edge represents.
type Graph ¶
Graph is the dependency graph extracted from a compose file. Nodes and Edges are sorted for deterministic output.
type Node ¶
type Node struct {
// Name is the service name (the map key under `services:`).
Name string
// Group is the subgraph this node is clustered under (its first network,
// alphabetically, or "default" if it declares none). Empty when the
// compose file uses no `networks:` keys at all, so no grouping applies.
Group string
// HasHealthCheck reports whether the service declares a healthcheck.
HasHealthCheck bool
}
Node is one service in the compose file.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
composegraph
command
Command composegraph renders a docker-compose file's service dependency graph to SVG (or Mermaid source, or PNG).
|
Command composegraph renders a docker-compose file's service dependency graph to SVG (or Mermaid source, or PNG). |