nydus_api/
lib.rs

1// Copyright 2020 Ant Group. All rights reserved.
2//
3// SPDX-License-Identifier: Apache-2.0
4
5//! APIs for the Nydus Image Service
6//!
7//! The `nydus-api` crate defines API and related data structures for Nydus Image Service.
8//! All data structures used by the API are encoded in JSON format.
9
10#[cfg_attr(feature = "handler", macro_use)]
11extern crate log;
12#[macro_use]
13extern crate serde;
14#[cfg(feature = "handler")]
15#[macro_use]
16extern crate lazy_static;
17
18pub mod config;
19pub use config::*;
20#[macro_use]
21pub mod error;
22pub mod http;
23pub use self::http::*;
24
25#[cfg(feature = "handler")]
26pub(crate) mod http_endpoint_common;
27#[cfg(feature = "handler")]
28pub(crate) mod http_endpoint_v1;
29#[cfg(feature = "handler")]
30pub(crate) mod http_endpoint_v2;
31#[cfg(feature = "handler")]
32pub(crate) mod http_handler;
33
34#[cfg(feature = "handler")]
35pub use http_handler::{
36    extract_query_part, start_http_thread, EndpointHandler, HttpResult, HttpRoutes, HTTP_ROUTES,
37};
38
39/// Application build and version information.
40#[derive(Serialize, Clone)]
41pub struct BuildTimeInfo {
42    pub package_ver: String,
43    pub git_commit: String,
44    pub build_time: String,
45    pub profile: String,
46    pub rustc: String,
47}