Skip to content

Commit

Permalink
with replicas
Browse files Browse the repository at this point in the history
  • Loading branch information
mcanlas committed Mar 27, 2024
1 parent 60b2879 commit 64b898e
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,16 @@ object DemoDsl:
if isBright then skinPlantUmlBlue("component", "Service") else skinPlantUmlWhite("component")
)

case Database(name, replicas) =>
case Database(name, numReplicas) =>
val replicas =
(1 to numReplicas)
.map(n => PlantUml.Database(s"replica-$n", None, Option.when(isBright)("Database"), xs = Set.empty))
.toSet[PlantUml.Entity]

PlantUml.ComponentDiagram(
PlantUml.Package(
"Persistence",
PlantUml.Database(name, None, Option.when(isBright)("Database"), xs = Set.empty)
replicas + PlantUml.Database(name, None, Option.when(isBright)("Database"), xs = Set.empty)
),
if isBright then skinPlantUmlYellow("database", "Database") else skinPlantUmlWhite("database")
)
Expand Down

0 comments on commit 64b898e

Please sign in to comment.