Skip to main content

Crate drasi_source_mapping

Crate drasi_source_mapping 

Source
Expand description

Source payload mapping engine for Drasi.

Transforms arbitrary JSON payloads into graph change events (SourceChange) using Handlebars templates. This crate provides a shared mapping mechanism used by sources that receive arbitrary payloads (HTTP webhooks, Kafka messages, etc.).

§Overview

The mapping engine takes:

  • A SourceMapping configuration defining how to extract graph elements from payloads
  • A serde_json::Value context containing the payload and any source-specific metadata
  • A source ID string

And produces SourceChange events (Insert, Update, Delete) that can be dispatched to the Drasi query engine.

Structs§

ElementTemplate
Template for element creation
ElementTemplateDto
DTO for element template (user-facing, camelCase).
MappingCondition
Condition for when a mapping applies
MappingConditionDto
DTO for mapping condition (user-facing, camelCase).
SourceMapping
Mapping configuration from source payload to graph change event.
SourceMappingDto
DTO for source mapping configuration (user-facing, camelCase).
SourceMappingEngine
Source mapping engine that transforms payloads into graph change events.

Enums§

EffectiveFromConfig
Configuration for effective_from timestamp
EffectiveFromConfigDto
DTO for effective_from timestamp configuration (user-facing, camelCase).
ElementType
Element type for source changes
ElementTypeDto
DTO for element type (user-facing).
OperationType
Operation type for source changes
OperationTypeDto
DTO for operation type (user-facing).
TimestampFormat
Timestamp format for effective_from
TimestampFormatDto
DTO for timestamp format (user-facing).

Functions§

json_to_element_value
Convert JSON value to ElementValue