def Leader.read

bend-kube-runtime@0.2.0.0 · src/leader.bend:53

import bend-kube-runtime@0.2.0.0/src/leader.bend as Leader
import Base
import bend-kube-runtime@0.2.0.0/src/json.bend as J
import bend-kube-runtime@0.2.0.0/src/client.bend as Cl

53# The Lease read: Some, None on 404, or the error.
54def Leader.read(r: Result<&2, &2, Cl.KErr, J.Json>) -> Result<&2, &2, Cl.KErr, Maybe<&2, J.Json>>:
55  match r:
56    case Done{l}:
57      Done{Some{l}}
58    case Fail{+e}:
59      Leader.read.err(e, U32.is_eq(Cl.KErr.code(e), 404))

Uses (7)

Used by (1)