///|
test "architecture constructors" {
let services = [
@architecture.Service::new("api"),
@architecture.Service::new("db"),
]
let edge = @architecture.Connection::new(
"request",
@architecture.Endpoint::new("api", Right),
@architecture.Endpoint::new("db", Left),
target_head=true,
)
let architecture = @architecture.Architecture::new("example", services[:], [
edge,
])
assert_eq(@architecture.validate(architecture).length(), 0)
}pub struct Architecture {
id : String
groups : ReadOnlyArray[Group]
services : ReadOnlyArray[Service]
junctions : ReadOnlyArray[Junction]
connections : ReadOnlyArray[Connection]
alignments : ReadOnlyArray[Alignment]
title : String?
accessibility_title : String?
accessibility_description : String?
} derive(Eq, Debug)fn Architecture::new(id : String, services : ArrayView[Service], connections : ArrayView[Connection], groups? : ArrayView[Group], junctions? : ArrayView[Junction], alignments? : ArrayView[Alignment], title? : String, accessibility_title? : String, accessibility_description? : String) -> Architecturefn Connection::new(id : String, source : Endpoint, target : Endpoint, label? : String, source_head? : Bool, target_head? : Bool) -> Connectionfn validate(model : Architecture, nodes_limit? : Int, edges_limit? : Int, depth_limit? : Int, work_limit? : Int) -> ReadOnlyArray[Diagnostic]