Documentation
¶
Overview ¶
Package compose ingests Docker Compose files and the .env files they read into the code graph, so how deployments address each other is graph data rather than something a reader has to go and look up.
A compose service becomes a Deployment node; each environment key it passes and each service it depends_on becomes a references edge. An .env key becomes a Config node holding its value. Nothing here decides what calls what: the service map follows these edges and expands ${VAR} through Config nodes, and a value that names another deployment is the address one service uses to reach it — the same evidence whether the stack is Go, Kotlin or nginx.
Like the Kubernetes scan, this is a line scan, not a YAML parse: compose files interpolate ${VAR:-default} into places a strict parser rejects, and a scan keeps every other service when one block is malformed.
Values are credentials often enough to be treated as such: a key that names a password, secret, token or key keeps its name and loses its value, and a URL's user:password@ is dropped before anything is stored.
Index ¶
Constants ¶
const ( KindDeployment = "Deployment" KindConfig = "Config" // ExtraRef says what a Deployment's references edge is: RefEnv (Target is // "env:KEY", ExtraValue the inline value when the file sets one), // RefDependsOn (Target "deploy:NAME") or RefBuild (Target the Dockerfile // path as written, possibly ${VAR}). ExtraRef = "composeRef" ExtraValue = "value" RefEnv = "env" RefDependsOn = "depends_on" RefBuild = "build" )
Node kinds and edge hints.
Variables ¶
This section is empty.
Functions ¶
func IsComposeFile ¶
IsComposeFile reports whether a YAML file is a compose file: it has a top-level services: key.
func ParseDotEnv ¶
ParseDotEnv turns an .env file into one Config node per key.
Types ¶
This section is empty.