def framework

bend-kit-camber@0.15.0.1 · camber.bend:846

import bend-kit-camber@0.15.0.1/camber.bend as Camber
import Base
import bend-kit-http@0.38.1.1/http.bend as Http

846def framework(~S: Type, ~K: Data, ~E: Data, ~H: Data,
847  ~mapper: S -> K -> Error<E> -> IO(S & Result<&2, &1, Error<E>, Http.Res>),
848  +status: U32, allow: String, state: S, config: K, entered: List<&2, Policy<H>>, body: Http.Body
849) -> IO(Completion<S, H>):
850  match status:
851    case 204:
852      IO.pure(Completion<S, H>, Completed{state, Http.Res{204, Http.set(Http.empty(), "allow", allow), Http.from_string("")}, entered, False{}, False{}})
853    case _:
854      failed(~S, ~K, ~E, ~H, ~mapper, False{}, state, config, Framework{status, allow}, entered, False{})

Uses (19)

Used by (2)