Effects.serve_step: def of near-v-framework@0.4.0.0 Import: import near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/effects.bend as Effects Lines 188-196 of near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/effects.bend: https://jend.leeeet.dev/read.txt?path=near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/effects.bend&start_line=188&end_line=196 import Base import bend-net-json@0.3.0.0/json.bend as Json import near-v-framework@0.4.0.0/domain/architecture/system/plan/type.bend as P import near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/type.bend as ND # A serve is current, to be served, or blocked by Tailscale serving its port to something not V's. def serve_step(s: ND.Serve, +web: Json.Val, +ours: List<&2, String>, +tailscale: String, +what: String) -> P.Step: match s: case ND.Serve{_, +h, p, path}: +target = "http://127.0.0.1:" ++ U32.show(p) ++ path +now = proxy_on(web, keys(web), U32.show(h)) Bool.pick(P.Step, String.is_empty(now) || List.contains(~String, ~String.eq, ours, url_port(now)), Bool.pick(P.Step, String.eq(now, target), P.Current{"serve :" ++ U32.show(h)}, P.ServePort{h, target, tailscale}), P.Blocked{what, "tailnet port " ++ U32.show(h) ++ " is served to " ++ now ++ ", which is not V's"}) Uses (15): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.contains https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.is_empty https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.show https://jend.leeeet.dev/definition.txt?path=bend-net-json@0.3.0.0/json.bend&name=Val https://jend.leeeet.dev/definition.txt?path=near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/effects.bend&name=keys https://jend.leeeet.dev/definition.txt?path=near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/effects.bend&name=proxy_on https://jend.leeeet.dev/definition.txt?path=near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/effects.bend&name=url_port https://jend.leeeet.dev/definition.txt?path=near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/type.bend&name=Serve https://jend.leeeet.dev/definition.txt?path=near-v-framework@0.4.0.0/domain/architecture/system/plan/type.bend&name=Step