Documentation
¶
Overview ¶
Package flowdsl compiles a flow file into the CreateFlowRequest JSON the Echopoint API already accepts, and renders a stored flow back into that file. The file is YAML: nodes are named, and next and on_failure replace the edges array. Nothing here calls the API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decompile ¶
Decompile renders a stored flow as a flow file. Compiling that file produces the same create request the API would accept for this flow. Edge ids and pinned borders are left out: compile lays the graph out itself.
func DecompileJSON ¶
DecompileJSON renders a stored flow JSON document as a flow file.
func ModulePath ¶
ModulePath is the library path of a flow file, such as anchor/login.
Types ¶
type Diagnostic ¶
type Diagnostic struct {
File string `json:"file,omitempty"`
Line int `json:"line,omitempty"`
Severity Severity `json:"-"`
Message string `json:"message"`
}
Diagnostic is one problem found while reading or checking a flow file.
func (Diagnostic) String ¶
func (d Diagnostic) String() string
type Flow ¶
type Flow struct {
// Path is the file's module path, such as anchor/login.
Path string `json:"path"`
Request wire.CreateFlowRequest `json:"request"`
}
Flow is one compiled create-flow document.
type Outcome ¶
type Outcome struct {
Flows []Flow
Diagnostics []Diagnostic
}
Outcome is everything a compile found. Flows with an error are omitted.
func CompileDir ¶
CompileDir compiles every flow file under root. Files with an error are omitted from Flows; their diagnostics are still returned.
func CompileFile ¶
CompileFile compiles one flow file. root is the library used to resolve module files; an empty root means the file's directory. Diagnostics of flow files the file does not reach are left out.
func CompileSource ¶
CompileSource compiles one flow file held in memory. path is the module path recorded on diagnostics. A module reference that names another file cannot be resolved from a single source; a module UUID can.
func (Outcome) Errors ¶
func (o Outcome) Errors() []Diagnostic
Errors returns the diagnostics that failed the compile.
func (Outcome) Warnings ¶
func (o Outcome) Warnings() []Diagnostic
Warnings returns the diagnostics that did not fail the compile.