2 releases
0.1.1-alpha | Sep 2, 2024 |
---|---|
0.1.0-alpha | Sep 2, 2024 |
#2663 in Database interfaces
14KB
OCSF Schema
Unofficial OCSF data types for Rust based on OCSF JSON Schema.
Getting started
Install with:
cargo add ocsf-schema-rs
Usage
Data types are generated using Typify. Structs can be constructed either manually:
let g = Group {
type_: None,
desc: None,
domain: None,
name: Some(String::from("My Group")),
privileges: vec![],
uid: None,
};
or with builder:
let g: Group = Group::builder()
.name(String::from("My Group"))
.try_into()
.unwrap();
Development
Install deps:
pip install -r scripts/requirements.txt
Download OCSF JSON Schema:
python scripts/download_schemas.py
python scripts/generate_all_schema.py
Build ocsf-schema-rs
cd ocsf-schema-rs
cargo build
Compatibility
ocsf-schema-rs | OCSF |
---|---|
0.1.0-alpha | 1.3.0 |
Dependencies
~5.5MB
~113K SLoC