api

http4k / org.http4k.lens / BiDiPathLens

BiDiPathLens

class BiDiPathLens<FINAL> : LensInjector<FINAL, Request>, PathLens<FINAL> (source)

Constructors

Name Summary
<init> BiDiPathLens(meta: Meta, get: (String) -> FINAL, set: (FINAL, Request) -> Request)

Functions

Name Summary
invoke operator fun <R : Request> invoke(value: FINAL, target: R): R
Lens operation to set the value into the target

Inherited Functions

Name Summary
inject open fun <R : OUT> inject(value: IN, target: R): R
Lens operation to set the value into the target. Synomym for invoke(IN, OUT)
invoke operator fun invoke(target: String): FINAL
of open infix fun <R : OUT> of(value: IN): (R) -> R
Bind this Lens to a value, so we can set it into a target
set open operator fun <R : OUT> set(target: R, value: IN): R
Lens operation to set the value into the target. Synomym for invoke(IN, OUT)

Extension Functions

Name Summary
and infix fun Trigger.and(that: Trigger): Trigger
asFilter fun Stage.asFilter(): Filter
Converts this chaos behaviour to a standard http4k Filter.
asK8sServer fun HttpHandler.asK8sServer(serverConfig: (port: Int) -> ServerConfig, port: Int = 8000, healthApp: HttpHandler = Health(), healthPort: Int = 8001): Http4kK8sServer
fun HttpHandler.asK8sServer(serverConfig: (port: Int) -> ServerConfig, env: Environment = ENV, healthApp: HttpHandler = Health()): Http4kK8sServer
asServer fun HttpHandler.asServer(fn: (Int) -> ServerConfig, port: Port): Http4kServer
fun WsHandler.asServer(config: WsServerConfig): Http4kServer
fun HttpHandler.asServer(config: ServerConfig): Http4kServer
asServlet fun HttpHandler.asServlet(): HttpHandlerServlet
bindContract infix fun <A> PathLens<A>.bindContract(method: Method): ContractRouteSpec1.Binder<A>
div operator fun <A> PathLens<A>.div(next: String): ContractRouteSpec2<A, String>
operator fun <A, B> PathLens<A>.div(next: PathLens<B>): ContractRouteSpec2<A, B>
not operator fun Trigger.not(): (Request) -> Boolean
or infix fun Trigger.or(that: Trigger): Trigger
testWsClient fun WsHandler.testWsClient(request: Request): TestWsClient?
then fun Stage.then(nextStage: Stage): Stage
Chain the next ChaosBehaviour to apply when this stage is finished.
until fun Stage.until(trigger: Trigger): Stage
Stop applying the ChaosBehaviour of this stage when the ChaosTrigger fires.
with fun <T> T.with(vararg modifiers: (T) -> T): T
withAsyncApi fun HttpHandler.withAsyncApi(): AsyncHttpClient
Convert a synchronous HttpHandler API to mimic AsyncHttpClient
withChaosControls fun HttpHandler.~~withChaosControls~~(stage: Stage = ChaosStages.Wait, security: Security = NoSecurity, controlsPath: String = "/chaos", openApiPath: String = "", corsPolicy: CorsPolicy = CorsPolicy.UnsafeGlobalPermissive): RoutingHttpHandler
withChaosEngine fun HttpHandler.withChaosEngine(stage: Stage = Wait, security: Security = NoSecurity, controlsPath: String = "/chaos", openApiPath: String = "", corsPolicy: CorsPolicy = UnsafeGlobalPermissive): RoutingHttpHandler
Convert a standard HttpHandler to be Chaos-enabled, using the passed ChaosStage. Optionally a Security can be passed to limit access to the chaos controls.