def private_hosts

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

import near-v-framework@0.4.0.0/domain/architecture/ops.bend as Ops
import Base
import near-v-framework@0.4.0.0/domain/architecture/system/container/type.bend as Ct
import near-v-framework@0.4.0.0/domain/architecture/category/type.bend as K2

518# How many containers host the app privately: Hosting, on the tailnet.
519def private_hosts(cs: List<&2, Ct.Container>) -> Nat:
520  match cs:
521    case []:
522      0n
523    case c <> rest:
524      match c:
525        case Ct.Container{_, _, _, _, _, e, +caps, _, _, _, _, _, _, _, _}:
526          Nat.add(one_if(has_cap(K2.Hosting{}, caps) && is_tailnet(e)), private_hosts(rest))

Uses (9)

Used by (1)