Help us shape the future of Go! Take the 2026 Go Developer Survey

mermaid

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package mermaid reads Mermaid flowcharts as flow sketches and writes flows as Mermaid. Node labels follow conventions ("req: auth/login@2", "delay: 2s", "extract: token=$.data.token") that resolve against the collection; what does not resolve becomes a placeholder note, so a sketch always imports and shows what is left to do.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Export

func Export(f model.Flow) string

Export writes f as a flowchart. Supported nodes get convention labels and import back as themselves; containers become subgraphs (export only); other nodes are labelled "<type> <id>" and import as placeholders.

func Import

func Import(src []byte, name string, r Resolver) (importers.Result, diag.List)

Import reads a flowchart as one flow, mermaid/<name stem>. A syntax error (FLW-IMPORT-004) or a cycle (FLW-MERMAID-002) imports nothing.

Types

type Resolver

type Resolver interface {
	Request(path string) (model.Ref, bool)
	Flow(path string) (model.Ref, bool)
}

Resolver finds requests and flows by path.

Jump to

Keyboard shortcuts

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