Slither.Context (Slither v0.1.0)

Copy Markdown View Source

Run context passed through every stage in a Slither pipeline.

Contains session affinity for Snakepit/SnakeBridge, store handles, run metadata, and telemetry correlation.

Summary

Functions

Create a new context with a fresh session ID.

Merge additional metadata into the context.

Set the current stage name on the context.

Types

t()

@type t() :: %Slither.Context{
  metadata: map(),
  pipe: atom() | nil,
  runtime: map(),
  session_id: binary() | nil,
  stage: atom() | nil,
  stores: %{required(atom()) => pid() | atom()}
}

Functions

new(opts \\ [])

@spec new(keyword()) :: t()

Create a new context with a fresh session ID.

put_metadata(ctx, meta)

@spec put_metadata(t(), map()) :: t()

Merge additional metadata into the context.

with_stage(ctx, stage_name)

@spec with_stage(t(), atom()) :: t()

Set the current stage name on the context.