api

http4k / org.http4k.chaos

Package org.http4k.chaos

Types

Name Summary
Behaviour Encapsulates the type of bad behaviour to apply to the response.typealias Behaviour = Filter
ChaosBehaviours object ChaosBehaviours
ChaosEngine The Chaos Engine controls the lifecycle of applying Chaotic behaviour to traffic, which is exposed as a standard Http4k Filter. Chaos can be programmatically updated and enabled/disabled. By default, the engine is deactivated, so activate() needs to be called to witness any change in behaviour,class ChaosEngine : Filter
ChaosStages object ChaosStages
ChaosTriggers object ChaosTriggers
RemoteChaosApi A set of endpoints to an application which will control the setting and toggling chaos behaviour. The added endpoints are: GET //status <- check the on off/status of the injected chaos POST //activate <- turn on the chaos. optionally POST a JSON body to set a list of new stages to use. POST //deactivate <- turn off the chaos POST //toggle <- toggle the chaosobject RemoteChaosApi
Stage Defines a periodic element during which a particular ChaosBehaviour is active.typealias Stage = (Request) -> Filter?
Trigger typealias Trigger = (req: Request) -> Boolean

Extensions for External Classes

Name Summary
com.fasterxml.jackson.databind.JsonNode  
kotlin.Function1  

Functions

Name Summary
appliedWhen fun Behaviour.appliedWhen(trigger: Trigger): Stage
withChaosApi 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.fun RoutingHttpHandler.withChaosApi(engine: ChaosEngine = ChaosEngine(), security: Security = NoSecurity, controlsPath: String = "/chaos", openApiPath: String = "", corsPolicy: CorsPolicy = UnsafeGlobalPermissive, clock: Clock = Clock.systemUTC(), apiName: String = "http4k"): RoutingHttpHandler