Skip to main content

Module plugin

Module plugin 

Source
Expand description

Plugin trait for custom fault injection modules.

Implement VortexPlugin to add custom fault types that integrate with all Vortex layers. Plugins are registered at runtime and evaluated alongside the built-in fault rules.

§Example

use vortex_core::plugin::{VortexPlugin, FaultCheck, PluginContext};
use vortex_core::DetRng;

struct GrpcPlugin;

impl VortexPlugin for GrpcPlugin {
    fn name(&self) -> &str { "grpc" }

    fn check_fault(&self, ctx: &mut PluginContext, operation: &str) -> FaultCheck {
        if operation.starts_with("grpc:") && ctx.rng.chance(0.1) {
            FaultCheck::Inject { message: "gRPC unavailable".into() }
        } else {
            FaultCheck::Pass
        }
    }
}

Structs§

PluginContext
Context passed to plugins during fault evaluation.
PluginRegistry
Registry of active plugins.

Enums§

FaultCheck
Result of a plugin fault check.

Traits§

VortexPlugin
Trait for custom fault injection plugins.