rigatoni_core/lib.rs
1// Copyright 2025 Rigatoni Contributors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// SPDX-License-Identifier: Apache-2.0
16
17//! Rigatoni Core - CDC/Data Replication Framework Core Types and Traits
18//!
19//! This crate provides the foundational types and traits for the Rigatoni CDC/Data Replication framework.
20//! It includes event definitions, pipeline orchestration, and `MongoDB` integration.
21//!
22//! # Key Components
23//!
24//! - **Events**: [`event`] module defines `MongoDB` change stream events
25//! - **Stream**: [`stream`] module provides `MongoDB` change stream listener with auto-reconnection
26//! - **Destination**: [`destination`] module defines the destination trait for writing events
27//! - **State**: [`state`] module provides state storage for resume tokens
28//! - **Pipeline**: [`pipeline`] module provides the core pipeline orchestration
29//! - **Traits**: Source and Transform traits (coming soon)
30//!
31//! # Example
32//!
33//! ```rust
34//! use rigatoni_core::event::{ChangeEvent, OperationType};
35//!
36//! fn process_event(event: ChangeEvent) {
37//! match event.operation {
38//! OperationType::Insert => println!("New document inserted"),
39//! OperationType::Update => println!("Document updated"),
40//! OperationType::Delete => println!("Document deleted"),
41//! _ => println!("Other operation"),
42//! }
43//! }
44//! ```
45
46pub mod destination;
47pub mod event;
48pub mod metrics;
49pub mod pipeline;
50pub mod state;
51pub mod stream;