lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README | LICENSE

model.rs (2317B)


      1 use std::collections::BTreeMap;
      2 
      3 use serde::Deserialize;
      4 
      5 #[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
      6 pub struct RadrootsRuntimeDistributionContract {
      7     pub schema: String,
      8     pub schema_version: u32,
      9     pub owner_doc: String,
     10     pub runtime_registry: String,
     11     pub family: DistributionFamily,
     12     pub channels: ChannelSet,
     13     #[serde(default)]
     14     pub artifact_adapters: BTreeMap<String, ArtifactAdapter>,
     15     #[serde(default)]
     16     pub archive_formats: BTreeMap<String, ArchiveFormat>,
     17     #[serde(default)]
     18     pub target_sets: BTreeMap<String, TargetSet>,
     19     #[serde(default)]
     20     pub targets: BTreeMap<String, TargetSpec>,
     21     #[serde(default)]
     22     pub runtime: Vec<RuntimeDistributionEntry>,
     23 }
     24 
     25 #[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
     26 pub struct DistributionFamily {
     27     pub id: String,
     28     pub canonical_installer_engine: String,
     29     pub human_install_facade: String,
     30     pub tooling_consumption: String,
     31     pub independent_runtime_versions: bool,
     32     pub version_resolution: String,
     33     pub artifact_verification_required: bool,
     34 }
     35 
     36 #[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
     37 pub struct ChannelSet {
     38     #[serde(default)]
     39     pub active: Vec<String>,
     40     #[serde(default)]
     41     pub defined: Vec<String>,
     42 }
     43 
     44 #[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
     45 pub struct ArtifactAdapter {
     46     pub kind: String,
     47     #[serde(default)]
     48     pub supported_archive_formats: Vec<String>,
     49     pub layout: String,
     50 }
     51 
     52 #[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
     53 pub struct ArchiveFormat {
     54     pub extension: String,
     55     #[serde(default)]
     56     pub platforms: Vec<String>,
     57 }
     58 
     59 #[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
     60 pub struct TargetSet {
     61     #[serde(default)]
     62     pub targets: Vec<String>,
     63 }
     64 
     65 #[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
     66 pub struct TargetSpec {
     67     pub os: String,
     68     pub arch: String,
     69     pub archive_format: Option<String>,
     70 }
     71 
     72 #[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
     73 pub struct RuntimeDistributionEntry {
     74     pub id: String,
     75     pub distribution_state: String,
     76     pub release_unit: String,
     77     pub package_name: String,
     78     pub binary_name: Option<String>,
     79     pub artifact_adapter: String,
     80     pub target_set: Option<String>,
     81     pub default_channel: String,
     82     pub human_installable: bool,
     83     pub notes: Option<String>,
     84 }