Skip to main content

crabka_schema_registry/
lib.rs

1//! Confluent Schema Registry-compatible REST service for Crabka.
2//!
3//! Standalone binary; a Kafka *client* of a Crabka broker. State lives in the
4//! `_schemas` compacted topic.
5//!
6//! ## Runtime configuration
7//!
8//! ```no_run
9//! use crabka_schema_registry::config::{RegistryConfig, SecurityConfig};
10//!
11//! let config = RegistryConfig {
12//!     bootstrap: "localhost:9092".into(),
13//!     schemas_topic: "_schemas".into(),
14//!     schemas_topic_rf: 3,
15//!     client_id: "schema-registry-1".into(),
16//!     advertised_url: "http://schema-registry-1:8081".into(),
17//!     group_id: "schema-registry".into(),
18//!     leader_eligibility: true,
19//!     security: SecurityConfig::default(),
20//! };
21//!
22//! assert_eq!(config.schemas_topic, "_schemas");
23//! ```
24//!
25//! ## Compatibility checks
26//!
27//! ```no_run
28//! use crabka_schema_registry::format::{self, SchemaType};
29//!
30//! let prior = r#"{"type":"record","name":"Order","fields":[{"name":"id","type":"string"}]}"#;
31//! let next = r#"{"type":"record","name":"Order","fields":[{"name":"id","type":"string"},{"name":"total","type":["null","double"],"default":null}]}"#;
32//!
33//! assert!(format::check(SchemaType::Avro, next, prior, &[], &[]).is_ok());
34//! ```
35
36pub mod auth;
37pub mod authz;
38pub mod cli;
39pub mod compat;
40pub mod config;
41pub mod election;
42pub mod error;
43pub mod format;
44pub mod kafkastore;
45pub mod rest;
46pub mod store;