Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintDefaults ¶
PrintDefaults writes flag defaults using double-dash prefixes.
func WriteGraph ¶
WriteGraph encodes g as layout JSON to --out, honouring --pretty (the shipping default: indented, trailing newline).
func WriteOutput ¶
WriteOutput writes to a --out path, treating "-" as stdout.
Types ¶
type Common ¶
Common holds the flags every layout-consuming command shares: --in/--out/--pretty. Their help text and defaults ARE layout-gen's shipping surface — the dev tools inherit it verbatim.
func RegisterCommon ¶
RegisterCommon registers --in/--out/--pretty on fs and returns the Common whose fields they write. Call it BEFORE registering a tool's addon flags so the shared surface reads first in --help.
type DetectedInput ¶
DetectedInput contains the parsed input and its detected type.
func DetectInput ¶
func DetectInput(data []byte, filename string) (*DetectedInput, error)
DetectInput attempts to detect and parse the input data. Returns the parsed data and its detected type. Tries detection in this order: 1. File extension (.ipmt, .layout.json, .json) 2. Content structure (layout.Graph has Meta.Bounds, model.IpmGraph has Nodes array) 3. IPMT text parsing as fallback
func LoadGraph ¶
func LoadGraph(c *Common) (*DetectedInput, *layout.Graph, error)
LoadGraph returns the layout graph WITHOUT tracing: generate for ipmt/ipm.json, pass through for an already-laid-out layout.json. This is layout-gen's shipping path — no trace machinery, no report.
func LoadReport ¶
func LoadReport(c *Common) (*l7report.Report, *DetectedInput, error)
LoadReport returns a TRACED report — the dev tools' path. A recorded .debug.json is decoded and replayed (generation SKIPPED); for an ipmt/ipm.json input the engine runs with a collecting trace (every decision recorded); a passed-through layout.json yields a graph-only report (no events — the pipeline did not run, so --why has nothing to narrate, but --table/--edges/--facts still work off the graph).