ic_query/subnet_catalog/
mod.rs1mod error;
4#[cfg(any(feature = "host", feature = "subnet-catalog-host"))]
5mod host;
6mod json;
7mod model;
8mod principal;
9#[cfg(any(feature = "host", feature = "subnet-catalog-host"))]
10mod report;
11mod resolver;
12#[cfg(any(feature = "host", feature = "subnet-catalog-host"))]
13mod text;
14#[cfg(any(feature = "host", feature = "subnet-catalog-host"))]
15mod time;
16
17pub use error::CatalogError;
18#[cfg(any(feature = "host", feature = "subnet-catalog-host"))]
19pub use host::{
20 CachedSubnetCatalog, SubnetCatalogCacheRequest, SubnetCatalogHostError,
21 SubnetCatalogRefreshRequest, SubnetCatalogSource, load_cached_subnet_catalog,
22 load_or_refresh_subnet_catalog, load_or_refresh_subnet_catalog_with_source,
23 refresh_subnet_catalog, refresh_subnet_catalog_with_source, subnet_catalog_path,
24 subnet_catalog_refresh_lock_path,
25};
26pub use json::{catalog_to_pretty_json, parse_catalog_json};
27pub use model::{
28 ClassificationSource, GeographicScope, RoutingRange, SubnetCatalog, SubnetInfo, SubnetKind,
29 SubnetSpecialization,
30};
31pub use principal::canonical_principal_text;
32pub(crate) use principal::{parse_principal, principal_bytes};
33#[cfg(any(feature = "host", feature = "subnet-catalog-host"))]
34pub(crate) use report::CatalogStaleStatus;
35#[cfg(any(feature = "host", feature = "subnet-catalog-host"))]
36pub use report::{
37 SubnetCatalogFilters, SubnetCatalogInfoReport, SubnetCatalogInfoRequest,
38 SubnetCatalogListReport, SubnetCatalogListRequest, SubnetCatalogRefreshReport,
39 SubnetCatalogSubnetRow, build_subnet_catalog_info_report,
40 build_subnet_catalog_info_report_with_source, build_subnet_catalog_list_report,
41 build_subnet_catalog_list_report_with_source,
42};
43pub use resolver::{ResolveAs, ResolvedSubnet, ResolvedSubnetSubject};
44#[cfg(all(test, any(feature = "host", feature = "subnet-catalog-host")))]
45pub(crate) use text::compact_principal;
46#[cfg(any(feature = "host", feature = "subnet-catalog-host"))]
47pub use text::{
48 subnet_catalog_info_report_text, subnet_catalog_list_report_text,
49 subnet_catalog_list_report_verbose_text, subnet_catalog_refresh_report_text,
50};
51#[cfg(all(test, any(feature = "host", feature = "subnet-catalog-host")))]
52pub(crate) use time::parse_stale_after_duration;
53#[cfg(feature = "host")]
54pub(crate) use time::parse_utc_timestamp_secs;
55#[cfg(any(feature = "host", feature = "subnet-catalog-host"))]
56pub(crate) use time::{catalog_stale_status, format_utc_timestamp_secs};
57
58pub const CATALOG_SCHEMA_VERSION: u32 = 1;
59pub const MAINNET_NETWORK: &str = "ic";
60pub const MAINNET_REGISTRY_CANISTER_ID: &str = "rwlgt-iiaaa-aaaaa-aaaaa-cai";
61#[cfg(any(feature = "host", feature = "subnet-catalog-host"))]
62pub const DEFAULT_STALE_AFTER_SECONDS: u64 = 7 * 24 * 60 * 60;
63#[cfg(any(feature = "host", feature = "subnet-catalog-host"))]
64pub const DEFAULT_REFRESH_LOCK_STALE_SECONDS: u64 = 30 * 60;
65#[cfg(any(feature = "host", feature = "subnet-catalog-host"))]
66pub const DEFAULT_SUBNET_CATALOG_SOURCE_ENDPOINT: &str = "https://icp-api.io";
67#[cfg(any(feature = "host", feature = "subnet-catalog-host"))]
68pub(crate) const SUBNET_CATALOG_LIST_REPORT_SCHEMA_VERSION: u32 = 1;
69#[cfg(any(feature = "host", feature = "subnet-catalog-host"))]
70pub(crate) const SUBNET_CATALOG_INFO_REPORT_SCHEMA_VERSION: u32 = 1;
71#[cfg(any(feature = "host", feature = "subnet-catalog-host"))]
72pub(crate) const SUBNET_CATALOG_REFRESH_REPORT_SCHEMA_VERSION: u32 = 1;
73
74#[cfg(test)]
75mod core_tests;
76#[cfg(all(test, any(feature = "host", feature = "subnet-catalog-host")))]
77mod tests;