CodeNameRaven.HandlerDisplay behaviour (raven_observer_display_sdk v0.4.0)

Copy Markdown

Behaviour for alert handler display modules.

Renders a handler's own dashboard panel (e.g. a firing timeline). Paired with a CodeNameRaven.Handler module the same way CodeNameRaven.Display pairs with CodeNameRaven.Monitor — self-bundled in one module, or as a separate package-sibling module declaring compatible_handlers/0.

display_name/0 is shared with CodeNameRaven.Handler's own callback of the same name — combining both behaviours in a single (self-bundled) module means whichever use runs last wins, the same "conflicting behaviours" compiler warning CodeNameRaven.Monitor/CodeNameRaven.Display would hit if combined without their display_params_* naming split. No module combines Handler and HandlerDisplay today, so this hasn't been disambiguated — worth revisiting if that ever changes in practice.

Summary

Functions

Returns true if the module implements the HandlerDisplay behaviour.

Callbacks

compatible_handlers()

@callback compatible_handlers() :: [module()]

display_name()

@callback display_name() :: String.t()

prepare_assigns(map)

@callback prepare_assigns(map()) :: map()

render(map)

@callback render(map()) :: Phoenix.LiveView.Rendered.t()

size_hint()

@callback size_hint() :: :small | :medium | :large | :full

Functions

handler_display_module?(module)

Returns true if the module implements the HandlerDisplay behaviour.