Documentation
¶
Overview ¶
Package eventmodeling parses Mermaid's event modeling diagrams and lays them out, as Pele's src/diagrams/eventmodeling does: a tokenizer and a parser that read what Mermaid's Langium grammar reads, buildEventModel, which sorts the frames into lanes and finds what feeds each, and Layout, which lays the lanes out across, with time running left to right, or the frames down as cards in a narrow host.
Index ¶
Constants ¶
const ( RoleLane scene.Role = "eventmodeling.lane" RoleLaneLabel scene.Role = "eventmodeling.lane-label" RoleRelation scene.Role = "eventmodeling.relation" RoleData scene.Role = "eventmodeling.data" RoleFrameID scene.Role = "eventmodeling.frame-id" RoleNote scene.Role = "eventmodeling.note" RoleNoteText scene.Role = "eventmodeling.note-text" RoleSpecification scene.Role = "eventmodeling.specification" RoleSpecText scene.Role = "eventmodeling.specification-text" RoleTitle scene.Role = "eventmodeling.title" )
The scene's roles. A frame is a node of the role of its kind, "eventmodeling.command" and the rest, its name its label, with the tag "reset" for a reset frame; its example data is a text item after it. Across, a lane is a group, with its label; down, each frame's lane is named by a text item before it, and its number by one after it. A note and a specification are nodes, their heading the label, their lines a text item after each.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Box ¶
type Box struct {
ID string // the frame number as written, as "01"
Kind Kind
Entity string
Name string
Namespace string // "" for none
Reset bool
Lane *Lane
// Data is the example data of the frame or of the data block it refers to, if HasData.
Data string
HasData bool
DataType string // "" for none
}
Box is a frame, Pele's EmBox.
type Group ¶
type Group string
Group is the group of lanes a kind of entity is drawn in, Pele's LaneGroup: "trigger" for screens and processors, "state" for commands and read models, "stream" for events.
type Kind ¶
type Kind string
Kind is the kind of entity a frame shows, Pele's EntityKind: "ui", "processor", "command", "readmodel" or "event".
type Lane ¶
type Lane struct {
// Index orders the lanes, as Mermaid's key does: 0 for UI/Automation, 100 for
// Command/Read Model, 200 for Events, and the next free number after those for each
// namespace.
Index int
Label string
Group Group
Namespace string // "" for none
}
Lane is a swimlane, Pele's EmLane.
type Model ¶
type Model struct {
Title, AccTitle, AccDescr string
Boxes []*Box
// Lanes are sorted from top to bottom.
Lanes []*Lane
Relations []Relation
Notes []Note
Specifications []Specification
Entities []string
}
Model is a parsed event modeling diagram, Pele's EventModelingModel. A string Pele leaves undefined is empty.
type Relation ¶
type Relation struct {
Source, Target *Box
}
Relation is a frame that feeds another, Pele's EmRelation.
type Specification ¶
Specification is a given, when, then specification of a frame, Pele's EmSpecification.