def reached

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

import near-v-framework@0.4.0.0/domain/architecture/ops.bend as Ops
import Base
import near-v-framework@0.4.0.0/general/compound/ops.bend as CO
import near-v-framework@0.4.0.0/general/compound/edge/type.bend as E
import near-v-framework@0.4.0.0/domain/architecture/system/container/type.bend as Ct

431# ---- on a server, a container is on the tailnet exactly when a device reaches it, else local ----
432def reached(+k: String, es: List<&2, E.Edge>, +cs: List<&2, Ct.Container>, +devices: List<&2, String>) -> Bool:
433  match es:
434    case []:
435      False{}
436    case e <> rest:
437      match e:
438        case E.Edge{x, y, _, _}:
439          (CO.has(devices, home(x, cs)) && String.eq(home(y, cs), k)) || reached(k, rest, cs, devices)

Uses (10)

Used by (1)