def visible

near-v-framework@0.4.0.0 · domain/architecture/view/ops.bend:102

import near-v-framework@0.4.0.0/domain/architecture/view/ops.bend as Ops
import Base
import near-v-framework@0.4.0.0/domain/architecture/type.bend as A
import near-v-framework@0.4.0.0/domain/architecture/ops.bend as O
import near-v-framework@0.4.0.0/domain/architecture/view/type.bend as Vw

102# The keys the view may show: its own, the rest of the system at the level above, and the environment.
103def visible(+a: A.Architecture, v: Vw.View) -> List<&2, String>:
104  match v:
105    case Vw.Context{}:
106      O.system_key(a) <> O.environment_keys(a)
107    case Vw.Containers{}:
108      List.append(&2, String, O.container_keys(O.containers(a)), O.environment_keys(a))
109    case Vw.Components{+c}:
110      List.append(&2, String, O.components_of(c, O.containers(a)), List.append(&2, String, without(c, O.container_keys(O.containers(a))), O.environment_keys(a)))
111    case Vw.Deployment{}:
112      []
113    case Vw.Dynamic{_}:
114      []

Uses (11)

Used by (1)