Trigger

fun interface Trigger : Function1<Request, Boolean>

Functions

Link copied to clipboard
infix fun Trigger.and(that: Trigger): Trigger
Link copied to clipboard

Converts this chaos stage to a standard http4k Filter.

Link copied to clipboard
abstract operator fun invoke(p1: Request): Boolean
Link copied to clipboard
operator fun Trigger.not(): Trigger
Link copied to clipboard
infix fun Trigger.or(that: Trigger): Trigger
Link copied to clipboard
fun Stage.then(nextStage: Stage): (Request) -> Filter?

Chain the next ChaosBehaviour to apply when this stage is finished.

Link copied to clipboard
fun Stage.until(trigger: Trigger): Stage

Stop applying the ChaosBehaviour of this stage when the ChaosTrigger fires.

Link copied to clipboard
fun HttpHandler.withChaosApi(engine: ChaosEngine = ChaosEngine(), security: Security = NoSecurity, controlsPath: String = "/chaos", openApiPath: String = "", corsPolicy: CorsPolicy = UnsafeGlobalPermissive, clock: Clock = Clock.systemUTC(), apiName: String = "http4k"): RoutingHttpHandler

Mixin the set of remote Chaos API endpoints to a standard HttpHandler, using the passed ChaosStage. Optionally a Security can be passed to limit access to the chaos controls.