bb_config/lib.rs
1//! # Introduction
2//!
3//! BeagleBoard.org maintains a json file with the list of all board images which can be used by
4//! applications (like BeagleBoard Imaging Utility) to get a list of latest images for each board.
5//!
6//! This crate provides abstractions to parse and generate distros.json file.
7//!
8//! # Usage
9//!
10//! ```no_run
11//! let config: bb_config::Config = reqwest::blocking::get(bb_config::DISTROS_URL)
12//! .unwrap()
13//! .json()
14//! .unwrap();
15//!
16//! // Convert back to JSON
17//! let json_config = serde_json::to_string_pretty(&config).unwrap();
18//! ```
19
20pub mod config;
21
22/// URL for the BeagleBoard.org `distros.json` file
23pub const DISTROS_URL: &str = "https://www.beagleboard.org/distros.json";
24
25pub use config::Config;
26
27#[cfg(test)]
28mod tests {
29 #[test]
30 fn basic() {
31 let data = include_bytes!("../../config.json");
32 serde_json::from_slice::<super::Config>(data).unwrap();
33 }
34}